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

Navigate using hector_slam

asked 2013-11-10 22:11:49 -0500

Huibuh gravatar image

updated 2013-11-18 07:14:34 -0500

tfoote gravatar image


Using my custom robot base, I can successfully perform autonomous navigation using either [amcl/map_server/move_base] or [gmapping/move_base]. However, I really would like to use hector_mapping for SLAM, as it seems to perform much better (less CPU, better localization). I tried two approaches, but none led to success:

OPTION 1: Use hector_mapping/move_base

This fails with the follwing error message thrown by move_base:

[ERROR] [1384155009.792804637]: Extrapolation Error: Lookup would require extrapolation into the future.  Requested time 1384155009.754343262 but the latest data is at time 1384155009.733661973, when looking up transform from frame [odom] to frame [map]

Looking at the output of rosrun tf tf_monitor, I can see the following differences between the published tf's:

hector_mapping providing /map -> /odom transform:

rosrun tf tf_monitor
Frame: odom published by /hector_mapping Average Delay: 0.0486663 Max Delay: 0.0770144

amcl providing /map -> /odom transform:

rosrun tf tf_monitor
Frame: odom published by /amcl Average Delay: -0.0532177 Max Delay: 0

This completely makes sense, as the amcl documentation states here:

The published transforms are future dated.

This explains why move_base throws the extrapolation error. The question is: How to fix it? Of course, I could add 0.1s to the tf time stamp generated by hector_mapping in the source, but then I won't get future package updates, which is not ideal. Any better suggestions how to make hector_mapping compatible with move_base?

Option 2: Use hecor_navigation package

Unfortunately, there is no documentation available for this package. As hecor_navigation only available from source, I downloaded it from here into my rosbuild workspace (package is not catkinized) and ran rosmake to compile it. This produced the following error:

[rospack] Error: package/stack 'hector_elevation_visualization' depends on non-existent package 'common_rosdeps' and rosdep claims that it is not a system dependency. Check the ROS_PACKAGE_PATH or try calling 'rosdep update'

@Stefan: Is hecor_navigation still being maintained, or is there a successor package that is compatible with Groovy or Hydro?

Thanks, Heiko

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2013-11-11 20:53:05 -0500

We used hector_mapping with move_base before (and some other people have done so too, I think), so things really should work. Are hector_mapping and move_base running on different machines? If that´s the case, we could be looking at a time sync issue. Other than that, it looks like some tf lookup in move_base is not done properly (i.e. a wait appears to be missing). Which move_base version are you using?

As for hector_navigation: We didn´t have time to catkinize it yet (Atlas keeps me pretty busy these days), but we use it for our autonomous robot systems with Team Hector (also in groovy and hydro). Have you tried what happens when you remove the common_rosdeps dependency?

edit flag offensive delete link more


hector_mapping and move_base are running on the same machine, so I think we can rule time sync issues out.

Huibuh gravatar image Huibuh  ( 2013-11-11 22:52:22 -0500 )edit

I am using the latest move_base version on Hydro, everything is up-to-date. The fact that move_base works fine if I exchange hector_mapping with amcl hints that amcl's tf future-dating is the culprit here. To confirm, I need to future-date the /map -> /odom tf provided by hector_mapping. But how?

Huibuh gravatar image Huibuh  ( 2013-11-11 22:54:19 -0500 )edit

Btw., I have not found any reports anywhere of someone actually succeedig in usung hector_mapping as a amcl/gmapping replacement. Please provide a link if I missed soemthing.

Huibuh gravatar image Huibuh  ( 2013-11-11 22:57:11 -0500 )edit

Regarding hector_navigation: I tried getting it to work under Hydro. Issues: 1) If I remove the common_rosdeps dependency I get ".../hector_navigation/hector_elevation_visualization/src/hector_elevation_visualization.h:16:22: fatal error: Eigen/Core: No such file or directory"

Huibuh gravatar image Huibuh  ( 2013-11-11 23:01:03 -0500 )edit

I removed the old common_rosdeps dependency in package hector_elevation_visualization in .

Johannes Meyer gravatar image Johannes Meyer  ( 2013-11-12 08:01:40 -0500 )edit

Awesome, I will try it out tomorrow. Cheers!

Huibuh gravatar image Huibuh  ( 2013-11-12 08:03:22 -0500 )edit

The guy who made this video used hector_mapping with move_base apparently: We also did so with our (LIDAR equipped) Turtlebots before.

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2013-11-12 09:08:48 -0500 )edit

answered 2014-07-08 11:13:24 -0500

koenlek gravatar image

updated 2014-07-08 11:14:23 -0500

@Huibuh, did you manage to get it working? I am having the same problem currently. Maybe you should also run amcl?

Based on this page (under setup, point 3) and the YouTube video, I had this idea:

  1. Run AMCL, move_base and hector_mapping
  2. Let amcl take care of publishing the odom - map transform (based on this(image at bottom) it is not completely clear to me if it does that?)
  3. Make sure that hector_mapping does not publish the transform: <param name="pub_map_odom_transform" value="false"/>
edit flag offensive delete link more


I don't think running two localization packages (hector_slam and amcl) simultaneously is the way to go, as it would be a waste of CPU and memoiry ressources. I got hector_mapping and move_base to work together after figuring out that the "Extrapolation Error" is due to missing tf_wait line in move_base. I think it has been fixed int the official package branch

Huibuh gravatar image Huibuh  ( 2014-07-09 03:35:01 -0500 )edit

Okay sounds good. I still have this problem with the latest versions of everything from Hydro, Ubuntu 12.04. However, I am using a fork of move_base as I added some benchmarking code (forked the whole navigation stack a couple of months ago). Could you hint me where I should add the wait?

koenlek gravatar image koenlek  ( 2014-07-09 03:53:14 -0500 )edit

Question Tools



Asked: 2013-11-10 22:11:49 -0500

Seen: 3,303 times

Last updated: Jul 08 '14