Closed ncnynl closed 3 years ago
Are you deleting in the correct order?
Check this example for reference. If you change the order of finishing entities does it works?
rcl_publisher_fini(&publisher, &node);
rcl_node_fini(&node);
rcl_timer_fini(&timer);
rclc_executor_fini(&executor);
rclc_support_fini(&support);
I adjusted the order, but the problem was not resolved.
The current problem may be that I added a judgment function in the while loop, which led to the judgment that the client's connection status could not be obtained correctly, so that the code behind the while was automatically executed, so the agent also automatically closed the session.
while(agent_connected()){ # i chage into while(1) , it will be ok .
rclc_executor_spin_some(&executor, RCL_MS_TO_NS(10));
}
###
rcl_publisher_fini(&publisher, &node);
rcl_node_fini(&node);
rcl_timer_fini(&timer);
rclc_executor_fini(&executor);
rclc_support_fini(&support);
#### after execute those line , the agent session will be deleted .
bool agent_connected(void)
{
bool ret ;
if (RMW_RET_OK == rmw_uros_check_agent_status(10))
{
ret = true ;
} else {
ret = false ;
}
return ret ;
}
i can not use rmw_uros_ping_agent for check status . i don't have this function
@pablogs9 Thank you for your reply
Consider using the new ping function. In order to do so, just update your workspace or create it from scratch.
At present, such errors often appear in the operation, leading to suspension. I want to know how to debug the problem?
show error in agent console :
show Error in app.c on usart:
error in app.c 226 line: