Proper way to shutdown /rosout (roscore).
Hello,
I have a project where i start gazebo and several other rosnodes.
I want to be able to shut them all down at some point. I have a node that waits for a certain message and then shuts all other nodes down following with a self shutdown call like:
system("rosnode kill NAME_OF_NODE"); // shutdown other nodes
ros::shutdown(); // shutdown this node
This does work for everything except the /rosout node. The /rosout node always respawns if killed with rosnode kill. What I tried is to start a roscore in the starting programm before the other roslaunch files are executed, and then at the end, when all nodes finished cleanly I kill the roscore with kill all like:
system("roscore &"); // start roscore
... // starting other nodes with roslaunch
system("killall roscore"); // kill roscore
But this does seem like a dirty way. Is there a better way to do this?
Hi @Gieseltrud, try http://answers.ros.org/question/250182/terminate-ros-program/#250224