Files
simulation/README.md
2026-02-09 05:51:51 +00:00

133 lines
3.6 KiB
Markdown

# UAV-UGV Simulation
**GPS-Denied Navigation with Vision-Based Localization**
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.
## Features
- **GPS-Denied Navigation**: Visual odometry, optical flow, and EKF sensor fusion
- **GPS-Based Geofencing**: Safety boundaries using GPS (navigation remains GPS-free)
- **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
## Requirements
- Ubuntu 22.04 or 24.04 (WSL2 supported)
- 16GB RAM recommended
- 50GB disk space
- NVIDIA GPU recommended (software rendering available)
## Installation
```bash
git clone <repository-url> ~/sim/uav_ugv_simulation
cd ~/sim/uav_ugv_simulation
bash setup.sh
```
Installation takes 20-40 minutes (builds ArduPilot from source).
## Quick Start
### Autonomous Mode (Recommended)
The UAV automatically arms, takes off, and executes a mission:
```bash
cd ~/sim/uav_ugv_simulation
source activate_venv.sh
# Hover mission
bash scripts/run_autonomous.sh --mission hover
# Square pattern
bash scripts/run_autonomous.sh --mission square
# Circle pattern
bash scripts/run_autonomous.sh --mission circle
# WSL/Software rendering
bash scripts/run_autonomous.sh --software-render --mission hover
```
### Manual Mode (MAVProxy)
```bash
bash scripts/run_simulation.sh
# Wait for EKF initialization (~15 seconds), then:
# mode guided
# arm throttle force
# takeoff 5
```
### ROS 2 Mode
```bash
source /opt/ros/humble/setup.bash
ros2 launch uav_ugv_simulation full_simulation.launch.py
```
## Mission Types
| Mission | Description |
|---------|-------------|
| `hover` | Take off, hover for 30 seconds, land |
| `square` | Fly a 5m square pattern |
| `circle` | Fly a circular pattern |
## GPS-Denied Navigation
**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.
## Project Structure
```
uav_ugv_simulation/
├── setup.sh # Installation script
├── scripts/
│ ├── run_autonomous.sh # Autonomous simulation
│ ├── run_simulation.sh # Manual simulation
│ └── kill_simulation.sh # Cleanup
├── src/
│ ├── control/ # UAV/UGV controllers
│ ├── vision/ # Visual odometry, optical flow
│ ├── localization/ # EKF sensor fusion
│ ├── navigation/ # Path planning
│ └── safety/ # Geofencing, failsafe
├── launch/ # ROS 2 launch files
├── config/ # Configuration files
├── models/ # Gazebo models
└── worlds/ # Gazebo worlds
```
## Commands
| Command | Description |
|---------|-------------|
| `bash scripts/run_autonomous.sh` | Run autonomous simulation |
| `bash scripts/run_simulation.sh` | Run manual simulation |
| `bash scripts/kill_simulation.sh` | Kill all processes |
| `bash scripts/uninstall.sh` | Uninstall ArduPilot |
## Documentation
- [Setup Guide](docs/setup_guide.md)
- [Usage Guide](docs/usage.md)
- [Architecture](docs/architecture.md)
- [GPS-Denied Navigation](docs/gps_denied_navigation.md)
- [WSL Setup](docs/wsl_setup_guide.md)
- [Troubleshooting](docs/troubleshooting.md)
## License
MIT License