feat: Simplify drone controller to basic flight pattern, overhaul installation guide, and update related scripts.
This commit is contained in:
178
README.md
178
README.md
@@ -1,121 +1,121 @@
|
||||
# GPS-Denied Drone Landing Simulation
|
||||
# RDC Simulation
|
||||
|
||||
ArduPilot + ROS 2 + Gazebo (ARG) simulation for landing on a moving platform.
|
||||
GPS-denied drone landing simulation using ArduPilot and Gazebo.
|
||||
|
||||
## Quick Start (2 Terminals)
|
||||
## Quick Start
|
||||
|
||||
**Terminal 1 - Gazebo:**
|
||||
```bash
|
||||
source activate.sh
|
||||
./scripts/run_ardupilot_sim.sh runway
|
||||
```
|
||||
### Prerequisites
|
||||
- Ubuntu 22.04/24.04 (or WSL2 on Windows)
|
||||
- Python 3.10+
|
||||
- ~10GB disk space
|
||||
|
||||
**Terminal 2 - Controller:**
|
||||
```bash
|
||||
source activate.sh
|
||||
./scripts/run_ardupilot_controller.sh
|
||||
```
|
||||
|
||||
## World Options
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
./scripts/run_ardupilot_sim.sh runway # Default (outdoor)
|
||||
./scripts/run_ardupilot_sim.sh warehouse # Indoor
|
||||
./scripts/run_ardupilot_sim.sh custom # Custom landing pad
|
||||
./scripts/run_ardupilot_sim.sh my_world # gazebo/worlds/my_world.sdf
|
||||
```
|
||||
# Clone the repository
|
||||
git clone <repo-url> RDC_Simulation
|
||||
cd RDC_Simulation
|
||||
|
||||
## Installation
|
||||
# Install everything (20-30 minutes)
|
||||
./setup/install_ubuntu.sh --with-ardupilot
|
||||
|
||||
### Ubuntu (Native or WSL2)
|
||||
|
||||
```bash
|
||||
./setup/install_ubuntu.sh
|
||||
./setup/install_ardupilot.sh
|
||||
# Reload environment
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
### Windows (via WSL2)
|
||||
### Run the Simulation
|
||||
|
||||
```powershell
|
||||
# PowerShell as Administrator
|
||||
wsl --install -d Ubuntu-24.04
|
||||
# Restart, then in Ubuntu terminal:
|
||||
./setup/install_ubuntu.sh --with-ardupilot
|
||||
You need **3 terminals**:
|
||||
|
||||
**Terminal 1 - Gazebo:**
|
||||
```bash
|
||||
cd ~/RDC_Simulation
|
||||
./scripts/run_ardupilot_sim.sh runway
|
||||
# Wait until the drone appears in Gazebo
|
||||
```
|
||||
|
||||
### macOS
|
||||
**Terminal 2 - SITL:**
|
||||
```bash
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console
|
||||
# Wait for "Waiting for connection" then telemetry
|
||||
```
|
||||
|
||||
**Terminal 3 - Controller:**
|
||||
```bash
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
cd ~/RDC_Simulation
|
||||
python scripts/run_ardupilot.py --pattern square
|
||||
```
|
||||
|
||||
### Flight Patterns
|
||||
|
||||
```bash
|
||||
./setup/install_macos.sh
|
||||
python standalone_simulation.py # Gazebo not supported
|
||||
```
|
||||
# Fly a square pattern (default)
|
||||
python scripts/run_ardupilot.py --pattern square --size 5
|
||||
|
||||
See [Installation Guide](docs/installation.md) for detailed platform instructions.
|
||||
# Fly a circle
|
||||
python scripts/run_ardupilot.py --pattern circle --size 5
|
||||
|
||||
# Just hover in place
|
||||
python scripts/run_ardupilot.py --pattern hover
|
||||
|
||||
# Custom altitude
|
||||
python scripts/run_ardupilot.py --pattern square --altitude 10
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
simulation/
|
||||
├── config.py
|
||||
├── src/
|
||||
│ └── drone_controller.py # Your algorithm
|
||||
RDC_Simulation/
|
||||
├── scripts/
|
||||
│ ├── run_ardupilot_sim.sh
|
||||
│ └── run_ardupilot_controller.sh
|
||||
├── gazebo/
|
||||
│ ├── worlds/ # Your worlds
|
||||
│ └── models/ # Your models
|
||||
│ ├── run_ardupilot_sim.sh # Launch Gazebo
|
||||
│ ├── run_ardupilot_controller.sh # Launch SITL + Controller
|
||||
│ └── run_ardupilot.py # Flight controller
|
||||
├── src/
|
||||
│ ├── drone_controller.py # Simple drone controller
|
||||
│ ├── rover_controller.py # Moving landing pad (ROS 2)
|
||||
│ └── camera_viewer.py # Camera viewer (ROS 2)
|
||||
├── setup/
|
||||
└── docs/
|
||||
│ ├── install_ubuntu.sh # Ubuntu installer
|
||||
│ ├── install_ardupilot.sh # ArduPilot installer
|
||||
│ └── install_arch.sh # Arch Linux installer
|
||||
├── gazebo/
|
||||
│ └── models/ # Custom Gazebo models
|
||||
├── docs/ # Documentation
|
||||
└── config.py # Configuration
|
||||
```
|
||||
|
||||
## 3-Phase Mission
|
||||
|
||||
| Phase | Action |
|
||||
|-------|--------|
|
||||
| SEARCH | Find QR code on rover |
|
||||
| COMMAND | Send commands to rover |
|
||||
| LAND | Land on rover |
|
||||
|
||||
## Environment Setup
|
||||
|
||||
Always activate the environment before running:
|
||||
|
||||
```bash
|
||||
source activate.sh
|
||||
```
|
||||
|
||||
This sets up:
|
||||
- ROS 2 environment
|
||||
- ArduPilot venv (with empy, pymavlink, etc.)
|
||||
- Gazebo resource paths
|
||||
- ArduPilot tools path
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**sim_vehicle.py not found:**
|
||||
```bash
|
||||
source ~/.ardupilot_env
|
||||
```
|
||||
### "No JSON sensor message received"
|
||||
Gazebo isn't sending data to SITL.
|
||||
- **Fix**: Start Gazebo FIRST, wait for it to fully load, THEN start SITL.
|
||||
|
||||
**empy not found:**
|
||||
```bash
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
pip install empy==3.3.4
|
||||
```
|
||||
### "empy not found"
|
||||
Wrong Python environment.
|
||||
- **Fix**: `source ~/venv-ardupilot/bin/activate`
|
||||
|
||||
**Gazebo slow (software rendering):**
|
||||
```bash
|
||||
glxinfo | grep "OpenGL renderer"
|
||||
# Should show GPU, not "llvmpipe"
|
||||
```
|
||||
### "sim_vehicle.py not found"
|
||||
ArduPilot tools not in PATH.
|
||||
- **Fix**: `source ~/.ardupilot_env`
|
||||
|
||||
### Can't arm
|
||||
The drone won't arm or takeoff.
|
||||
- **Fix**: Make sure you're in GUIDED mode and Gazebo is running.
|
||||
- Check console for pre-arm errors.
|
||||
|
||||
### Gazebo is slow
|
||||
- Try a lighter world: `./scripts/run_ardupilot_sim.sh runway`
|
||||
- Check GPU: `glxinfo | grep "OpenGL renderer"`
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Installation](docs/installation.md) - Full setup for all platforms + WSL
|
||||
- [ArduPilot Guide](docs/ardupilot.md) - SITL setup and troubleshooting
|
||||
- [Drone Controller](docs/drone_guide.md) - Landing algorithm
|
||||
- [Custom Worlds](docs/gazebo_worlds.md) - Create Gazebo environments
|
||||
- [Blender Models](docs/blender_models.md) - 3D model workflow
|
||||
- [Architecture](docs/architecture.md) - System design
|
||||
- [Installation Guide](docs/installation.md)
|
||||
- [ArduPilot Guide](docs/ardupilot.md)
|
||||
- [Architecture](docs/architecture.md)
|
||||
- [Gazebo Worlds](docs/gazebo_worlds.md)
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
Reference in New Issue
Block a user