ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
To talk between a ROS2 application and a non-ROS tool (i.e. a tool that does not use any of the ROS APIs) using DDS, you have two options:
Use DDS directly from the ROS2 application (not via the ROS2 APIs). You will be using raw DDS so you need to learn how to do that from the documentation for the DDS implementation you are using. You will need to supply data types yourself, choose topics yourself, etc.
Make the non-ROS tool talk ROS2-style DDS. You will need to understand how ROS2 uses DDS in detail so you can mimic it in your tool. Look at the design documents for ROS2, especially the mapping between ROS2 topics and DDS topics and the mapping between ROS2 types and DDS types, but in general anything on that page that talks about how ROS uses DDS. There are people who have done this but I don't know of any open examples; hopefully someone will provide one in the comments.
The first approach is probably less fragile, but it will need to be implemented carefully to avoid increasing resource use. The second approach is fragile to changes in the ROS2 implementation - it is still beta, after all. The second approach is also, in my opinion, adding a murky dependency on ROS2. Using the ROS2 API directly from your tool, if that is possible, would be clearer and easier to maintain.