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

Close all ros node using c++

asked 2023-04-14 13:24:54 -0500

akumar3.1428 gravatar image

updated 2023-06-18 09:43:17 -0500

lucasw gravatar image

Hi, I am trying to shutdown all the nodes using C++, I tried ros::shutdown(); , but it looks like it only kills the node of the c++ file in which it has been call. I also tried passing the control c or rosnode kill -a commands inside the c++ file but it does not looks optimal solution to me looks like

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-04-14 14:57:13 -0500

akumar3.1428 gravatar image

Using #include <cstdlib> for system() function you can give

killall -9 rosmaster && killall -9    rosout

to kill the rosnode

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-04-14 13:24:54 -0500

Seen: 253 times

Last updated: Apr 14 '23