3.2 KiB
3.2 KiB
Usage Guide
Running the Simulation
Option 1: Autonomous Search (Recommended)
The UAV automatically arms, takes off, and searches for ArUco markers:
source activate_venv.sh
bash scripts/run_autonomous.sh --search spiral
Search algorithms:
spiral- Expanding square spiral from current positionlawnmower- Systematic back-and-forth lane coveragelevy- Random walk with Lévy-distributed step lengths
Options:
# Software rendering (WSL/no GPU)
bash scripts/run_autonomous.sh --software-render --search spiral
# Custom altitude
bash scripts/run_autonomous.sh --search lawnmower --altitude 10
# Run directly
python3 src/main.py --search spiral --altitude 5
Option 2: Manual Mode (MAVProxy)
For interactive control via MAVProxy:
bash scripts/run_simulation.sh
Wait for EKF initialization messages (~15 seconds):
EKF3 IMU0 initialised
EKF3 IMU1 initialised
AHRS: EKF3 active
Then type commands:
mode guided
arm throttle force
takeoff 5
Option 3: ROS 2 Launch
For full ROS 2 integration with MAVROS:
source /opt/ros/humble/setup.bash
source activate_venv.sh
ros2 launch uav_ugv_simulation full_simulation.launch.py
MAVProxy Commands
| Command | Description |
|---|---|
mode guided |
Switch to GUIDED mode |
arm throttle force |
Force arm (bypasses checks) |
takeoff 5 |
Take off to 5 meters |
guided 10 5 -10 |
Go to position (N, E, Down) |
land |
Land at current position |
rtl |
Return to launch |
disarm |
Disarm motors |
ROS 2 Topics
UAV Topics
| Topic | Type | Description |
|---|---|---|
/uav/mavros/state |
mavros_msgs/State |
Armed/mode status |
/uav/mavros/local_position/pose |
PoseStamped |
Current position |
/uav/visual_odometry/pose |
PoseStamped |
VO position estimate |
/uav/setpoint_position |
PoseStamped |
Target position |
/uav/controller/command |
String |
Control commands |
UGV Topics
| Topic | Type | Description |
|---|---|---|
/ugv/odom |
Odometry |
Current odometry |
/ugv/goal_pose |
PoseStamped |
Target position |
/ugv/cmd_vel |
Twist |
Velocity command |
Control via ROS 2
# Send command to UAV
ros2 topic pub /uav/controller/command std_msgs/String "data: 'takeoff'"
# Send waypoint
ros2 topic pub /uav/setpoint_position geometry_msgs/PoseStamped \
"{header: {frame_id: 'odom'}, pose: {position: {x: 10, y: 5, z: 5}}}"
# Send UGV goal
ros2 topic pub /ugv/goal_pose geometry_msgs/PoseStamped \
"{header: {frame_id: 'odom'}, pose: {position: {x: 5, y: 5, z: 0}}}"
Stopping the Simulation
# Kill all processes
bash scripts/kill_simulation.sh
# Or press Ctrl+C in the terminal running the simulation
Configuration Files
| File | Description |
|---|---|
config/search.yaml |
Search algorithm parameters |
config/uav.yaml |
UAV navigation/vision parameters |
config/ugv.yaml |
UGV motion parameters |
config/ardupilot_gps_denied.parm |
ArduPilot EKF configuration |