Ask Your Question
0

ROS2 client connecting to the same server fails after restarting the executable

asked 2019-05-09 09:36:44 -0500

vandy2000 gravatar image

ROS Version: ROS2 Ardent

Platform: x86_64 Ubuntu 16.04 LTS, 4.15.0-48-generic

Hello! I'm creating a system with a rclcpp::Node instance that monitors and controls rclcpp_lifecycle::LifecycleNode or other rclcpp::Node instances (referred hereon out as managed nodes). It performs a bring-up and a bring-down handshake of sorts. The bring-up sequence has the managed node, if its a lifecycle node, publish a message containing the name of the node when it's created on a topic that this system management node is subscribed to. This management node uses the name of the node to create a client for the lifecycle state change service for that managed node, then requests it to be in a configured state, and finally, upon that success, an async request to an active state.

This works beautifully, I implemented a multithreaded-heartbeat service and this management node reliably hears back from all of these other nodes. The only problem I'm having and can't seem to find a way around is that when one of these managed nodes (either normal or lifecycle) is brought down through SIGINT, even though the bring-down handshake (informing this management node that it's being brought down, transitioning the lifecycle node to its finalized state if applicable, and calling rclcpp::shutdown, among other things) succeeds, when the managed node's executable is restarted (in the same session of the management node's executable), it usually has trouble communicating over one those services (lifecycle state change or heartbeat), and almost always fails to communicate the third time the executable is ran. But as soon as I terminate and rerun the management node's executable, it starts working perfectly again.

I briefly messed with the QoS associated with the clients for the services, and though that didn't help or made matters worse, I don't feel confident enough in my knowledge of those to rule that out as a possible solution.

Sound familiar to anyone? Is there something about destroying clients I should know about, or managing connections to a server? (I hope the latter isn't the case because I don't want to modify the lifecycle state change service XD)

I realize that Crystal is out, but I would like to hold off on making that transition until my project is in a completely stable state. If it's determined that this issue is uniquely Ardent-related though, then that could be a good motivator to get that transition going XD

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-06-04 09:07:28 -0500

vandy2000 gravatar image

updated 2019-06-04 09:07:59 -0500

I had recently updated to Crystal, and that immediately fixed everything! :)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-05-09 09:36:44 -0500

Seen: 24 times

Last updated: Jun 04