Switching Between ROS Middleware Implementations
ROS 2 is based on the Data Distribution Service (DDS™) standard, an end-to-end middleware protocol that provides features such as discovery, serialization, and transportation. ROS 2 supports multiple ROS middleware (RMW) implementations so that you can choose one that is best suited to your requirements. Use these factors to inform your choice of middleware implementation: platform availability, performance characteristics, computation footprint, dependencies, and license.
You can switch between RMW implementations for using DDS while working with ROS 2 in MATLAB® and Simulink®. ROS Toolbox contains these RMW implementations.
rmw_fastrtps_cpp— eProsima Fast DDS (Version 2.5.0). This is the default RMW implementation.
rmw_fastrtps_dynamic_cpp— eProsima Fast DDS.
rmw_cyclonedds_cpp— Eclipse Cyclone DDS (Version 0.7.0).
You can also configure and switch to these custom RMW Implementations.
rmw_connextdds— RTI Connext DDS (version 6.0.1). This implementation is supported on Windows®, Linux®, and macOS® operating systems.
rmw_iceoryx_cpp— Eclipse iceoryx DDS (version 1.0.1). This implementation is supported on Linux® and macOS® operating systems.
Change RMW Implementation Using ROS Toolbox Preferences
To configure an RMW implementation, follow these steps.
1. On the Home tab in the Environment section of the MATLAB toolstrip, click Preferences and select ROS Toolbox.
2. Click Open ROS Toolbox Preferences, specify the path to the Python executable, and click Recreate Python Environment. If you have configured Python already, proceed with the next step.
3. Open the dropdown list under ROS Middleware (RMW) Implementation to switch between RMW implementations.
Select an implementation from the list and click OK. The software creates a ROS 2 node with the selected implementation.
4. Select Configure and Switch to other RMW Implementation to launch the ROS Middleware Configuration dialog box. This enables you to switch to a custom implementation from the RMW Implementation dropdown menu.
5. Set up the selected custom implementation and verify its installation. For more information, see the links under Validate DDS Installation.
6. Click Browse and navigate to the parent directory of the DDS package. Build the RMW implementation package and then click Next if the build is successful.
7. Click Test RMW to validate the ROS 2 node with the selected custom RMW implementation.
8. Select the implementation from the ROS Middleware (RMW) Implementation dropdown menu and click OK.