Controller Update

This commit is contained in:
2026-02-09 05:51:51 +00:00
parent cd9ae9a4f6
commit 1a616472f0
16 changed files with 1545 additions and 669 deletions

143
README.md
View File

@@ -1,30 +1,30 @@
# UAV-UGV Simulation
GPS-Denied Navigation with Geofencing
**GPS-Denied Navigation with Vision-Based Localization**
A simulation environment for UAV and UGV development using GPS-denied navigation with vision-based localization, while maintaining GPS-based geofencing for safety.
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
## Features
**Navigation**: All vehicles navigate using relative positioning only:
- Visual odometry from cameras
- Optical flow sensors
- IMU integration
- Local coordinate frames
**GPS Usage**: GPS is ONLY used for geofencing (safety boundaries), NOT for navigation or position control.
- **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 https://git.sirblob.co/SirBlob/simulation.git
cd simulation
git clone <repository-url> ~/sim/uav_ugv_simulation
cd ~/sim/uav_ugv_simulation
bash setup.sh
```
@@ -32,72 +32,101 @@ 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 ~/simulation
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
```
For WSL with graphics issues:
```bash
bash scripts/run_simulation.sh --software-render
```
## Controlling the UAV
Once the simulation is running, use MAVProxy commands in the console:
```
mode guided # Switch to GUIDED mode
arm throttle # Arm the drone
takeoff 5 # Takeoff to 5 meters
guided 10 5 -10 # Fly to position (North, East, Down)
rtl # Return to launch
land # Land
```
Or via ROS 2:
### ROS 2 Mode
```bash
# Arm
ros2 service call /mavros/cmd/arming mavros_msgs/srv/CommandBool "{value: true}"
# Takeoff
ros2 service call /mavros/cmd/takeoff mavros_msgs/srv/CommandTOL "{altitude: 5}"
# Fly to position (local coordinates)
ros2 topic pub /mavros/setpoint_position/local geometry_msgs/PoseStamped \
"{header: {frame_id: 'map'}, pose: {position: {x: 10, y: 5, z: 5}}}"
source /opt/ros/humble/setup.bash
ros2 launch uav_ugv_simulation full_simulation.launch.py
```
## Simulation Options
## Mission Types
```bash
# Default
bash scripts/run_simulation.sh
| Mission | Description |
|---------|-------------|
| `hover` | Take off, hover for 30 seconds, land |
| `square` | Fly a 5m square pattern |
| `circle` | Fly a circular pattern |
# Custom world
bash scripts/run_simulation.sh --world iris_runway
## GPS-Denied Navigation
# Rover instead of copter
bash scripts/run_simulation.sh --vehicle Rover
**Navigation** uses only relative positioning:
- Visual odometry from cameras
- Optical flow sensors
- IMU integration
- Local coordinate frames (NED)
# Software rendering (WSL)
bash scripts/run_simulation.sh --software-render
**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
```
## Uninstall
## Commands
```bash
bash scripts/uninstall.sh # Remove ArduPilot and plugin
bash scripts/uninstall.sh --all # Remove everything
```
| 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)
- [WSL Setup Guide](docs/wsl_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