ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

How to shutdown all nodes

asked 2016-08-20 20:34:17 -0600

Cerin gravatar image

What's the easiest way to signal all nodes to shutdown?

I created a daemon that runs several launch files in the background, but now that even if I kill the roscore, the other nodes don't end, they just keep running, forcing me to hunt them down and manually kill each process.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2018-01-14 10:40:03 -0600

AlexandruIftimie gravatar image

Late answer but worth doing so. rosnode kill -a will terminate correctly all nodes.

For example before I was terminating all processes by using killall -u user_name, and this managed the rtabmap node to corrupt the database. With the command I first mentioned, no more corruption happens.

edit flag offensive delete link more

Comments

1

rosnode kill -a is a nice way to shutdown nodes, as it gives them time to properly close files, stop timers, etc, but do know that it'll only work as long as your roscore is running. If that is gone, it won't be able to find the running nodes anymore.

gvdhoorn gravatar image gvdhoorn  ( 2018-01-14 11:20:41 -0600 )edit
1

It seems that this doesn't work for respawn nodes, though (unless you have at least one required node).

peci1 gravatar image peci1  ( 2021-02-01 16:19:33 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2016-08-20 20:34:17 -0600

Seen: 9,278 times

Last updated: Jan 14 '18