fcceabd47eebd2b064a60ba29f3e9969a17ef828
RDC Simulation
GPS-Denied Drone Landing Simulation using ArduPilot and Gazebo.
Quick Start
Prerequisites
- Ubuntu 22.04/24.04 (or WSL2 on Windows)
- Python 3.10+
- ~10GB disk space
Installation
# Clone the repository
git clone <repo-url> RDC_Simulation
cd RDC_Simulation
# Full installation (20-30 minutes)
./setup/install_ubuntu.sh
# Reload environment
source ~/.bashrc
Run the Simulation (3 Terminals)
Terminal 1 - Start Gazebo FIRST:
cd ~/RDC_Simulation
./scripts/run_ardupilot_sim.sh runway
# WAIT until you see the drone in Gazebo!
Terminal 2 - Start ArduCopter SITL:
source ~/.ardupilot_env
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console
# Wait for "JSON received:" messages (shows Gazebo is connected)
Terminal 3 - Run Controller:
cd ~/RDC_Simulation
source activate.sh
python scripts/run_ardupilot.py --pattern square
Flight Patterns
# Fly a square pattern (default)
python scripts/run_ardupilot.py --pattern square --size 5
# 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
# Use GPS mode instead of GPS-denied
python scripts/run_ardupilot.py --pattern square --gps
Project Structure
RDC_Simulation/
├── scripts/
│ ├── run_ardupilot_sim.sh # Launch Gazebo
│ ├── run_ardupilot_controller.sh # Launch SITL + Controller
│ └── run_ardupilot.py # Flight controller entry point
├── src/
│ ├── 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/WSL installer
│ ├── install_ardupilot.sh # ArduPilot installer
│ └── install_arch.sh # Arch Linux installer
├── gazebo/
│ └── models/ # Custom Gazebo models
├── docs/ # Documentation
└── config.py # Configuration
Troubleshooting
"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" or wrong Python
Wrong virtual environment.
source ~/.ardupilot_env
pip install empy==3.3.4
"sim_vehicle.py not found"
ArduPilot tools not in PATH.
source ~/.ardupilot_env
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
Wrong vehicle type (ArduPlane instead of ArduCopter)
You see modes like FBWA, FBWB, QSTABILIZE.
# 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
License
MIT License
Description
Languages
Python
66.3%
Shell
25.4%
PowerShell
4.5%
Dockerfile
3.8%