PX4 integrates with ROS 2 through the uXRCE-DDS middleware, which bridges PX4’s internal uORB message bus to the DDS global data space. This allows your ROS 2 nodes to publish and subscribe to PX4 topics directly, without any custom serialization layer. The result is a fast, bidirectional data channel between the flight controller and your companion computer.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/PX4/PX4-Autopilot/llms.txt
Use this file to discover all available pages before exploring further.
Architecture
The integration relies on two components that run concurrently: a client embedded in the PX4 firmware, and an agent running on your companion computer.- The uXRCE-DDS client (
uxrce_dds_client) is compiled into PX4 firmware at build time. It translates uORB messages to DDS and back, using the topic list defined indds_topics.yaml. - The Micro XRCE-DDS agent (
MicroXRCEAgent) runs on the companion computer and acts as a proxy, connecting the client to the broader DDS network where your ROS 2 nodes live.
PX4 v1.14 and later use uXRCE-DDS exclusively. If you are migrating from PX4 v1.13, which used Fast-RTPS, refer to the migration guidelines in the uXRCE-DDS documentation.
Supported platform
The recommended and officially supported environment for ROS 2 with PX4 is:| Component | Version |
|---|---|
| OS | Ubuntu 22.04 |
| ROS 2 | Humble (LTS) |
| PX4 | v1.14 or later |
The px4_msgs package
Your ROS 2 workspace must include the px4_msgs package, which contains the message definitions that match those compiled into the PX4 firmware you are running. Clone it into your workspace src/ directory and check out the branch that corresponds to your PX4 release:
px4_msgs for each release, so branch names align with PX4 version numbers.
Starting with PX4 v1.16, message versioning is supported. If you are on v1.16 or later, the ROS 2 Message Translation Node can handle mismatches between your local message definitions and those compiled into firmware automatically.
How uORB topics map to ROS 2 topics
The uXRCE-DDS client exposes a subset of uORB topics over DDS. The exact set is controlled bydds_topics.yaml in the PX4 source tree. Topics follow a consistent naming convention:
- PX4 → ROS 2 (outgoing telemetry):
/fmu/out/<MessageName> - ROS 2 → PX4 (incoming commands):
/fmu/in/<MessageName>
/fmu/out/VehicleOdometry, and offboard control mode commands are sent to /fmu/in/OffboardControlMode.
Use cases
uXRCE-DDS setup
Configure the client and agent, choose between UDP and serial transport, and verify the connection.
Offboard control
Send position and velocity setpoints to PX4 from a ROS 2 node using the offboard control pattern.
Custom flight modes
Use the PX4 ROS 2 Interface Library to define and register custom flight modes that appear natively in PX4.
Computer vision
Feed visual odometry or object detection results into PX4 using standard uORB topics over the DDS bridge.