-
Couldn't load subscription status.
- Fork 32
Description
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.








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.










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