Ask Your Question
0

Using respawn= "true" , ensure a clean restart ? [closed]

asked 2016-02-17 12:46:22 -0600

cnanda84 gravatar image

When using a respawn ="true" in the launch file, does ros automatically terminate the associated process or does that have to be handled by the user somehow. We are using kinect2_bridge nodelet and see that under some circumstances, when it crashes, fails to recover as the associated process is still hanging around or complains that a old node with the same name already exists. Manually looking for a process with ps -lae | grep nodelet and then killing it solves the problem.
Will increasing the delay help ? -cn

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Procópio
close date 2018-02-07 06:40:16.505033

1 Answer

Sort by » oldest newest most voted
1

answered 2016-02-17 13:20:43 -0600

ahendrix gravatar image

The respawn="true" functionality detects when the node crashes by detecting when the process terminates.

If the process for the node doesn't terminate, it doesn't detect that it has crashed, and therefore it isn't restarted.

edit flag offensive delete link more

Comments

A simple related question, can this feature be used for a nodelet as well ? Or is it only meant for a node ? I didn't explicitly mention it but we are using a nodelet when observing this problem.

cnanda84 gravatar imagecnanda84 ( 2016-02-25 13:09:13 -0600 )edit

respwan was designed to work with nodes; you may see different behavior with nodelets, The nodelet runs in the manager's process space; not in the loader, but roslaunch will be trying to restart the loader.

ahendrix gravatar imageahendrix ( 2016-02-25 13:21:33 -0600 )edit

Another unrelated question, so if my code hangs in between( some software bug ). Will the re-spawn feature help me restart the node ? Also, can I expect it to restart the node in case of a segmentation fault ?

cnanda84 gravatar imagecnanda84 ( 2016-02-25 14:17:12 -0600 )edit

As I already explained, roslaunch only restarts your node when the process terminates (this includes segfaults). If your process is still running and is hung somewhere, roslaunch will not restart.

ahendrix gravatar imageahendrix ( 2016-02-25 15:45:54 -0600 )edit

In general, roslaunch will never stop your process; it only restarts it if it has already stopped for some other reason.

ahendrix gravatar imageahendrix ( 2016-02-25 15:47:54 -0600 )edit

Question Tools

Stats

Asked: 2016-02-17 12:46:22 -0600

Seen: 928 times

Last updated: Feb 17 '16