Docs Update

This commit is contained in:
2026-01-04 01:42:01 +00:00
parent 40286fa90c
commit edfed30fb1
9 changed files with 591 additions and 305 deletions

View File

@@ -1,17 +1,22 @@
# ArduPilot SITL Integration
# ArduPilot GPS-Denied Simulation
Run the simulation with a realistic ArduPilot flight controller.
Realistic flight controller simulation without GPS.
## Quick Start (2 Terminals)
**Terminal 1 - Gazebo:**
**Terminal 1:**
```bash
gz sim -v4 -r ~/ardupilot_gazebo/worlds/iris_runway.sdf
./scripts/run_ardupilot_sim.sh camera
```
**Terminal 2 - SITL + MAVProxy:**
**Terminal 2:**
```bash
sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console
# GPS-denied mode:
param set ARMING_CHECK 0
mode stabilize
arm throttle force
```
## Installation
@@ -21,82 +26,74 @@ sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --console
source ~/.bashrc
```
This installs:
- ArduPilot SITL
- Gazebo Harmonic
- ardupilot_gazebo plugin
- MAVProxy
Installs: ArduPilot SITL, Gazebo, ardupilot_gazebo plugin, MAVProxy
## GPS-Denied Configuration
In MAVProxy console:
```bash
# Disable all pre-arm checks
param set ARMING_CHECK 0
# GPS-free flight modes
mode stabilize # Manual with stabilization
mode alt_hold # Altitude hold
mode guided_nogps # Guided without GPS
```
## GPU Support
The launcher auto-detects your GPU:
| GPU | Status |
|-----|--------|
| NVIDIA | Best performance |
| Intel integrated | Good for laptops |
| AMD | Good performance |
| Software | Works but slow |
## Camera Feed
### In Gazebo GUI
Click camera icon → Select drone camera
### Using camera_viewer
```bash
ros2 run ros_gz_bridge parameter_bridge /drone/camera@sensor_msgs/msg/Image[gz.msgs.Image
python camera_viewer.py --topic /drone/camera
```
## World Options
```bash
./scripts/run_ardupilot_sim.sh runway # Default
./scripts/run_ardupilot_sim.sh camera # With camera
```
## MAVProxy Commands
Once `sim_vehicle.py` is running:
```bash
# Set GUIDED mode
mode guided
# Arm
arm throttle
# Takeoff to 5m
takeoff 5
# Land
mode land
# Disarm
disarm
mode stabilize # Manual mode
mode guided_nogps # Autonomous (no GPS)
arm throttle force # Arm motors
takeoff 5 # Takeoff 5m
mode land # Land
```
## Available Worlds
```bash
# Iris on runway
gz sim -v4 -r ~/ardupilot_gazebo/worlds/iris_runway.sdf
# Zephyr plane
gz sim -v4 -r ~/ardupilot_gazebo/worlds/zephyr_runway.sdf
```
## Standalone SITL (No Gazebo)
```bash
sim_vehicle.py -v ArduCopter --console --map
```
This opens a 2D map view for testing without Gazebo.
## How It Works
```
Gazebo ArduPilot SITL
┌─────────────────┐ ┌─────────────────┐
│ iris_runway.sdf │◄────►│ sim_vehicle.py │
│ + ArduPilot │ JSON │ + MAVProxy │
│ Plugin │ UDP │ │
└─────────────────┘ └─────────────────┘
▼ MAVLink
Your Controller
```
The ArduPilot Gazebo plugin communicates with SITL via JSON over UDP.
## Troubleshooting
**sim_vehicle.py not found:**
### Simulation laggy
```bash
export PATH=$PATH:~/ardupilot/Tools/autotest
glxinfo | grep "OpenGL renderer"
# Should show GPU, not "llvmpipe"
```
**Plugin not loading:**
### Can't arm
```bash
export GZ_SIM_SYSTEM_PLUGIN_PATH=~/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH
export GZ_SIM_RESOURCE_PATH=~/ardupilot_gazebo/models:~/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH
```
**Can't arm:**
```bash
# In MAVProxy, disable pre-arm checks
param set ARMING_CHECK 0
arm throttle force
```
### No camera
Use `./scripts/run_ardupilot_sim.sh camera` for camera world.