ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

ROS2 interoperability with native DDS

asked 2022-08-12 10:37:15 -0600

stan-g gravatar image

updated 2022-08-13 00:07:49 -0600

gvdhoorn gravatar image

I'm using cyclonedds and ROS2 Galactic, but I am open to anyone sharing their experiences with this problem using any DDS vendor.

Has anyone successfully been able to subscribe to a DDS topic from ROS2? Here's what I've found when trying to pass all the hurdles:

  1. At first you discover that to get DDS topics to appear in ROS you need to prepend rt/ to the name.
  2. Then you discover that ROS does not recognize the message type (The message type 'sensor_msgs::msg::Imu' is invalid) if you use the idl files from here: /opt/ros/DISTRO/share/... and you have to use the mangled messages from f.e. here
  3. Next, I got invalid QOS error, that got fixed when I used similar QOS settings from this part in rmw_cyclonedds
  4. My final stage where I am stuck: ros2 topic echo /imu runs without error but no messages are printed. ros2 topic info --verbose gives:

    Type: sensor_msgs/msg/Imu
    Publisher count: 1
    Node name: _CREATED_BY_BARE_DDS_APP_
    Node namespace: _CREATED_BY_BARE_DDS_APP_
    Topic type: sensor_msgs/msg/Imu
    Endpoint type: PUBLISHER
    QoS profile:
     Reliability: BEST_EFFORT
     Durability: VOLATILE
     Lifespan: 9223372036854775807 nanoseconds
     Deadline: 9223372036854775807 nanoseconds
     Liveliness: AUTOMATIC
     Liveliness lease duration: 9223372036854775807 nanoseconds
    Subscription count: 0

There's a lot of scattered info about this across the web, like as if many people tried to do this, but there is no concrete working sample. It also feels like the ROS2 is not intended to be used like this aka no guarantees. Users of some RTI software tool seem to be able to do what i am doing. So I still wonder if this is possible to do using a self written CycloneDDS publisher?

edit retag flag offensive close merge delete


I'm also trying to archieve Communication between ROS2 (Humble) and CycloneDDS. I used the Hello World Example of Cyclone and gave it the String.ide from here. I opened an issue in the Cyclone Github here. The dev is also willing to help out. You could hop onto the issue. Right now I'm still at the point of getting the QoS-Settings to fit.

ros2 run cpp_pubsub talker 
[WARN] [1663674839.145515110] [minimal_publisher]: New subscription discovered on topic '/topic', requesting incompatible QoS. No messages will be sent to it. Last incompatible policy: INVALID_QOS_POLICY
ManuMTS gravatar image ManuMTS  ( 2022-09-20 07:22:32 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-09-26 00:59:27 -0600

ManuMTS gravatar image

I got it working. A hint from eboasson a dev of CycloneDDS got me back on track: Here.

The "topic" -> "rt/topic" is right. For example if you want to send a String message this is the idl-File you want to use:

module std_msgs { module msg { module dds_ {
    @final struct String_ {
      string data;
    }; }; };

The @appendable tag from neil_rti is not supported by the CycloneDDS Middleware because it doesn't want to run XCDR2-Data-Representation @final worked for me. So just match the QoS-Settings of the Cyclone-DDS to the ROS2 and you're good to go. I had an example how i did it in the Github issue.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2022-08-12 10:37:15 -0600

Seen: 279 times

Last updated: Sep 26