Skip to content

Software

px4_msgs

By PX4 Autopilot, from github.com/PX4/px4_msgs (opens in a new tab)

  • Drones and boats
  • Library
  • BSD-3-Clause

ROS 2 interface package holding message and service definitions mirrored from PX4 Autopilot's uORB topics, so ROS 2 nodes can exchange data with PX4 firmware.

Facts

GitHub stars
164read on 28 Nov 2026
Last update
28 Nov 2026Newest commit on main
Maintenance
Activea commit in the last 90 days
Difficulty
Intermediate
Hardware it needs, as the project states it
A computer running a supported ROS 2 distribution (Humble, Jazzy, Kilted, Rolling, Lyrical) on its Ubuntu release; Windows and macOS are covered by CI.

Checked on GitHub on 28 Nov 2026.

Licenses

Code
BSD-3-Clause (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (BSD-3-Clause) at commit ecee9b5 (opens in a new tab), on 28 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Contains only .msg and .srv definitions plus build rules that generate C++ and Python interfaces for ROS 2 applications.
  • Definitions are copied from PX4 uORB topics, keeping a ROS 2 workspace compatible with a given PX4 firmware version.
  • Data reaches ROS 2 through the uXRCE-DDS bridge, with MicroXRCEAgent running on the companion computer.
  • PX4 publishes with best-effort QoS, so subscribers must use a matching profile to receive data.
  • Each PX4 release line has its own branch, while main tracks PX4 main; the ROS 2 distribution is chosen separately.
  • Definitions are generated and should not be edited here; changes belong in PX4-Autopilot, with automatic sync to main.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
Used by ziFly Quadcopter Flight Controller.
Licence
BSD-3-Clause. Commercial use: Yes. Where it was read
Install
mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/srcEvery step
Maintenance
Active, last commit on 28 Nov 2026.

Works with

1 robot on Robotheca

The robots on Robotheca that use it or can run it, each with how the link was found.

Use it

Copied word for word from the creator's own documentation; each block links to the lines it comes from.

From source (recommended today)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git
cd ~/ros2_ws
source /opt/ros/jazzy/setup.bash      # or humble / kilted / rolling
colcon build --packages-select px4_msgs

From README.md at 83cd992, lines 31–35 (opens in a new tab)

From a binary (apt)

sudo apt install ros-${ROS_DISTRO}-px4-msgs

From README.md at 83cd992, line 45 (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit ecee9b5

Robotheca read the repository at three versions: the summary at 9c21876, the facts and the README at ecee9b5 (read on 28 Nov 2026) and the install commands at 83cd992 (read on 6 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by PX4 Autopilot, at commit ecee9b5, under BSD-3-Clause (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

px4_msgs

(opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab)

(opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab) (opens in a new tab)

ROS 2 message and service definitions for the PX4 Autopilot (opens in a new tab).

Overview

px4_msgs is a ROS 2 interface package: it contains only .msg and .srv definitions and the build rules that turn them into the C++/Python interfaces used by ROS 2 applications. The definitions mirror PX4's internal uORB (opens in a new tab) topics, so that a ROS 2 node can exchange them with the autopilot over the uXRCE-DDS bridge (opens in a new tab) (the uxrce_dds_client running on PX4 talks to the MicroXRCEAgent running on the companion side, which publishes/subscribes these topics on the ROS 2 graph).

Because the definitions come straight from PX4, this package is the single source of truth that keeps a ROS 2 workspace ABI-compatible with a given PX4 firmware version.

Installation
From source (recommended today)

Clone the branch that matches your PX4 version (see Supported versions) into a colcon workspace and build:

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/PX4/px4_msgs.git
cd ~/ros2_ws
source /opt/ros/jazzy/setup.bash      # or humble / rolling
colcon build --packages-select px4_msgs

See Using colcon to build packages (opens in a new tab) and the PX4 ROS 2 User Guide (opens in a new tab) for the full workflow.

From a binary (apt)

Once the package has completed its build-farm release it is installable as a Debian package:

sudo apt install ros-${ROS_DISTRO}-px4-msgs

You can also build a .deb locally — see Building Debian packages.

Usage

After sourcing the workspace, the generated interfaces are available like any other ROS 2 message package:

#include <px4_msgs/msg/vehicle_status.hpp>
// ...
sub_ = create_subscription<px4_msgs::msg::VehicleStatus>(
  "/fmu/out/vehicle_status", rclcpp::QoS(10).best_effort(),
  [](px4_msgs::msg::VehicleStatus::SharedPtr msg) { /* ... */ });
from px4_msgs.msg import VehicleStatus

Note: PX4 publishes with best-effort QoS; subscribers must use a compatible QoS profile (as above) or they will not receive any data. Topic names and directions (/fmu/out/..., /fmu/in/...) are documented in the PX4 uXRCE-DDS topic list (opens in a new tab).

Package layout
px4_msgs/
├── msg/            # message definitions (*.msg), generated from PX4 uORB
├── srv/            # service definitions (*.srv)
├── CMakeLists.txt  # globs msg/ and srv/ and calls rosidl_generate_interfaces
└── package.xml     # ament_cmake, format 3, member of rosidl_interface_packages
Supported versions and compatibility

px4_msgs is a pure interface package, so the definitions build on any maintained ROS 2 distribution. What ties a checkout to a firmware is the PX4 release line, not the ROS 2 distribution: each PX4 release has its own branch and main tracks PX4 main. Pick the branch that matches the PX4 version you fly, then build it on whichever ROS 2 distribution you run.

PX4 release → px4_msgs branch
ROS 2 distribution → Ubuntu

The ROS 2 distribution fixes the Ubuntu version (REP 2000 (opens in a new tab)). CI builds main against the LTS distributions and Rolling:

ROS 2 distributionUbuntuTypeBuilt in CI
Humble22.04 (Jammy)LTS, until 2027yes, native runner
Jazzy24.04 (Noble)LTS, until 2029yes, native runner
Rolling24.04 (Noble)developmentyes, native runner
Lyrical26.04 (Resolute)LTSyes, in the ros:lyrical container (no 26.04 runner yet)
Kilted24.04 (Noble)non-LTS, until 2026no
Foxy20.04 (Focal)EOL since 2023no

The definitions use only basic message features (built in types, fixed size arrays, nested messages), so any branch also builds on the older distributions if you still need them; the release/* branches were originally tested on Foxy, Humble and Rolling. Windows (Jazzy) and macOS (Jazzy, via RoboStack (opens in a new tab)) are covered by CI as well.

How the definitions are kept in sync (px4_msgs quirks)

This package is generated, not hand-written — keep these PX4-specific points in mind:

  • Do not edit msg/ or srv/ here. The definitions are copied from the uORB definitions (opens in a new tab) in PX4-Autopilot. Fix a message at the source (PX4-Autopilot) instead. See CONTRIBUTING.md (opens in a new tab).

  • Automatic sync. When the uORB definitions change on PX4-Autopilot main, a CI pipeline (opens in a new tab) pushes the updated definitions here, so main stays in lock-step with PX4-Autopilot main.

  • Flat layout requirement. The ROS 2 generation pipeline requires every definition to live directly under msg/ (no sub-directories) — PX4's msg/versioned/ files are flattened into msg/ during the sync.

  • Manual sync (only needed for a custom/detached PX4 version): check out the branch for the PX4 version you forked from, then refresh the definitions:

    rm -f msg/*.msg srv/*.srv
    cp ~/PX4-Autopilot/msg/*.msg msg/
    cp ~/PX4-Autopilot/msg/versioned/*.msg msg/
    cp ~/PX4-Autopilot/srv/*.srv srv/
    
Building Debian packages

Official binaries are produced by the ROS build farm (opens in a new tab) via bloom (opens in a new tab). To build a .deb locally (e.g. to self-host or test packaging), use the bundled builder container, which wraps bloom-generate rosdebian and writes the result to ./out:

./scripts/build_deb_host.sh                 # default: humble
ROS_DISTRO=jazzy ./scripts/build_deb_host.sh

The same packaging runs in CI for every supported distribution on amd64 and arm64 (Package (.deb) (opens in a new tab)). .deb packages are Debian/Ubuntu-specific; there is no equivalent on Windows or macOS.

Releasing

Releases are automated: a GitHub release (created from an upstream PX4 version bump) triggers the .deb packaging and a bloom pull request to ros/rosdistro (opens in a new tab), using the PX4/px4_msgs-release (opens in a new tab) release repository. See the release process (opens in a new tab) in CONTRIBUTING for the one-time setup.

Each ROS 2 distribution is released from the matching PX4 release line (see the table above), and bloom only accepts increasing versions per distribution. So a later patch on an older line (e.g. 1.16.3 after 1.17.0) is released to the distributions that track 1.16, and never overrides a newer release already published for another distribution.

Contributing

Contributions to the packaging, build, CI, and docs are welcome — read the contributing guide (opens in a new tab) and use the pull request template (opens in a new tab). Remember that message/service definitions are changed in PX4-Autopilot (opens in a new tab), not here. All participants are expected to follow our Code of Conduct (opens in a new tab).

Quality declaration

px4_msgs claims Quality Level 3 — see the Quality Declaration (opens in a new tab) (REP-2004 (opens in a new tab)).

Support
License

Released under the BSD 3-Clause License (opens in a new tab).

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.