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

ros nodes not shutting down

asked 2018-09-07 18:45:11 -0600

debonair gravatar image

updated 2018-09-07 18:45:32 -0600

i have a launch file which first launch another launch file and then it starts another node. When my another node terminates I expect nodes started by first launch file should also terminate. So I have

 while (ros::ok())

in my first launch node so if my second node finishes, i want to terminate first node. but right now on console I get

"escalating to SIGTERM"

. How do I fix this issue?

edit retag flag offensive close merge delete

Comments

1

Nodes not shutting down is typically caused by either not checking ros::ok() or not having a proper ros::Rate::sleep() somewhere in your while loop. The first is probably not the case, but do please check the second.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-08 13:38:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-09-07 19:05:27 -0600

alsora gravatar image

That's not how it works.

If a node "finishes" its execution, the other nodes could still keep spinning. A node is killed when its node handler goes out of scope or when ros::shutdown() is called.

You can find a detailed description of initialization and shutdown here http://wiki.ros.org/roscpp/Overview/I...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-09-07 18:45:11 -0600

Seen: 1,541 times

Last updated: Sep 07 '18