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

shutdown alll nodes

asked 2018-05-28 06:21:00 -0600

ashwath1993 gravatar image

Hi,

I want to shutdown all nodes from within a ros node. ros::shutdown() kills the current node but does not kill the other nodes.

I know that all nodes can be killed using the terminal and through the launch file. But I test if a certain condition is met and only in such a circumstance I want all the nodes to shutdown.

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-05-28 06:32:38 -0600

NEngelhard gravatar image

If all your nodes are launched by a single launch file, you could make your checking node required and let it stop itself to take down the whole launch file. If you have several launch files, have a required node in each launch and connect the killer nodes with bonds.

edit flag offensive delete link more

Comments

Thanks a lot! I didn't know of this parameter.

ashwath1993 gravatar image ashwath1993  ( 2018-05-28 06:57:16 -0600 )edit
0

answered 2018-05-28 06:25:21 -0600

jayess gravatar image

Please see #q218412

edit flag offensive delete link more

Comments

Hi, the rosnode.kill_nodes and the API is for the python variant. I am not able to find the C++ equivalent.

ashwath1993 gravatar image ashwath1993  ( 2018-05-28 06:32:07 -0600 )edit
1

@NEngelhard's method is the next way that I was going to suggest.

jayess gravatar image jayess  ( 2018-05-28 06:44:20 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-28 06:21:00 -0600

Seen: 919 times

Last updated: May 28 '18