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

hector_slam: how to load a saved map (and perform localization)

asked 2012-11-05 03:38:36 -0500

randaz gravatar image

Hi, I read the tutorial about creating a new map with hector_slam and save it. My question now is: how to load a saved map and use it for localization? (thus substituting amcl) Thanks

edit retag flag offensive close merge delete


that is exactly what I was searching for!

Procópio gravatar image Procópio  ( 2012-11-21 08:46:54 -0500 )edit

I am also really interested in doing that, but still new in ROS. Is there any update?

quentin gravatar image quentin  ( 2015-11-08 20:41:28 -0500 )edit

Does anyone have any updates?

jjbecomespheh gravatar image jjbecomespheh  ( 2020-06-08 02:53:34 -0500 )edit

5 Answers

Sort by » oldest newest most voted

answered 2012-11-05 14:33:48 -0500

Yes, this is currently not supported. I meant to add it add some point (shouldn't be too difficult), but I'm quite stuffed with ToDos, so I probably won't be able to implement that functionality in the foreseeable future.

edit flag offensive delete link more


thanks for the nice work man! I am amazed on how well it works with my bad odom robot. implementing localization with a loaded map would be perfect. could you point some direction on how you would do it? I might give it a try! thanks

Procópio gravatar image Procópio  ( 2012-11-21 08:45:49 -0500 )edit

As long as one doesn't use multiple map resolution levels it shouldn't be too hard. Essentially, the map would only have to be read via some method at startup and not get updated later. The most annoying (even if not really complicated) thing is probably setting the transforms correctly.

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2012-11-27 02:27:51 -0500 )edit

Any progress on this yet? I'm trying to use the odom data from hector slam with a pre-saved map. Then I will use move_base with it.

musiqsoulchild gravatar image musiqsoulchild  ( 2015-03-17 16:26:56 -0500 )edit

Just brainstorming and was wondering if I just loaded in a presaved map using map_server and remapped the /map topic created from hector slam to something else. Then I could use the localization from hector slam and use a static map. Any comments on this approach?

musiqsoulchild gravatar image musiqsoulchild  ( 2015-03-17 17:21:49 -0500 )edit

Hi, may I check if anyone has implemented this (localization only) on Hector SLAM?

jjbecomespheh gravatar image jjbecomespheh  ( 2020-06-14 21:34:11 -0500 )edit

answered 2012-11-05 04:01:55 -0500

dornhege gravatar image

My guess is that this is not possible, so you'll just save the map as any other occupancy map and use amcl.

edit flag offensive delete link more

answered 2017-02-22 18:13:33 -0500

tb12 gravatar image

I have gotten AMCL to work with the LaserScanMatching node using just a Lidar. I set the fixed frame in LaserScanMatching to odom and the base frame to base_link. In AMCL it uses the intuitive parameter names, odom frame is odom, base frame is base_link. The tf tree then goes map -> odom by amcl, odom -> base_link by laser_scan_matching.

I will try to get this working with hector slam also as the odometry, if anyone has gotten that please let me know how!

edit flag offensive delete link more

answered 2012-11-05 22:43:45 -0500

randaz gravatar image

Thank you for your answer. So amcl is the only way to perform localization on a saved map? But in this case I have to use odometry, which is not reliable on our custom robot. Is there any other way to perform localization on a saved map using only laser data? PS: I think that is a pity that this feature is missing in hector_slam, the mapping results are really good and it would be really interesting to use it a complete navigation demo.

edit flag offensive delete link more


2 can provide something like odometry based on laser. I am not aware of another localization package than amcl.

dornhege gravatar image dornhege  ( 2012-11-05 22:46:14 -0500 )edit

Please do not use answers for comments or discussion. This is not a forum. Instead please either edit your original post or use the comment functionality.

Lorenz gravatar image Lorenz  ( 2012-11-05 23:01:27 -0500 )edit

@dornhege, I took a look and think laser_scan_mathcer actually computes odom based on laser measurements only and not on matching scans with a previous built map. maybe laser_scan_matcher + amcl might work.

Procópio gravatar image Procópio  ( 2012-11-21 21:27:00 -0500 )edit

Correct. Odometry is what was missing at his robot.

dornhege gravatar image dornhege  ( 2012-11-21 22:33:57 -0500 )edit

answered 2018-09-26 09:21:44 -0500

AndyZe gravatar image

There's a PR that claims to provide this capability now:

edit flag offensive delete link more

Question Tools



Asked: 2012-11-05 03:38:36 -0500

Seen: 4,457 times

Last updated: Sep 26 '18