Ask Your Question

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

2 Answers

Sort by ยป oldest newest most voted

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


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 imagegvdhoorn ( 2018-01-14 11:20:41 -0600 )edit

answered 2016-08-21 09:34:42 -0600

Airuno2L gravatar image

You might need to provide a little more information about what you're trying to do in order for people to give the correct guidance. But if you're trying to start ros when the computer boots, the common way of doing this is robot_upstart. The basic usage is explained here. Additionally, if you're running "several launch files" it is best to create one launch file that launches all the rest using the include tag, I don't know enough about your problem to know if that will help things, but it will make everything cleaner.

edit flag offensive delete link more


You're overanalyzing what I'm asking. I'm asking for exactly what the title says, how to terminate all node processes. Yes, I know about robot_upstart. That's what I was using, but it's unmaintained and no longer supports Kinetic, so I've abandoned it for a simpler cron-based approach.

Cerin gravatar imageCerin ( 2016-08-21 20:31:57 -0600 )edit

I'm already using a master launch file including other launch files via the include statement. That's what I meant by "running several launch files".

Cerin gravatar imageCerin ( 2016-08-21 20:33:58 -0600 )edit

Does killing the process named "roslaunch" work?

Airuno2L gravatar imageAiruno2L ( 2016-08-22 07:04:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



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

Seen: 2,677 times

Last updated: Jan 14 '18