ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hi @ashu,
If you take a look at the documentation it says: "[...] and will automatically stop when it is destroyed". Following the code, when you see its destructor here you will see that the spinner is stopped when is destroyed, that is the same to have a ros::shutdown()
or SIGINT (Ctrl-C) signal sent since the memory will be freed automatically. And if you do not want to call ros::shutdown()
you can call directly the destructor.
However to be more clear, in C++ for instance, by default, most signals cause an immediate, abnormal exit of the program but the particular thing in ROS is that ros::shutdown()
is doing all the nasty work for you.
Regards.