0
$\begingroup$

Rosanswers logo

Hi, I am a newbie in the ROS2 paradigm. I have Ubuntu 20.04 and ROS2 Foxy installed on it. I am able to communicate among nodes via publishing/subscribing topics and services. I have read the documentation about default DDS in ROS2. I have also read about, how to create a fast DDS publisher and subscriber, as well as the topic name mapping between ROS2 and DDS.

But I am still unable to understand how can I communicate between two nodes over DDS? Do I need a discovery server?

What steps should I follow to communicate via a topic between two nodes?

Confusions:

  1. As DDS follows idl format for messages, how msg and srv files will be translated to dds?
  2. There is also an integer domain_value to set up the availability among publishers and subscribers. How can I set domain values?
  3. Will publishing and subscribing to DDS topics follow the same procedure as ROS2 topics?

Originally posted by sumit.paul on ROS Answers with karma: 36 on 2021-12-02

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

A newbee like me might find this answer helpful.

After some debugging I have figured out the way to communicate different nodes over dds.

RMW_IMPLEMENTATION=rmw_fastrtps_cpp ROS_DOMAIN_ID=<id> ros2 run <package> <application>

This will run the ROS2 node on the fastrtps DDS. To establish pub/sub communication between two nodes we have to use the same ROS_DOMAIN_ID. As fastrtps is the default dds middleware for ROS2 so we do not have to install it seperately. If anyone has to use other dds middleware he/she has to download the desired dds middleware and replace it in the RMW_IMPLEMENTATION=<desired_dds>

If the ROS2 nodes are in different DOMAIN, then Integration-service is there to save us. Please check this links. ROS2-FASTDDS, Integration-Service, ROS2-Different-Domain-Communication

The transformation of ROS2 topic and DDS idl are handled by the integration-service. This example can be a good starting point.

If anyone has to compile their own ROS2 msg/service/interfaces and generate mix files to use in the integration-service please check this, ROS2-System-handle.


Originally posted by sumit.paul with karma: 36 on 2021-12-29

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.