How dmdobrea/ros2_offboard_control works
This is a small ROS 2 application for manually controlling a PX4 UAV. The user moves an Xbox controller; its node publishes velocity and action topics, and the offboard-control node consumes them to manage flight and issue setpoints or vehicle commands. The README also documents position-control code and simulation with Gazebo or JMAVSim. The controller and topic connections are documented; excerpts show velocity processing and setpoint publishing, but omit some subscription and PX4 publisher setup, so those links rely on the README rather than sampled call sites.
Main entry points: uav_ctrl.py Offboard control · xbox.py Xbox input node
Components 11
Controller input
- Xbox input node
offboard_control/offboard_control/xbox.py - Velocity topic
- Action topic
Flight control
- Offboard control
offboard_control/offboard_control/uav_ctrl.py - Flight state logic
offboard_control/offboard_control/uav_ctrl.py
PX4 integration
- Trajectory setpoints
offboard_control/offboard_control/uav_ctrl.py
Other components
- Xbox operator
- Micro XRCE-DDS bridge
- PX4 autopilot
- Gazebo / JMAVSim
- QGroundControl
Connections 13
- Xbox operator → Xbox input node: operates
README.md - Xbox input node → Velocity topic: publishes velocity
offboard_control/offboard_control/xbox.py - Xbox input node → Action topic: publishes actions
offboard_control/offboard_control/xbox.py - Velocity topic → Offboard control: delivers commands
README.md - Action topic → Offboard control: delivers actions
README.md - Offboard control → Flight state logic: runs mission control
offboard_control/offboard_control/uav_ctrl.py - Offboard control → Trajectory setpoints: publishes setpoints
offboard_control/offboard_control/uav_ctrl.py - Offboard control → Micro XRCE-DDS bridge: sends commands
README.md - Micro XRCE-DDS bridge → PX4 autopilot: bridges commands
README.md - PX4 autopilot → Micro XRCE-DDS bridge: returns telemetry
- Micro XRCE-DDS bridge → Offboard control: delivers telemetry
- Gazebo / JMAVSim → PX4 autopilot: simulates vehicle
README.md - QGroundControl → PX4 autopilot: supervises vehicle
README.md