Files
simulation/docs/usage.md
2026-02-09 03:39:49 +00:00

2.7 KiB

Usage Guide

Quick Start

# 1. Navigate to project
cd ~/ros2_ws/src/uav_ugv_simulation

# 2. Activate environment
source activate_venv.sh

# 3. Run simulation
bash scripts/run_simulation.sh

Launch Options

Full Simulation (UAV + UGV)

ros2 launch uav_ugv_simulation full_simulation.launch.py

UAV Only

ros2 launch uav_ugv_simulation uav_only.launch.py

UGV Only

ros2 launch uav_ugv_simulation ugv_only.launch.py

Different Worlds

# Indoor warehouse (GPS-denied)
bash scripts/run_simulation.sh worlds/indoor_warehouse.world

# Urban canyon (GPS-degraded)
bash scripts/run_simulation.sh worlds/urban_canyon.world

Interacting with Vehicles

UAV Commands

# Arm the vehicle
ros2 topic pub /uav/controller/command std_msgs/String "data: 'arm'"

# Takeoff
ros2 topic pub /uav/controller/command std_msgs/String "data: 'takeoff'"

# Go to waypoint (local coordinates)
ros2 topic pub /uav/setpoint_position geometry_msgs/PoseStamped \
  "{header: {frame_id: 'odom'}, pose: {position: {x: 10.0, y: 5.0, z: 5.0}}}"

# Land
ros2 topic pub /uav/controller/command std_msgs/String "data: 'land'"

UGV Commands

# Go to goal (local coordinates)
ros2 topic pub /ugv/goal_pose geometry_msgs/PoseStamped \
  "{header: {frame_id: 'odom'}, pose: {position: {x: 5.0, y: 3.0, z: 0.0}}}"

# Stop
ros2 topic pub /ugv/controller/command std_msgs/String "data: 'stop'"

Mission Planner

Load Demo Mission

ros2 topic pub /mission/command std_msgs/String "data: 'load'"

Start Mission

ros2 topic pub /mission/command std_msgs/String "data: 'start'"

Pause/Resume

ros2 topic pub /mission/command std_msgs/String "data: 'pause'"
ros2 topic pub /mission/command std_msgs/String "data: 'resume'"

Monitoring

View Topics

# List all topics
ros2 topic list

# UAV status
ros2 topic echo /uav/controller/status

# Visual odometry pose
ros2 topic echo /uav/visual_odometry/pose

# Geofence status
ros2 topic echo /geofence/status

View Camera Feeds

# Using rqt_image_view
ros2 run rqt_image_view rqt_image_view

# Select topics:
# /uav/camera/forward/image_raw
# /uav/camera/downward/image_raw

Visualization

# RViz
rviz2

# Add displays for:
# - TF
# - Camera
# - Path
# - Marker (geofence)

Configuration

Modify Parameters

Edit YAML files in config/ directory:

  • uav_params.yaml - UAV settings
  • geofence_params.yaml - Safety boundaries
  • mavros_params.yaml - MAVROS connection

Runtime Parameter Changes

ros2 param set /uav/visual_odom_node max_features 500

Stopping the Simulation

# Graceful shutdown
Ctrl+C

# Force kill all processes
bash scripts/kill_simulation.sh