# Fast DDS Installation

logo eProsima Fast DDS (opens new window) is a C++ implementation of the Object Management Group's (OMG) Data Distribution Service (DDS) specification and the Real Time Publish Subscribe (RTPS) protocol.

Fast DDS enables an RTPS/DDS interface that allows PX4 uORB topics to be shared with offboard components, including robotics and simulator tools, that participate in same DDS domain. 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 for use with PX4.

提示

Fast DDS is not an essential component of the PX4 Autopilot and should only be installed if you plan to use the PX4 Autopilot with another Fast RTPS/DDS system such as ROS 2.

注解

Fast DDS was previously named FastRTPS (the name was changed in version 2.0.0 as it now includes a full DDS implementation, rather than just the RTPS wire protocol).

# Prerequisites

eProsima Fast DDS requires the following packages to work.

注解

At time of writing you will need to install from source for:

  • Ubuntu 18.04: Fast RTPS 1.8.2 (or later) and Fast-RTPS-Gen 1.0.4 (not later!).
  • Ubuntu 20.04: Fast DDS 2.0.0 (or later) and Fast-RTPS-Gen 1.0.4 (not later!).

# Java

Java is required to use our built-in code generation tool - fastrtpsgen. Java JDK 8 (opens new window) is recommended.

# Gradle

You also need to install Gradle (opens new window) to build the source generators (Fast-RTPS-Gen), we recommend you install Gradle via sdkman (opens new window).

# 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

注解

If the last step fails, try running the command with the proper user privileges (sudo)

# Windows 7 32-bit and 64-bit

# Visual C++ 2013 or 2015 Redistributable Package

eProsima Fast DDS requires the Visual C++ Redistributable packages for the Visual Studio version you chose during the installation or compilation. The installer gives you the option of downloading and installing them.

# Installation from Sources

# Fast-RTPS (DDS)

Clone the project from Github:

$ git clone --recursive https://github.com/eProsima/Fast-DDS.git -b v2.0.0 ~/FastDDS-2.0.0
$ cd ~/FastDDS-2.0.0
$ 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>.

If you are on Windows, choose your version of Visual Studio:

> cmake -G "Visual Studio 14 2015 Win64" -DTHIRDPARTY=ON -DSECURITY=ON ..
> cmake --build . --target install

# 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 \
    && ./gradlew assemble \
    && sudo ./gradlew install

# Installation from Binaries

注解

Although the binaries are available, we recommend to build and install the code from source, given that the binaries may not come with required components and dependencies in place.

The latest binary release of eProsima Fast DDS can be downloaded from the company website (opens new window).

Documentation on how to do this can be found here: Installation from Binaries on Linux (opens new window) and Installation from Binaries on Windows (opens new window) (eProsima Fast DDS official documentation)

# Windows 7 32-bit and 64-bit

Execute the installer and follow the instructions, choosing your preferred Visual Studio version and architecture when prompted.

# Environmental Variables

eProsima Fast DDS requires the following environmental variable setup in order to function properly

  • FASTRTPSHOME: Root folder where eProsima Fast DDS is installed.
  • FASTRTPSGEN_DIR: Root folder where eProsima Fast-RTPS-Gen is installed.
  • Additions to the PATH: the /bin folder and the subfolder for your Visual Studio version of choice should be appended to the PATH.

These variables are set automatically by checking the corresponding box during the installation process.

# Linux

Extract the contents of the package. It will contain both eProsima Fast DDS and its required package eProsima Fast CDR. You will have follow the same procedure for both packages, starting with Fast CDR.

Configure the compilation:

$ ./configure --libdir=/usr/lib

If you want to compile with debug symbols (which also enables verbose mode):

$ ./configure CXXFLAGS="-g -D__DEBUG"  --libdir=/usr/lib

After configuring the project compile and install the library:

$ sudo make install

# 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 it here as well.

# Further Information