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.

git clone https://github.com/eProsima/foonathan_memory_vendor.git
cd foonathan_memory_vendor
mkdir build && cd build
cmake ..
cmake --build . --target install

Installation from Sources

Fast DDS

Clone the project from Github:

$ git clone --recursive https://github.com/eProsima/Fast-DDS.git -b v2.0.2 ~/FastDDS-2.0.2
$ cd ~/FastDDS-2.0.2
$ mkdir build && cd build

If you are on Linux, execute:

$ cmake -DTHIRDPARTY=ON -DSECURITY=ON ..
$ make -j$(nproc --all)
$ sudo make install

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):

git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git -b v1.0.4 ~/Fast-RTPS-Gen \
    && cd ~/Fast-RTPS-Gen \
    && gradle assemble \
    && sudo env "PATH=$PATH" gradle install

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 the gradle install step, it must set this variable to that same directory as well. Otherwise, the code generation step, and consequently, the build of the rtps targets in PX4 will fail.

Further Information

Last updated