Best way of pausing HectorSLAM (or any node)?

asked 2019-03-13 11:16:19 -0600

hannesjk gravatar image

I would like to run AMCL with a static map to localize a mobile robot with a 2D-LIDAR. In addition, I want to be able to run HectorSLAM separately and create sub maps as the robot is driving. Is it possible to modify HectorSLAM so that at any time a map can start to be created for some specific time?

After searching I found that one way could be to add a service in HectorSLAM that destroys for example the LaserScan subscriber to stop and creates a new one to resume. Another way might be to add a loop somewhere with a ros::Duration::sleep() and with a subscriber that waits for a message to resume.

edit retag flag offensive close merge delete