Maximum Limit of String

2 posts / 0 new
Last post
Last seen: 1 year 5 months ago
Joined: 07/23/2018
Posts: 20
Maximum Limit of String

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

In ROS2, the strings are unbounded and dynamically allocated.

But in RTI, if I give the type as default, then it limits it to 255 bytes.

For that I used the variable. stringMaxLength="2147483647"

Last seen: 5 hours 2 min ago
Joined: 11/14/2017
Posts: 7

Yes -- that is correct for setting up 'unbounded' support.

The value 2147483647 (0x7FFFFFFF) is interpreted to mean "allocate memory to the size of the sample, and free the memory when finished" -- rather than a one-time allocation of a fixed-size buffer.

See the CoreLibrariesUserManual section under "Unbounded Built-In Types" for more details.