67 lines
1.1 KiB
Markdown
67 lines
1.1 KiB
Markdown
# Gazebo Simulation Guide
|
|
|
|
## Quick Start (2 Terminals)
|
|
|
|
**Terminal 1:**
|
|
```bash
|
|
ros2 launch gazebo/launch/drone_landing.launch.py
|
|
```
|
|
|
|
**Terminal 2:**
|
|
```bash
|
|
source activate.sh
|
|
python run_gazebo.py --pattern circular
|
|
```
|
|
|
|
## Camera Feed
|
|
|
|
```bash
|
|
python camera_viewer.py --topic /drone/camera
|
|
```
|
|
|
|
## Options
|
|
|
|
```bash
|
|
--pattern stationary, linear, circular, square, random
|
|
--speed Rover speed in m/s (default: 0.5)
|
|
--no-rover Disable rover movement
|
|
```
|
|
|
|
## Sensors
|
|
|
|
| Sensor | Source |
|
|
|--------|--------|
|
|
| IMU | Gazebo odometry |
|
|
| Altimeter | Z position |
|
|
| Camera | Camera sensor |
|
|
| Landing Pad | Relative position |
|
|
|
|
## ROS 2 Topics
|
|
|
|
| Topic | Direction |
|
|
|-------|-----------|
|
|
| `/cmd_vel` | Your commands → Drone |
|
|
| `/drone/telemetry` | Sensors → You |
|
|
| `/drone/camera` | Camera images |
|
|
|
|
## Headless Mode (WSL2)
|
|
|
|
```bash
|
|
ign gazebo -s gazebo/worlds/drone_landing.sdf
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
**Drone falls:**
|
|
Check `run_gazebo.py` is running
|
|
|
|
**No camera:**
|
|
```bash
|
|
python camera_viewer.py --list # Find topics
|
|
```
|
|
|
|
**Model not found:**
|
|
```bash
|
|
export GZ_SIM_RESOURCE_PATH=$PWD/gazebo/models:$GZ_SIM_RESOURCE_PATH
|
|
```
|