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

How do I shutdown slam_toolbox node?

asked 2022-11-02 08:57:10 -0500

RobotDreams gravatar image

updated 2022-11-02 08:59:00 -0500

I launch slam-toolbox (to create a map) from a bash script using the following command:

nohup ros2 launch slam_toolbox online_async_launch.py 'slam_params_file:=./my_mapper_params_online_async.yaml' &

After I run my script to shutdown all my robot's nodes, I am left with the slam-toolbox node still running:

$ ros2 node list
/slam_toolbox
/transform_listener_impl_aaaaf5c6bda0

$ ps -ef | grep slam
ubuntu     10023       1  1 Nov01 pts/0    00:14:32 /opt/ros/humble/lib/slam_toolbox/async_slam_toolbox_node --ros-args -r __node:=slam_toolbox --params-file my_mapper_params_online_async.yaml --params-file /tmp/launch_params_mv_dwh67

How do I shutdown the slam_toolbox node?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2022-11-02 20:23:01 -0500

Well really running processes using & to detach is a bad idea for the above reason, you don't have a hook on the process to easily kill later. That's probably not a good way of handling things.

edit flag offensive delete link more

Comments

@stevemakenzie If I remember correctly you are the creator of this phenomenal package. Can you point me to a tutorial that starts and stops it “in a good way?”

RobotDreams gravatar image RobotDreams  ( 2022-11-03 02:08:16 -0500 )edit
0

answered 2022-11-02 09:15:38 -0500

RobotDreams gravatar image

Figured it out:

killall async_slam_toolbox_node

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-11-02 08:57:10 -0500

Seen: 132 times

Last updated: Nov 02 '22