Fast DDS 安装
Fast DDS enables an RTPS/DDS interface that allows PX4 uORB topics to be shared with offboard components that participate in same DDS domain, including robotics and simulator tools. In particular, Fast DDS is the default middleware implementation for Robot Operating System 2 (ROS 2), and is essential for integrating PX4 with ROS2.
This topic explains how to install Fast DDS and Fast-RTPS-Gen to use in the PX4 build system and with the microRTPS bridge.
Fast DDS is not an essential component of the PX4 Autopilot and should only be installed if you plan to interface the PX4 Autopilot with Fast RTPS/DDS participants. ROS 2 nodes are an example of these, though Fast DDS middleware and C++ implementations are installed by default on ROS 2 Foxy and below, as mentioned above.
Prerequisites
eProsima Fast DDS requires the following packages to work.
Remember (again) you only need to install Fast DDS if you are not using ROS 2 and just want to leverage non-ROS2 DDS networks and applications. If you have ROS 2 installed (and rmw-fasrtps
as its default middleware), you can skip to Fast-RTPS-Gen build and install.
Java
Java is required to build and use eProsima's RTPS/DDS from IDL code generation tool - Fast-RTPS-Gen. Java JDK 11 is recommended, and it is installed through the setup scripts made available in Ubuntu Development Environment.
Gradle
You also need to install Gradle to build Fast-RTPS-Gen. We recommend you install Gradle via sdkman.
Do not install Gradle version 7 or higher. The recommended version is 6.3.
Foonathan memory
In order to build Fast DDS you need to install the Foonathan Memory dependency.
Installation from Sources
Fast DDS
Clone the project from Github:
If you are on Linux, execute:
This will install Fast DDS to /usr/local
, with secure communications support. If you need to install to a custom location you can use: -DCMAKE_INSTALL_PREFIX=<path>
.
Compile Options
The following additional arguments can be used when calling CMake:
-DCOMPILE_EXAMPLES=ON
: Compile the examples-DPERFORMANCE_TESTS=ON
: Compile the performance tests
Fast-RTPS-Gen
Fast-RTPS-Gen is the Fast RTPS (DDS) IDL code generator tool. It should be installed after Fast RTPS (DDS) and made sure the fastrtpsgen
application is in your PATH
. You can check with which fastrtpsgen
.
Then install Fast-RTPS-Gen 1.0.4 (Gradle is required for this):
Installation from Binaries
The latest binary release of eProsima Fast DDS can be downloaded from the company website.
Documentation on how to do this can be found here: Installation from Binaries on Linux and Installation from Binaries on Windows (eProsima Fast DDS official documentation)
Environmental Variables
FASTRTPSGEN_DIR
: Root folder where eProsima Fast-RTPS-Gen is installed, usually set to/usr/local
, which is the default installation directory. If the user sets a different install directory in thegradle install
step, it must set this variable to that same directory as well. Otherwise, the code generation step, and consequently, the build of thertps
targets in PX4 will fail.
Further Information
Additional installation information can be found in the official eProsima Fast DDS documentation (from which this topic is derived):
Last updated