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

I found the problem.

RTI interprets unbounded string as MAX_SIZE_INT32 which is 2147483647. I had a variable in header as string frame_id. To establish communication between ROS2 and native DDS, the types should be same. So, in the QoS.xml, I gave the maxStringLength = 2147483647. This gave an error create DataWriter buffer pool. Refering to the RTI community, I created an extra QoS setting for the data_writer and data_reader :

<datawriter_qos> <property> <value> <element> <name>dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size</name> <value>2147483647</value> </element> </value> </property> </datawriter_qos>

        <datareader_qos>
            <property>
                <value>
                    <element>
                    <name>dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size</name>
                    <value>2147483647</value>
                    </element>
                </value>
            </property>
        </datareader_qos>

This somehow lead to improper memory management and ROS2 wasnt able to subscribe any messages (not enterin the callback). I reduced the buffer size of the datawriter to 2046 and now it works perfectly fine.

Question : Although I have found out the error, I am still not sure what are the possible reasons for it. Is it only memory creation problem ?

I found the problem.

RTI interprets unbounded string as MAX_SIZE_INT32 which is 2147483647. I had a variable in header as string frame_id. To establish communication between ROS2 and native DDS, the types should be same. So, in the QoS.xml, I gave the maxStringLength = 2147483647. This gave an error create DataWriter buffer pool. Refering to the RTI community, I created an extra QoS setting for the data_writer and data_reader :

 <datawriter_qos>
         <property>
             <value>
                 <element>
                 <name>dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size</name>
                 <value>2147483647</value>
                 </element>
             </value>
         </property>
            </datawriter_qos>

 </datawriter_qos>
    <datareader_qos>
         <property>
             <value>
                 <element>
                 <name>dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size</name>
                 <value>2147483647</value>
                 </element>
             </value>
         </property>
     </datareader_qos>

This somehow lead to improper memory management and ROS2 wasnt able to subscribe any messages (not enterin the callback). I reduced the buffer size of the datawriter to 2046 and now it works perfectly fine.

Question : Although I have found out the error, I am still not sure what are the possible reasons for it. Is it only memory creation problem ?