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

clear the map built by gmapping or restart gmapping by program

asked 2013-01-20 20:08:59 -0500

Kent gravatar image

I m trying to clear the map previously built by gmapping to build another place's map. I want to clear the map or restart the gmmaping node by computer programs, not manually. How can the map be cleared or the gmapping node be restarted by program?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-01-20 23:13:57 -0500

dornhege gravatar image

I think you'll have to do that manually by calling kill/rosnode kill and rosrun/launch. There is no restart functionality for ROS nodes.

edit flag offensive delete link more

answered 2017-06-08 08:48:12 -0500

onlytailei gravatar image

Check the gmapping source code. Create a new gmapping object in your code and every time when you want to start a new one. Destruct the old one and create a new one. (Like use the smart_ptr and reset it every time.)

edit flag offensive delete link more

answered 2019-02-04 02:37:16 -0500

Similar to hector_mapping, I've added a listener for the "syscommand" topic which resets the map as soon as data of the message equals "reset" on this fork:

Edited gmapping with map reset


rostopic pub -1 /syscommand std_msgs/String "data: 'reset'"
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2013-01-20 20:08:59 -0500

Seen: 2,923 times

Last updated: Feb 04 '19