fastrtps: How to specify max_blocking_time for components

asked 2020-12-03 03:27:29 -0500

Yroslavcr gravatar image

updated 2020-12-05 05:35:54 -0500

Can't change parameter max_blocking_time for components.

Xml:

<?xml version="1.0" encoding="utf-8"?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
    <profiles>
        <publisher profile_name="publisher_default" is_default_profile="true">
            <qos>
                <publishMode>
                    <kind>ASYNCHRONOUS</kind>
                </publishMode>

                <reliability>

                    <kind>RELIABLE</kind>

                    <max_blocking_time>
                        <sec>DURATION_INFINITE_SEC</sec>
                    </max_blocking_time>

                </reliability>
            </qos>

            <historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>

        </publisher>

        <subscriber profile_name="subscriber_default" is_default_profile="true">
            <qos>
                <reliability>

                    <kind>RELIABLE</kind>

                    <max_blocking_time>
                        <sec>DURATION_INFINITE_SEC</sec>
                    </max_blocking_time>

                </reliability>
            </qos>
            <historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>
        </subscriber>
    </profiles>
</dds>

Run: launch from https://github.com/ros2/rmw_fastrtps/...

FASTRTPS_DEFAULT_PROFILES_FILE=<path> RMW_FASTRTPS_USE_QOS_FROM_XML=1 RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 launch high_freq_components.launch.py

Error:

[RTPS_HISTORY Error] Change payload size of '88' bytes is larger than the history payload size of '51' bytes and cannot be resized. -> Function add_change

rtps/history/ReadHistory.cpp or rtps/history/WriterHistory.cpp:

if (m_att.memoryPolicy == PREALLOCATED_MEMORY_MODE && a_change->serializedPayload.length > m_att.payloadMaxSize)
{
    logError(RTPS_READER_HISTORY,
           "Change payload size of '" << a_change->serializedPayload.length <<
           "' bytes is larger than the history payload size of '" << m_att.payloadMaxSize <<
           "' bytes and cannot be resized.");
    return false;
}

Why m_att.memoryPolicy = PREALLOCATED_MEMORY_MODE and not PREALLOCATED_WITH_REALLOC_MEMORY_MODE

When I use nodes this does not happen.

edit retag flag offensive close merge delete