0
$\begingroup$

Rosanswers logo

Hello,

I'm working on a node with an internal state machine. The node has to run the main loop in the "running" state, then after using Ctrl+C (or sending a rosnode kill) switch into a "closing" state do some stuff (maybe ROS related, like publishing on a topic) and then shutdown completely. In synthesis, I need to break the main loop without using ros::shutdown().

Currently I'm using an implementation similar to the one suggested here: http://answers.ros.org/question/27655/what-is-the-correct-way-to-do-stuff-before-a-node-is-shutdown/

Is this one still the best (and probably only) approach? Or there is a way to "split" the shutdown procedure?


Originally posted by g.bardaro on ROS Answers with karma: 110 on 2016-12-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

http://answers.ros.org/question/27655/what-is-the-correct-way-to-do-stuff-before-a-node-is-shutdown/ Is still the best approach.


Originally posted by tfoote with karma: 58457 on 2016-12-22

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by g.bardaro on 2016-12-23:
I see, thank you.

Is there any future plan on extending the shutdown procedure and give to the developers more control over it?

$\endgroup$

Your Answer

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