ROS2 .msg equivalent for nested modules in .idl

asked 2021-09-21 00:20:05 -0500

goksankobe gravatar image

updated 2021-09-21 00:22:03 -0500


I'm trying to interface some of our native DDS applications with ROS2 subscribers. As redefining the DDS IDL interfaces are not an option currently, I'm exploring a solution from the ROS2 side.

We have the following structure in the .idl files:

module top_level {
  module middle_level {
     module  lower_level {
           module lowest_level {
                  struct myType {
                        int64 field_1;
                        int64 field_2;
                        int64 field_3;

My first approach was to replicate the module hierarchy above in the folder structure for the ROS2 package. However, when I look at the generated .idl files by ROS, I see 2 issues:

1) No matter how many nested folders I create ROS2 only generates 2 modules: 1 top level module for the package name, and an inner module called "msg"

2) I do not have "msg" field in the IDL files, but the inner module from ROS always seems to be "msg".

I believe there will be other issues like ROS2 not allowing camel case message as field names, but that is a separate issue I believe.

Creating a "ROS2 .msg clone" for the native .idl files is just the first solution that came to my mind. If there is a better option to interface native DDS applications with ROS2 applications, I'm open to suggestions.



edit retag flag offensive close merge delete