You're reading the documentation for a version of ROS 2 that has reached its EOL (end-of-life), and is no longer officially supported. If you want up-to-date information, please have a look at Iron.
eProsima Fast DDS
eProsima Fast DDS is a complete open-source DDS implementation for real time embedded architectures and operating systems. See also: https://www.eprosima.com/index.php/products-all/eprosima-fast-dds
Have rosdep installed
The easiest way is to install from ROS 2 apt repository.
sudo apt install ros-foxy-rmw-fastrtps-cpp
Build from source code
Building from source code is also another way to install.
First, clone Fast DDS and rmw_fastrtps in the ROS 2 workspace source directory.
git clone https://github.com/ros2/rmw_fastrtps ros2/rmw_fastrtps -b foxy
git clone https://github.com/eProsima/Fast-DDS eProsima/fastrtps
Then, install necessary packages for Fast DDS.
rosdep install --from src -i
Finally, run colcon build.
colcon build --symlink-install
Switch to rmw_fastrtps
The eProsima Fast DDS RMW can be selected by specifying the environment variable:
Run the talker and listener
listener to test Fast DDS.
ros2 run demo_nodes_cpp talker
ros2 run demo_nodes_cpp listener