Roscore force unregister of node that died
Hi!
I believe I'm running into a situation in a multi machine setup.
Setup
- Machine running rosmaster
- Second machine that's properly setup to recognize the machine running roscore
What I believe I'm observing sometimes is that if I forcibly kill the second machine (for example, disconnect the power), since the ros::shutdown() is not called the roscore still thinks that the node is there and lists it.
Is there any way I can force roscore to kill the topic that is connected to the node that doesn't exist anymore?
Since I'm using anonymous node names (and I have to do it in my case) is that if I forcibly reset my slave computer I will end up with a rosnode list showing two topics, one of which is not connected to anything.
Any tips how to handle it neatly would be highly appreciated!
rosmaster doesn't have any timeout for nodes if they crash, so it will keep remembering them until a new node starts with the same name. I'm pretty sure this isn't a new issue, but I can't find a bug report for it.
Related Q&As: #q9521 and #q285530.
rosnode cleanup
should do the trick.Thanks for the helpful comments! I figured a better approach than force unregistering the node. Instead in my case it's sufficient to use node_alive and keep track of alive nodes
Wondering how this compares to bond (at least in C++).