14. ROS 2 using Fast DDS middleware¶
ROS 2 is a state-of-the-art software for robot engineering which consists of a set of free software libraries and tools for building robot applications. This section presents some use cases and shows how to take full advantage of Fast DDS wide set of capabilities in a ROS 2 project.
The interface between the ROS 2 stack and Fast DDS is provided by a ROS 2 package
This package is available in all ROS 2 distributions, both from binaries and from sources.
rmw_fastrtps actually provides not one but two different ROS 2 middleware implementations, both of them using Fast
DDS as middleware layer:
The main difference between the two is that
rmw_fastrtps_dynamic_cpp uses introspection type support at run time to
decide on the serialization/deserialization mechanism, while
rmw_fastrtps_cpp uses its own type support, which
generates the mapping for each message type at build time.
The default ROS 2 RMW implementation is
However, it is still possible to select
rmw_fastrtps_dynamic_cpp by using the environment variable
When launching your ROS 2 application:
RMW_IMPLEMENTATION=rmw_fastrtps_dynamic_cpp ros2 run <package> <application>