ArduPilot SITL Update

This commit is contained in:
2026-01-04 00:24:46 +00:00
parent 6c72bbf24c
commit 6804180e21
20 changed files with 2138 additions and 2970 deletions

View File

@@ -47,12 +47,19 @@ ROVER = {
# =============================================================================
CAMERA = {
# Camera sensor settings (for simulation)
"width": 320,
"height": 240,
"fov": 60.0, # Field of view in degrees
"near_clip": 0.1, # Near clipping plane
"far_clip": 100.0, # Far clipping plane
"jpeg_quality": 70, # JPEG compression quality (1-100)
# Camera viewer settings (for camera_viewer.py)
"viewer_fps": 30, # Display framerate
"viewer_topic": "/drone/camera", # ROS 2 topic for Gazebo
"viewer_topic_ardupilot": "/camera/image_raw", # Topic for ArduPilot
"show_info_overlay": True, # Show FPS and frame count
}
# =============================================================================
@@ -103,47 +110,57 @@ CONTROLLER = {
}
# =============================================================================
# ARDUPILOT / MAVLINK CONFIGURATION
# ARDUPILOT ROS 2 CONFIGURATION
# =============================================================================
ARDUPILOT = {
# Vehicle type
"vehicle": "ArduCopter", # ArduCopter, ArduPlane, APMrover2
"frame": "gazebo-iris", # Gazebo model frame
"frame": "iris", # Gazebo model (iris, wildthumper)
# SITL connection
"sitl_host": "127.0.0.1", # SITL host address
"sitl_port": 5760, # SITL TCP port
# ROS 2 workspace (set by install_ardupilot.sh)
"workspace": "~/ardu_ws",
# MAVProxy output (for MAVLink bridge)
"mavproxy_host": "127.0.0.1",
"mavproxy_port": 14550, # MAVProxy UDP output
# Simulation worlds
"default_world": "runway", # runway, maze, sitl
# Gazebo plugin connection (JSON interface)
"gazebo_fdm_port_in": 9002, # Port for motor commands
"gazebo_fdm_port_out": 9003, # Port for sensor data
# MAVProxy connection (for GCS features)
"mavproxy_port": 14550, # MAVProxy UDP port
# Arming requirements (for simulation, can be relaxed)
"require_gps": False, # GPS required for arming
"require_ekf": True, # EKF required for arming
# DDS configuration
"dds_enable": True, # Enable DDS for native ROS 2 topics
"dds_domain_id": 0, # Must match ROS_DOMAIN_ID
}
# ArduPilot ROS 2 Topics (read-only reference)
ARDUPILOT_TOPICS = {
# State topics (subscribe)
"pose": "/ap/pose/filtered", # PoseStamped
"geopose": "/ap/geopose/filtered", # GeoPoseStamped
"twist": "/ap/twist/filtered", # TwistStamped
"imu": "/ap/imu/filtered", # Imu
"battery": "/ap/battery", # BatteryState
"navsat": "/ap/navsat", # NavSatFix
# Command topics (publish) - via MAVLink
"cmd_vel": "/cmd_vel", # Twist (velocity commands)
}
# MAVLink configuration (for pymavlink/mavproxy)
MAVLINK = {
# MAVLink system IDs
"system_id": 1, # Our system ID
"component_id": 191, # MAV_COMP_ID_MISSIONPLANNER
# Target system (usually the autopilot)
# Target system (the autopilot)
"target_system": 1,
"target_component": 1,
# Connection timeout (seconds)
# Connection
"connection_string": "udpin:127.0.0.1:14550",
# Timeouts (seconds)
"heartbeat_timeout": 5.0,
"connection_timeout": 30.0,
# Data stream rates (Hz)
"stream_rate_position": 50,
"stream_rate_attitude": 50,
"stream_rate_raw_sensors": 50,
"stream_rate_extended_status": 5,
}