description: Interact with uORB messages in APX4 using ROS 2
PX4 Messages in ROS 2
{% hint style="warning" %} This is a preview feature which might change with AuterionOS 3.0 {% endhint %}
uORB messages published by the FMU can be made available to AuterionOS apps by enabling the Micro XRCE-DDS (uXRCE-DDS) bridge for use in ROS 2 applications. The bridge supports communication in both directions, meaning ROS 2 applications can receive certain uORB topics from APX4, as well as send messages to the flight controller.
{% hint style="info" %} Micro XRCE-DDS is supported in APX4 3.0 and later. {% endhint %}
Configuration
Drone Manufacturers need to follow the instructions linked below to enable Micro XRCE-DDS in AuterionOS:
{% content-ref url="../../hardware-integration/flight-controller-customization/micro-xrce-dds.md" %} micro-xrce-dds.md {% endcontent-ref %}
{% hint style="success" %} Please contact the vehicle manufacturer or success@auterion.com if you are developing an application for an Auterion-powered vehicle and require help with the setup of Micro XRCE-DDS. {% endhint %}
ROS 2 topic naming
When Micro XRCE-DDS is enabled, a pre-determined set of uORB topics coming from APX4 will be published in ROS 2. The ROS 2 topics are prefixed with /fmu/out/
. For example, a ROS 2 node can receive vehicle_odometry
uORB messages by subscribing to /fmu/out/vehicle_odometry
.
Similarly, Micro XRCE-DDS subscribes to a set of ROS 2 topics to be published as uORB topics in the FMU. These ROS 2 topics are prefixed with /fmu/in
. For example, a ROS 2 node can publish to the vehicle_visual_odometry
uORB topic by publishing to /fmu/in/vehicle_visual_odometry
.
ROS 2 message definitions
The ROS 2 message definitions are the same as the uORB message definitions and are included in the px4_msgs ROS 2 package: https://github.com/PX4/px4_msgs.
To ensure compatibility, the ./msg
directory of px4_msgs that is being used to compile the AuterionOS application should have the same contents as the ./msg
directory of the APX4 firmware that is being used.
Comments
0 comments
Please sign in to leave a comment.