ROS2 Drone Autonomous Flight in Practice: PX4 and Offboard Mode
The article explains how to use ROS2 nodes to communicate with a PX4 flight controller via MAVROS or px4_msgs, publishing desired positions in offboard mode to achieve autonomous flight. The core workflow is to first continuously publish setpoints at a stable rate, then switch to offboard and arm; stopping setpoint publication triggers a timeout exit. The article also covers debugging points such as Gazebo SITL simulation verification, waypoint arrival detection, ENU versus NED coordinate confusion, and arming failures.