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