Skip to content

microros reconnection failed. #264

@chrisjaxy

Description

@chrisjaxy

Describe the bug
microros reconnection failed.

To Reproduce
Steps to reproduce the behaviour:
I found that when the microros connection fails or times out, it cannot be reconnected again. I tested pub, sub, client, services and added the log.
client
client2
pub
pub1
services
services2
sub
sub2
I found that the reason for the failure is the function get_memory. For failure, I made the following modifications to the code to make it reconnect successfully.
client_change
pub_change
pub_change2
pub_change3
pub_change4
services_change
sub_change
sub_change2
sub_change3
sub_change4
My code can refer to the demo program given by this link micro-ROS/micro_ros_setup#434. I created 26 pubs, 22 subs, 4 services and 5 clients. The method of reproduction is to restart the microros during the process of rclc_service_init_best_effort, rclc_client_init_best_effort, rclc_publisher_init_best_effort, rclc_subscription_init_best_effort.
The configuration of my colcon meta is as follows:

{
    "names": {
        "tracetools": {
            "cmake-args": [
                "-DTRACETOOLS_DISABLED=ON",
                "-DTRACETOOLS_STATUS_CHECKING_TOOL=OFF"
            ]
        },
        "rosidl_typesupport": {
            "cmake-args": [
                "-DROSIDL_TYPESUPPORT_SINGLE_TYPESUPPORT=ON"
            ]
        },
        "rcl": {
            "cmake-args": [
                "-DBUILD_TESTING=OFF",
                "-DRCL_COMMAND_LINE_ENABLED=OFF",
                "-DRCL_LOGGING_ENABLED=OFF"
            ]
        }, 
        "rcutils": {
            "cmake-args": [
                "-DENABLE_TESTING=OFF",
                "-DRCUTILS_NO_FILESYSTEM=ON",
                "-DRCUTILS_NO_THREAD_SUPPORT=ON",
                "-DRCUTILS_NO_64_ATOMIC=ON",
                "-DRCUTILS_AVOID_DYNAMIC_ALLOCATION=ON"
            ]
        },
        "microxrcedds_client": {
            "cmake-args": [
                "-DUCLIENT_PIC=OFF",
                "-DUCLIENT_PROFILE_UDP=OFF",
                "-DUCLIENT_PROFILE_TCP=OFF",
                "-DUCLIENT_PROFILE_DISCOVERY=OFF",
                "-DUCLIENT_PROFILE_SERIAL=OFF",
                "-UCLIENT_PROFILE_STREAM_FRAMING=ON",
                "-DUCLIENT_PROFILE_MULTITHREAD=ON",
                "-DUCLIENT_PROFILE_CUSTOM_TRANSPORT=ON"
            ]
        },
        "rmw_microxrcedds": {
            "cmake-args": [
                "-DRMW_UXRCE_MAX_NODES=1",
                "-DRMW_UXRCE_MAX_PUBLISHERS=30",
                "-DRMW_UXRCE_MAX_SUBSCRIPTIONS=25",
                "-DRMW_UXRCE_MAX_SERVICES=10",
                "-DRMW_UXRCE_MAX_CLIENTS=5",
                "-DRMW_UXRCE_MAX_HISTORY=2",
                "-DRMW_UXRCE_TRANSPORT=custom",
                "-DRMW_UXRCE_ENTITY_DESTROY_TIMEOUT=0",
                "-DRMW_UXRCE_TOPIC_NAME_MAX_LENGTH=100",
            ]
        }
    }
}

If you have successfully reproduced here and have better modifications, you can notify or tell me.

Expected behaviour
After microros reconnection fails or times out, it can still reconnect successfully.

System information (please complete the following information):

  • OS: Ubuntu 20.04, freertos
  • ROS 2 foxy
  • Version lastest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions