A ROS 2 simulation environment for UAV and UGV development using GPS-denied navigation with vision-based localization, while maintaining GPS-based geofencing for safety.
- GPS-Denied Navigation: Visual odometry, optical flow, and EKF sensor fusion
- GPS-Based Geofencing: Safety boundaries using GPS (navigation remains GPS-free)
- ArUco Marker Search: Spiral, lawnmower, and Lévy walk search algorithms
- Multi-Vehicle Support: Coordinated UAV and UGV operations
- ArduPilot SITL: Full flight controller simulation
- Gazebo Harmonic: Modern physics simulation
- ROS 2 Integration: Full ROS 2 Humble/Jazzy support
- Ubuntu 22.04 or 24.04 (WSL2 supported)
- 16GB RAM recommended
- 50GB disk space
- NVIDIA GPU recommended (software rendering available)
ffmpeg,x11-utils,xdotool(for simulation recording)
git clone <repository-url> ~/sim/uav_ugv_simulation
cd ~/sim/uav_ugv_simulation
bash setup.shInstallation takes 20-40 minutes (builds ArduPilot from source).
cd ~/sim/uav_ugv_simulation
source activate_venv.sh
# Spiral search (default)
bash scripts/run_autonomous.sh --search spiral
# Lawnmower search
bash scripts/run_autonomous.sh --search lawnmower
# Lévy walk search
bash scripts/run_autonomous.sh --search levy
# WSL/Software rendering
bash scripts/run_autonomous.sh --software-render --search spiralbash scripts/run_simulation.sh
# Wait for EKF initialization (~15 seconds), then:
# mode guided
# arm throttle force
# takeoff 5source /opt/ros/humble/setup.bash
ros2 launch uav_ugv_simulation full_simulation.launch.py| Algorithm | Description |
|---|---|
spiral |
Expanding square spiral from current position |
lawnmower |
Systematic back-and-forth lane coverage |
levy |
Random walk with Lévy-distributed step lengths |
All search algorithms continuously scan for ArUco markers using the downward camera during flight. Detected markers are logged with their ID, position, and distance.
Navigation uses only relative positioning:
- Visual odometry from cameras
- Optical flow sensors
- IMU integration
- Local coordinate frames (NED)
GPS is ONLY used for geofencing (safety boundaries), NOT for navigation or position control.
Speed and acceleration are capped to prevent aggressive tilting in simulation. Defaults are applied automatically via configure_speed_limits() in setup_ardupilot().
| Parameter | Default | Unit |
|---|---|---|
WPNAV_SPEED |
150 | cm/s |
WPNAV_ACCEL |
100 | cm/s² |
WPNAV_SPEED_UP |
100 | cm/s |
WPNAV_SPEED_DN |
75 | cm/s |
WPNAV_ACCEL_Z |
75 | cm/s² |
LOIT_SPEED |
150 | cm/s |
Override in code:
ctrl.configure_speed_limits(wpnav_speed=200, wpnav_accel=150)| Command | Description |
|---|---|
bash scripts/run_autonomous.sh |
Run autonomous search |
bash scripts/run_simulation.sh |
Run manual simulation |
bash scripts/kill_simulation.sh |
Kill all processes |
bash scripts/uninstall.sh |
Uninstall ArduPilot |