ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A
Ask Your Question

Goals and Navigation in dynamic maps using GMapping

asked 2011-05-11 06:51:02 -0500

Pablo Hevia-Koch gravatar image

Hello Everyone,

Lately I've been experimenting on using the navigation stack without the mapserver, and using GMapping for the generation of a map via Online SLAM, with very good results (although sometimes a little CPU intensive).

I was wondering how could I refer to a point the robot has visited in the past, when the map is continually changing. Here is an example of my question:

Suppose I am giving my robot a tour of the office (he doesn't have a prior knowledge of its environment). While we tour, at certain positions I will "mark" some place, for example, "this is Ben's desk". After the tour, I would like to be able to tell the robot to go to Ben's desk.

I am not sure how I could manage to do that if the map is continually changing, in size, orientation, etc. Is there a way that doesn't rely exclusively on odometry?

Thanks in advance. All ideas are welcome :)

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2011-05-11 07:15:30 -0500

dornhege gravatar image

Well, in theory the map should not be changing, just growing in terms of adding information. So, if you mark your current location in the /map frame, then this should later also be the same position to go back to.

If the maps you are producing look OK, this should be sufficient. Otherwise you need a better SLAM solution or remember the environment and use some global matching procedure to find the spot.

edit flag offensive delete link more


Are you sure about this? I've seen maps change in the sense of "deformation" when closing loops, and similar things.
Pablo Hevia-Koch gravatar imagePablo Hevia-Koch ( 2011-05-11 07:16:54 -0500 )edit
That what the "in theory" was for. It can happen that the map deforms to correct accumulated errors. The only real solution is: better SLAM algorithm/input quality or to use some kind of place recognition. E.g. with graph-based SLAM you could remember the current node.
dornhege gravatar imagedornhege ( 2011-05-12 05:28:15 -0500 )edit
Thank you very much for your advice =). I'll give it a shot
Pablo Hevia-Koch gravatar imagePablo Hevia-Koch ( 2011-05-12 06:29:10 -0500 )edit
Have you made any achievements? I need to do the same. Or are there any packages to mark positions?
felix k gravatar imagefelix k ( 2011-09-14 02:11:33 -0500 )edit

@dornhege How do yo tag a position in the /map??? Ive looked for this answer but was unable to find it. Thanks

ctguell gravatar imagectguell ( 2013-09-12 10:10:52 -0500 )edit

Just transform your position from its odom frame (or where it is originated from) to the map frame using `tf` and store it in a list of positions as wanted.

felix k gravatar imagefelix k ( 2013-09-15 22:59:52 -0500 )edit

@felix_k thanks but could you explain how to store that position so later I can see it in rviz for example?? Should i listen to /map and then publish it with a new topic?? I understand the idea but dont know how to make it work, i would really appreciate your help, thanks

ctguell gravatar imagectguell ( 2013-09-24 07:34:22 -0500 )edit

I've had written a tool that stores positions and can give them to `move_base` later, storing just the geometry_msg/Pose objects used in all messages in a list: [](

felix k gravatar imagefelix k ( 2013-09-24 23:04:25 -0500 )edit

answered 2011-05-11 08:31:01 -0500

I pretty much agree with dornhedge that /map shouldn't be changing too much.

Another, pretty ad-hoc solution would be to remember the local environment when a position is tagged and then to do some kind of nearest neighbor search in your updated map, with a (possibly gaussian) prior over the odometry estimate for Ben's desk.

But that may be too much hassle and/or computation to implement/run.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2011-05-11 06:51:02 -0500

Seen: 1,136 times

Last updated: May 11 '11