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

Revision history [back]

click to hide/show revision 1
initial version

Hi everyone,

I think your example should work with some ticking.

[XMLPARSER Error] Error adding the transport tcp_transport_1. There is other transport with the same id -> Function 
insertTransportById
[XMLPARSER Error] Error adding profile 'TCPParticipant' from file 'DEFAULT_FASTRTPS_PROFILES.xml' -> Function 
extractParticipantProfile

From this error, it seems that you're using the same XML file to create more than one Fast DDS participant. This will happen if you're instantiating more than one context within the directory where DEFAULT_FASTRTPS_PROFILES.xml is located. Can that be the case? I'd suggest applying that XML only for the node you want. To do that, you could name the file differently, and then use environment variable FASTRTPS_DEFAULT_PROFILES_FILE to point to that file (see Environment Variables)

terminate called after throwing an instance of 'eprosima::fastcdr::exception::NotEnoughMemoryException' what():  Not enough memory in the buffer stream

This error will be shown if you application uses unbounded types (which is very common in ROS 2). It originates from using history memory policy = PREALLOCATED_MEMORY_MODE, which preallocates memory for the samples, which in your case then exceed the buffer size, thus generating the error. Even though that value is the default for Fast DDS, it is not the default when using ROS 2. Can it be that you're setting environment variable RMW_FASTRTPS_USE_QOS_FROM_XML=1? As stated here, that has some implications that are needed to be addressed in the XML. I'd suggest using PREALLOCATED_WITH_REALLOC_MEMORY_MODE instead. With this memory mode, Fast DDS will simply allocate more memory for you buffer if needed (see Memory management policy).

Furthermore, in order for your participant profile to be loaded in ROS 2, you'd need to add the attribute is_default_profile="true" to the <participant> tag (see Example).