Hector Mapping working with bag file but not LIVE?

asked 2016-12-01 19:35:47 -0500

barefooter22 gravatar image

updated 2016-12-08 03:52:35 -0500

I am currently working on an autonomous robot that requires me to build a map and navigate it. I can get a map built using the tutorial.launch file within the hector_slam_launch package, but I can't seem to get it to work in a live setting. I can record a bag file, start doing stuff (notice that it is not building a map at this point), stop recording, and play back the file and it will build the map. Am I missing something here? I understand that this might be an issue with the clock as I use the "--clock" argument to record the bag file. I'd really appreciate any help I can get because I need to resolve this quickly.



Edit 2:

I made some significant changes to the launch file and included all of the hector mapping stuff and I was able to get everything working, but I'm having issues with the mapping working. Hector mapping is complaining that it can't transform the odom to the map because it would need to transform into the future. If I'm not mistaken, I think the tree is supposed to go map=>odom=>base_link?

<node pkg="tf" type="static_transform_publisher" name="map_baselink_broadcaster" args="0 0 0 0 0 0 map base_link 100"/> <node pkg="tf" type="static_transform_publisher" name="map_2odom" args="0 0 0 0 0 0 map odom 100"/> <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

<!-- Map size / start point -->
<param name="map_resolution" value="0.025"/>
<param name="map_size" value="2048"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="laser_z_min_value" value="-2.5" />
<param name="laser_z_max_value" value="7.5" />

<!-- Map update parameters -->
<param name="update_factor_free" value="0.4"/>
<param name="update_factor_occupied" value="0.7" />    
<param name="map_update_distance_thresh" value="0.2"/>
<param name="map_update_angle_thresh" value="0.06" />

<param name="pub_map_odom_transform" value="false"/>

  <param name="pub_drawings" value="true"/>
  <param name="pub_debug_output" value="true"/>


<include file="$(find hector_geotiff)/launch/geotiff_mapper.launch"/>


I also added the new tf tree that was generated here: https://drive.google.com/drive/folder...

Link to the files: https://drive.google.com/drive/folder...

I have included a bag file in the link above as well

Link to Github:



edit retag flag offensive close merge delete


Hi, can you post the rosout when you try to run live? Launch files as well. Those will be useful to find the problem

DavidN gravatar imageDavidN ( 2016-12-02 05:43:59 -0500 )edit

Hi David, thanks for being so prompt. I had some technical difficulties with the plow and didn't get around to running this until now. I will post rosout as well as the launch files and also a link to the bag file I generated.

barefooter22 gravatar imagebarefooter22 ( 2016-12-07 00:16:29 -0500 )edit

First thing to note is: you can do rostopic echo /rosout/msg to filter out all the unnecessary data from rosout. Second, I dont see why you need to specific the transform from /nav to any of the base frame, isnt Hector Mapping supposed to keep track of these transform alrd?

DavidN gravatar imageDavidN ( 2016-12-07 02:27:03 -0500 )edit

Thanks for replying David. After some extensive scouring of various issues on the forum here, I was able to get it to work, but I'm having problems with my tf tree. Any suggestions? See the Google Drive link for the frames pdf.

barefooter22 gravatar imagebarefooter22 ( 2016-12-08 03:48:24 -0500 )edit