DDS bridge

A typical scenario faced when bridging different DDS-based systems is that these systems use incompatible configurations. This happens for example in the communication between DDS and ROS2.

_images/DDS_NO_COMS.png

A user with knowledge of both systems may be aware that ROS2 uses DDS as a middleware but hides some of DDS’ configuration details, thus making a direct communication between the two difficult, if not impossible. By using eProsima Integration-Service, this communication can be eased and achieved with minimal effort from the user’s side.

This section is intended to illustrate the DDS-ROS2 communication as an example of this type of eProsima Integration-Service-mediated bridge, by putting into communication a ROS2 talker-listener example with a Fast-RTPS HelloWorld example.

_images/DDS_WITH_IS.png

Example: ROS2 communication

Requirements

To prepare the deployment and setup the environment, you need to have eProsima Integration-Service correctly installed in your system. To do so, please follow the steps delined in Getting Started and read carefully the Important remarks section.

To get this example working, the following requirements must be met:

  • Having ROS2 (Crystal or superior) installed, with the talker-listener example working.

  • Having the HelloWorldExample compiled. To do so, go to the ~/is-workspace/src/soss-dds/examples/common/HelloWorldExample folder and type:

    mkdir build
    cd build
    cmake ..
    make
    
  • Having the ros2_std_msgs compiled. To do so, go to the ~/is-workspace/src/soss-dds/examples/common/ros2_std_msgs folder and type:

    mkdir build
    cd build
    cmake ..
    make
    
  • Having the SOSS-ROS2 System-Handle installed. Unless configured otherwise, this package is built automatically when eProsima Integration-Service is installed.

ROS2 talker to DDS subscriber

To enable communication from ROS2 to DDS, open three terminals:

  • In the first terminal, execute a ROS2 talker

    source /opt/ros/$ROS2_DISTRO/setup.bash
    ros2 run demo_nodes_cpp talker
    
  • In the second terminal, execute the Fast-DDS HelloWorld subscriber

    cd ~/is-workspace
    source install/setup.bash
    ./src/soss-dds/examples/common/HelloWorldExample/build/HelloWorldExample subscriber
    

At this point, the two applications cannot communicate due to the incompatibility of their topic and type in their DDS configuration. This is where eProsima Integration-Service comes into play to make the communication possible.

  • In the third terminal, go to the is-workspace folder where you have eProsima Integration-Service installed, and execute it using the soss command followed by the dds_ros2_string.yaml configuration file located in the src/soss-dds/examples/udp/ folder:

    cd ~/is-workspace
    source /opt/ros/$ROS2_DISTRO/setup.bash
    source install/setup.bash
    soss src/soss-dds/examples/udp/ros2_dds_string.yaml
    

Once the last command is executed, the two DDS applications will start communicating.

DDS publisher to ROS2 listener

To test the same communication the other way around, launch the ROS2 listener, the HelloWorld publisher and execute eProsima Integration-Service using the soss command followed by the ros2_dds_string.yaml configuration file located in the src/soss-dds/examples/udp/ folder:

cd ~/is-workspace
source /opt/ros/$ROS2_DISTRO/setup.bash
source install/setup.bash
soss src/soss-dds/examples/udp/dds_ros2_string.yaml