docs: Improve quick start, ArduPilot setup, and troubleshooting, and add GPS mode option.
This commit is contained in:
60
README.md
60
README.md
@@ -1,6 +1,6 @@
|
||||
# RDC Simulation
|
||||
|
||||
GPS-denied drone landing simulation using ArduPilot and Gazebo.
|
||||
**GPS-Denied Drone Landing Simulation** using ArduPilot and Gazebo.
|
||||
|
||||
## Quick Start
|
||||
|
||||
@@ -23,25 +23,23 @@ cd RDC_Simulation
|
||||
source ~/.bashrc
|
||||
```
|
||||
|
||||
### Run the Simulation
|
||||
### Run the Simulation (3 Terminals)
|
||||
|
||||
You need **3 terminals**:
|
||||
|
||||
**Terminal 1 - Gazebo:**
|
||||
**Terminal 1 - Start Gazebo FIRST:**
|
||||
```bash
|
||||
cd ~/RDC_Simulation
|
||||
./scripts/run_ardupilot_sim.sh runway
|
||||
# Wait until the drone appears in Gazebo
|
||||
# WAIT until you see the drone in Gazebo!
|
||||
```
|
||||
|
||||
**Terminal 2 - SITL:**
|
||||
**Terminal 2 - Start ArduCopter 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
|
||||
# Wait for "JSON received:" messages (shows Gazebo is connected)
|
||||
```
|
||||
|
||||
**Terminal 3 - Controller:**
|
||||
**Terminal 3 - Run Controller:**
|
||||
```bash
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
cd ~/RDC_Simulation
|
||||
@@ -62,6 +60,9 @@ python scripts/run_ardupilot.py --pattern hover
|
||||
|
||||
# Custom altitude
|
||||
python scripts/run_ardupilot.py --pattern square --altitude 10
|
||||
|
||||
# Use GPS mode instead of GPS-denied
|
||||
python scripts/run_ardupilot.py --pattern square --gps
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
@@ -71,13 +72,13 @@ RDC_Simulation/
|
||||
├── scripts/
|
||||
│ ├── run_ardupilot_sim.sh # Launch Gazebo
|
||||
│ ├── run_ardupilot_controller.sh # Launch SITL + Controller
|
||||
│ └── run_ardupilot.py # Flight controller
|
||||
│ └── run_ardupilot.py # Flight controller entry point
|
||||
├── src/
|
||||
│ ├── drone_controller.py # Simple drone controller
|
||||
│ ├── drone_controller.py # Main drone controller class
|
||||
│ ├── rover_controller.py # Moving landing pad (ROS 2)
|
||||
│ └── camera_viewer.py # Camera viewer (ROS 2)
|
||||
├── setup/
|
||||
│ ├── install_ubuntu.sh # Ubuntu installer
|
||||
│ ├── install_ubuntu.sh # Ubuntu/WSL installer
|
||||
│ ├── install_ardupilot.sh # ArduPilot installer
|
||||
│ └── install_arch.sh # Arch Linux installer
|
||||
├── gazebo/
|
||||
@@ -92,29 +93,40 @@ RDC_Simulation/
|
||||
Gazebo isn't sending data to SITL.
|
||||
- **Fix**: Start Gazebo FIRST, wait for it to fully load, THEN start SITL.
|
||||
|
||||
### "empy not found"
|
||||
Wrong Python environment.
|
||||
- **Fix**: `source ~/venv-ardupilot/bin/activate`
|
||||
### "empy not found" or wrong Python
|
||||
Wrong virtual environment.
|
||||
```bash
|
||||
source ~/venv-ardupilot/bin/activate
|
||||
pip install empy==3.3.4
|
||||
```
|
||||
|
||||
### "sim_vehicle.py not found"
|
||||
ArduPilot tools not in PATH.
|
||||
- **Fix**: `source ~/.ardupilot_env`
|
||||
```bash
|
||||
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.
|
||||
### Drone won't arm
|
||||
- Make sure SITL is in STABILIZE or GUIDED mode
|
||||
- Check for pre-arm errors in MAVProxy console
|
||||
- Try in MAVProxy: `arm throttle force`
|
||||
|
||||
### Gazebo is slow
|
||||
- Try a lighter world: `./scripts/run_ardupilot_sim.sh runway`
|
||||
- Check GPU: `glxinfo | grep "OpenGL renderer"`
|
||||
### Wrong vehicle type (ArduPlane instead of ArduCopter)
|
||||
You see modes like FBWA, FBWB, QSTABILIZE.
|
||||
```bash
|
||||
# Kill old processes
|
||||
pkill -9 -f sim_vehicle
|
||||
|
||||
# Start with explicit ArduCopter
|
||||
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console --wipe-eeprom
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
- [Installation Guide](docs/installation.md)
|
||||
- [ArduPilot Guide](docs/ardupilot.md)
|
||||
- [Drone Controller Guide](docs/drone_guide.md)
|
||||
- [Architecture](docs/architecture.md)
|
||||
- [Gazebo Worlds](docs/gazebo_worlds.md)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user