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

Kill a Respawning Node (with pkill?)

asked 2015-06-05 08:21:05 -0500

mattc_vec gravatar image

I have some nodes set to respawn, but I want to kill them cleanly in a python script. Could I use pkill to do this? The nodes are specified by name, so would I need their Pid to have pkill kill them? I can find their Pid through rosnode info, but how would I do this in a script? Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2015-06-06 02:45:48 -0500

ahendrix gravatar image

When roslaunch is set to respawn a node, and it detects that that node has stopped (for any reason), it will start a new copy of that node.

  • If you kill the node by using it's pid, roslaunch will restart it
  • If you kill the node using the process name and pkill, roslaunch will restart it
  • If the node segfaults or stops on its own, roslaunch will restart it
  • If you kill the node using rosnode kill, roslaunch will restart it

If you want to stop and the node and prevent it from restarting, you need to stop roslaunch.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-06-05 08:21:05 -0500

Seen: 2,232 times

Last updated: Jun 06 '15