hector_mapping lost localization when robot rotate

asked 2021-06-15 22:49:55 -0500

simk0024 gravatar image

updated 2021-06-16 00:45:37 -0500


My robot doesn't have odometry, so I am using SICK TIM571 for hector_mapping. And also hopefully can use the output of hector_mapping as odom for localization and navigation. Here is how my default_mapping.launch configured.

  <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="50"/>
  <arg name="scan_topic" default="scan_sick"/>
  <arg name="map_size" default="2048"/>

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

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

    <!-- Tf use -->
    <param name="use_tf_scan_transformation" value="true"/>
    <param name="use_tf_pose_start_estimate" value="false"/>
    <param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>

    <!-- 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_multi_res_levels" value="2" />

    <!-- Map update parameters -->
    <param name="update_factor_free" value="0.4"/>
    <param name="update_factor_occupied" value="0.9" />    
    <param name="map_update_distance_thresh" value="0.4"/>
    <param name="map_update_angle_thresh" value="0.06" />
    <param name="laser_z_min_value" value = "-1.0" />
    <param name="laser_z_max_value" value = "1.0" />
    <param name="laser_min_dist" value ="1.0" />
    <param name="laser_max_dist" value ="25.0" />

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

    <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)" />


The mapping is fine when robot moves along x-axis, or rotates very very slow image description

However, it went wrong when robot rotates. There latency is quite obvious (in RVIZ, the laserscan rotates later than robot) image description

Please advise if there is any configuration mistake. Is there any configuration can be done to improve the scan matching during rotation?

Thank you. :)

edit retag flag offensive close merge delete


Hi, I have the same problem with 360 degrees rotational lidars. I tried ydlidar, which is much more cheeper than yours, but have the same problem. The only way I can avoid this to happen is if I rotate very slowely and I am not doing any fast movements with my robot.

balint.tahi gravatar image balint.tahi  ( 2021-06-16 07:20:57 -0500 )edit

@balint.tahi when i mentioned slow, i mean real slow. haha. you using hector for mapping or for navigation purpose as well?

simk0024 gravatar image simk0024  ( 2021-06-17 02:23:09 -0500 )edit