0
$\begingroup$

Rosanswers logo

I have a bit of code that outputs data when the core dies. This works fine in all situations, except when the user uses 'rosnode kill -a'. The PR2 runs this command when stopping the robot, so it's a larger issue with specific robots than with ROS itself.

I believe this particular command is running a SIGKILL on all ROS nodes. These cannot be caught. Is there some other signal ROS sends out right before it dies that I can take advantage of?


Originally posted by curranw on ROS Answers with karma: 211 on 2016-07-29

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I don't think rosnode kill is sending SIGKILL. (If it is, there's nothing you can do).

I'm reasonably certain that rosnode kill uses the node's XMLRPC API to request that the node shutdown cleanly; in C++ you can check for this with ros::ok() or ros::isShuttingDown(), as described on the roscpp initialization and shutdown page.


Originally posted by ahendrix with karma: 47576 on 2016-07-29

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.