0

I am currently interfacing ROS2 with native RTI DDS Connext through RTI Connector for python.

In my ROS2 node, I have a custom message type which uses header messages from std_msgs pack. Now the header has a member string frame_id_. When the idl is generated for this msg, the size of the string is allocated as 2147483647 bytes. I can see this in the RTI Admin console. Now to match the Types in native DDS and ROS2, I need to give the same string size in RTI Connext through a QoS.xml file. But the problem is, this is too big a size for RTI to handle and the program crashes.

As a workaround, I modified the header_.idl in ROS2 lying in ROS2_base_ws/install/std_msgs/dds_connext/Header_.idl as string<255> frame_id_ i.e. I limited the max size of this string.

I recompiled it and ran the same node, but it always has the previous size i.e. 2147483647 bytes

Any other workaround ?

Vishal Rawat
  • 325
  • 1
  • 3
  • 19

1 Answers1

0

Try eliminating the size spec entirely from the IDL file, so it will look like:

module std_msgs {
    module msg {
        module dds_ {
            struct Header_ {
                builtin_interfaces::msg::dds_::Time_ stamp_;
                string frame_id_;
            };
            //@Extensibility EXTENSIBLE_EXTENSIBILITY
        }; // end of 'dds_' module
    }; // end of 'msg' module
}; // end of 'std_msgs' module

ROS2 uses unbounded strings and sequences; this shows up as a <2147483617>(0x7FFFFFFF) size in Admin Console. Be sure to enable 'Unbounded' support in the RTI code generator when generating the support code for your types that include strings or sequences.

BTW, which version of ROS2 are you targeting? There are a few other version-specific settings needed to interoperate ROS2 with DDS-only applications (such as partitions, topic name prefixes, etc.).

Are you seeing any other issues?

neil-rti
  • 46
  • 4
  • I already have the same IDL file. The problem is RTI interprets unbounded string as MAX_INT32 i.e. assigns ita max value of <2147483617>. To interface ROS2 with native RTI, the types need to be same. Thus in USER_QoS.xml, my member should look like, , but the python connector crashes as it fails to allocate the memory for such a big string. – Vishal Rawat Aug 02 '18 at 07:51