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

Hector_slam transform issues

asked 2016-06-21 11:01:42 -0500

23tg94 gravatar image

Hello Everybody,

I have been working at this for sometime now and i have run out of ideas. I don't know if maybe I'm just not understanding something correctly or what. Here is what I am trying to do: I have an XV-11 neato lidar that I am trying to use to build a map using hector_slam. The issue is i receive the following message every time i run hector_slam:

No transform between frames /map and /base_link available after 20.002274 seconds of waiting. This warning only prints once.

I have followed the tutorial here and have it setup exactly as the tutorial says. My tf frames look exactly like this.

My hector_mapping mapping_default.launch

<?xml version="1.0"?>
<arg name="tf_map_scanmatch_transform_frame_name" default="/scanmatcher_frame"/>
<arg name="base_frame" default="base_link"/>
<arg name="odom_frame" default="base_link"/>
<arg name="pub_map_odom_transform" default="true"/>
<arg name="scan_subscriber_queue_size" default="5"/>
<arg name="scan_topic" default="scan"/>
<arg name="map_size" default="2048"/>

<node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

<!-- Frame names -->
<param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>
<param name="map_frame" value="map" />
<param name="base_frame" value="$(arg base_frame)" />
<param name="odom_frame" value="$(arg base_frame)" />

<!-- Tf use -->
<param name="use_tf_scan_transformation" value="true"/>
<param name="use_tf_pose_start_estimate" value="false"/>

<!-- Map size / start point -->
<param name="map_resolution" value="0.050"/>
<param name="map_size" value="$(arg map_size)"/>
<param name="map_start_x" value="0.5"/>
<param name="map_start_y" value="0.5" />
<param name="map_pub_period" value="1.0" />
<param name="map_multi_res_levels" value="2" />

<!-- 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.9" />
<param name="laser_z_min_value" value = "-1.0" />
<param name="laser_z_max_value" value = "1.0" />

<!-- Advertising config --> 
<param name="advertise_map_service" value="true"/>

<param name="scan_subscriber_queue_size" value="$(arg scan_subscriber_queue_size)"/>
<param name="scan_topic" value="$(arg scan_topic)"/>

<!-- Debug parameters -->
  <param name="output_timing" value="false"/>
  <param name="pub_drawings" value="true"/>
  <param name="pub_debug_output" value="true"/>
<param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />



My neato.launch file in hector_slam_launch

<?xml version="1.0"?>


  <!-- Starts the laser scan node capture thingy -->

  <node pkg="tf" type="static_transform_publisher" name="odom_to_base_frame" args="0.0 0.0 0.0 0 0 0.0 /odom /base_link 10"/>

  <node pkg="tf" type="static_transform_publisher" name="base_frame_laser" args="0 0 0 0 0 0 /base_link /laser 10"/>

  <node pkg="rviz" type="rviz" name="rviz" 
args="-d $(find hector_slam_launch)/rviz_cfg/mapping_demo.rviz"/>

  <include file="$(find hector_mapping)/launch/mapping_default.launch"/> 

  <!-- <node pkg="rviz" type="rviz" name="rviz" args="-d rviz_cfg.rviz"/> -->
  <include file="$(find hector_geotiff)/launch/geotiff_mapper.launch"/>

Any help would be greatly appreciated!

edit retag flag offensive close merge delete


When I used that same tutorial with the neato I got the same message while building maps. But the maps came out just fine. Are you sure the map isn't being built? That message alone isn't enough to convince me.

billy gravatar image billy  ( 2016-06-22 00:24:50 -0500 )edit

I think the 3rd arg in the default hector launch file <arg name="odom_frame" default="base_link"/> may be an issue involved in the failure to get the TF but I never followed it up because the mapping works fine with that message being displayed

billy gravatar image billy  ( 2016-06-22 00:27:58 -0500 )edit

It does start mapping and everything runs, however, the location of the lidar jumps around and doesn't match the scans properly. The reason I think it is a transform error is because when I look at the laser scan in rviz, with map as the fixed frame, it is all over the place...

23tg94 gravatar image 23tg94  ( 2016-06-22 08:15:29 -0500 )edit

But when the fixed frame is laser the scan looks perfect. So I know it's not a hardware issue. And all I can think of is the transform between the map and laser isn't working properly so hector-slam doesn't really know what to do.

23tg94 gravatar image 23tg94  ( 2016-06-22 08:16:38 -0500 )edit

To get it work for me I had to limit the rotation speed. It is very sensitive to rotation so try it at 10% your current max rotation speed and see if that fixes it. It is also sensitive to linear speed, but not nearly as much.

billy gravatar image billy  ( 2016-06-22 11:59:00 -0500 )edit

You are a life saver. I had it set to the lowest speed 200 rpms but as i increased the speed it actually worked a lot better so at max speed, 300 rpms, it is actually creating a map and i can move it pretty vigorously in x,y,z and it keeps the map. Thank you for your help!!

23tg94 gravatar image 23tg94  ( 2016-06-22 19:35:10 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-06-22 19:36:23 -0500

23tg94 gravatar image

updated 2016-06-22 19:37:28 -0500

As per the comment from billy the speed of the lidar greatly impacts the SLAM. The solution to my issue was to just increase the speed of the lidar.

Note: I do not have enough points to accept my own answer but this was my solution

edit flag offensive delete link more


Angle change per lidar update is the key metric. You want to limit the angle change of robot per lidar update. Increasing to lidar update rate by 50% as you did has the same effect as slowing robot rotation by 33%. Glad it worked out, even though you solved it differently than I suggested.

billy gravatar image billy  ( 2016-06-22 20:56:34 -0500 )edit

I am having the same problem! I have an rplidar a1, does any of you know how change the speed and the angle change as well? Thank you

jcc@DU gravatar image jcc@DU  ( 2019-05-14 18:19:34 -0500 )edit

Question Tools


Asked: 2016-06-21 11:01:42 -0500

Seen: 1,382 times

Last updated: Jun 22 '16