simple method to detect node crashes
Hey guys,
I am searching for a simple way to detect a node crash. I saw this already and the answer looks pretty simple to implement. However, the project I am working on has around 15+ nodes running at the same time and it looks like I would have to set a watchdog for each one of them.
Since the master does provide a message in the terminal whenever a node has crashed I was wondering if there is not an even more simple way to achieve my goal. Preferably even something that is only sending me a message when a node has crashed and therefore does not "clog" up the communication. Apparently (have not tested it yet) $rosnode list$ provides a list of all active nodes. I was wondering if I could periodically call this from within my .cpp-file (if I set the sampling rate low enough it should not interfere with other communication). I have seen that it is possible to do so for several other ROS commands that I usually only use in the terminal (find package path etc.).
What do you guys think?
Thanks, Marcus