ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

DDS to ROS2 messages

asked 2022-09-16 14:45:19 -0500

thejeeb gravatar image

updated 2022-09-16 14:46:09 -0500

What's the latest recommended approach for interfacing between native DDS and ROS2 messages assuming they are wire compatible? I'm on the latest rolling distro.

I have a system that has applications that publish on native DDS and I need to interface these to my ROS2 nodes. I understand there are specific prefixes in the topics names for ROS2 in DDS. In the past, I have also seen methods of interfacing native DDS to a specific rmw e.g. FastDDS, Cyclone or Connext. Is there a middleware-agnostic approach to interface to native DDS in ROS2?

edit retag flag offensive close merge delete

Comments

There seems to be a way but it's not transparent. Here a user already told about some of his findings. Also I'm trying right now to communicate between ROS2 and CycloneDDS and have an issue running in the CycloneDDS Github.

ManuMTS gravatar image ManuMTS  ( 2022-09-21 01:43:44 -0500 )edit

Thanks. I think I am on a similar path.

I have custom ROS 2 message types I need to use with a native DDS application. So I needed to convert the custom messages to IDL that could be used in the native DDS application. I first started with the utility provided by ros2 that I found from comments here. I was able to run this utility and generate an IDL. However, after trying this IDL out, I found my native DDS application would not see the message. After some more research, I discovered what others have discovered i.e. the additional nesting in the IDL as well as the name mangling. So the ros2 tool doesn't generate the correct IDL. I still haven't found a tool that generates the correct IDL with the name mangling. I manually updated the IDL and will try it on the native DDS application again.

thejeeb gravatar image thejeeb  ( 2022-09-22 09:35:08 -0500 )edit
1

So what i found out so far:

  1. A topic in ROS2 changes it's name. It goes from "topicname" to "rt/topicname".
  2. idl-files with ROS2 messages are provided in this Github. For me it worked to just use one of them with CycloneDDS to send messages to ROS2.
  3. ROS2 is not happy with the QoS-Settings of Cyclone. It will see the Cyclone Publisher/Subscriber but print out an error that it will not send/recieve from it.
  4. Cyclone offers a tool in it's Python Github that will display all the QoS-Settings (See in the Readme.md).
  5. You can set the QoS-Settings in the HelloworldExamples using the function dds_qset_... but i couldn't find the right way to do it for data representation yet.
ManuMTS gravatar image ManuMTS  ( 2022-09-23 01:00:35 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2022-09-26 01:03:08 -0500

ManuMTS gravatar image

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

So just like i commented the topic names change like this from ROS2 to Cyclone: "topic" -> "rt/topic". 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
0

answered 2022-10-19 16:45:20 -0500

thejeeb gravatar image

So I was also able to get it to work with a custom type. This was for talking to a native Connext application. Here's what I had to fix: - Generated a idl file using 'ros2 run rosidl_adapter msg2idl.py <msg_file>' - Mnaually modified the generated idl file to add module dds_ as shown above - Set topic name in the native DDS application to rt/<ros_topic_name> - Modified the native DDS application topic qos to (1) empty partition list since ros2 uses empty partition list and the other endpoints should also have empty partition list otherwise they won't communicate (2) destination order QoS set to "by reception timestamp"

This setup worked for me. The QoS changes required for other native DDS vendor applications e.g. Cyclone or FastDDS, may vary from what I listed above.

edit flag offensive delete link more

Question Tools

4 followers

Stats

Asked: 2022-09-16 14:45:19 -0500

Seen: 327 times

Last updated: Oct 19 '22