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

AMCL / Hector_Slam problem

asked 2019-02-12 17:30:44 -0600

JankenGatsu gravatar image

Hello !

Actually I'm working on a SLAM robot using a Raspberry PI3B with Ubuntu Mate 16.04 et ROS Kinetic.

I started with the mapping (using Hector_Slam) and the result was pretty good.

For the localization, I use in a first time a laser_scan_matcher node to get the pose and rotation of the robot and the result was pretty good without any IMU data and ACML or EKF techniques.

But using the scan_matching I have big problems when I make big rotation with my robot and the rotation drift and my mapping is wrong.

So I search how to use AMCL to make better localisation/rotation prediction. But the result is even worse ! And I get a drift instantly when I rotate the robot.

Below you will see all my information, do you see any problems in my using of AMCL ?

Do I strictly need an IMU for get good rotations predictions ? Can I just do not use the rotation for my SLAM project and just use the pose prediction ?

Lidar ( RPLIDAR A1)

          <node name="rplidarNode"          pkg="rplidar_ros"  type="rplidarNode" output="screen">
          <param name="serial_port"         type="string" value="/dev/ttyUSB0"/>  
          <param name="serial_baudrate"     type="int"    value="115200"/>
          <param name="frame_id"            type="string" value="laser"/>
          <param name="inverted"            type="bool"   value="false"/>
          <param name="angle_compensate"    type="bool"   value="true"/>

Mapping / Localization


<arg name="trajectory_source_frame_name" default="/laser"/>
  <arg name="trajectory_update_rate" default="1"/> 
  <arg name="trajectory_publish_rate" default="1"/>
  <arg name="map_file_path" default="$(find hector_geotiff)/maps"/>
  <arg name="map_file_base_name" default="hector_slam_map"/>

  <node pkg="hector_trajectory_server" type="hector_trajectory_server" name="hector_trajectory_server" output="screen">
    <param name="target_frame_name" type="string" value="/map" />
    <param name="source_frame_name" type="string" value="$(arg trajectory_source_frame_name)" />
    <param name="trajectory_update_rate" type="double" value="$(arg trajectory_update_rate)" />
    <param name="trajectory_publish_rate" type="double" value="$(arg trajectory_publish_rate)" />
<node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="0 0 0 0 0 0 base_link laser 100" />

 <node pkg="laser_scan_matcher" type="laser_scan_matcher_node" 
    name="laser_scan_matcher_node" output="screen">

    <param name="base_frame" value="base_link"/>
    <param name="fixed_frame" value="odom"/>
    <param name="use_alpha_beta" value="false"/>
    <param name="use_odom" value="true"/>
    <param name="use_imu" value="false"/>
    <param name="max_iterations" value="4"/>
    <param name="publish_pose" value="true"/>
    <param name="publish_tf" value="true"/>


    <node pkg="hector_mapping" type="hector_mapping" name="hector_height_mapping" output="screen">
     <param name="scan_topic" value="scan" />
    <param name="base_frame" value="base_link" />
    <param name="odom_frame" value="base_link" />

    <param name="output_timing" value="false"/>
    <param name="advertise_map_service" value="true"/>
    <param name="use_tf_scan_transformation" value="false"/>
    <param name="use_tf_pose_start_estimate" value="false"/>
    <param name="pub_map_odom_transform" value="false"/>
    <param name="map_with_known_poses" value="false"/>
    <param name="pub_map_scanmatch_transform" value="false"/>

    <param name="map_pub_period" value="0.9"/>
    <param name="update_factor_free" value="0.45"/>
    <param name="laser_max_dist" value="12"/>
    <param name="map_update_distance_thresh" value="0.4"/>
    <param name="map_update_angle_thresh" value="1"/>

    <param name="map_resolution" value="0.05"/>
    <param name="map_size" value="1024"/>
    <param name="map_start_x" value="0.5"/>
    <param name="map_start_y" value="0.5"/>

    <param name="pub_odometry" value="true"/>


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

  <param name="use_map_topic " value="true"/>

  <param name="odom_model_type" value="diff"/>

  <param name="odom_alpha5" value="0 ...
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2020-01-22 23:25:34 -0600

femitof gravatar image

Hi, How did you get amcl to work? i have my hector map, but i cant wrap myh head around amcl... Please help Thanks

edit flag offensive delete link more


I finished this project a long time ago but if I remember well, I stopped to use amcl because its too bad performances with hector.

At the end, I combined Hector_SLAM with a "laser scan matcher" node : ->

With these two, I got sufficient results ! That was not bad at all !

Warning : with this method, it is more than possible that you get very bad results if your system make too many high speed rotations so be smooth !

Have fun !

JankenGatsu gravatar image JankenGatsu  ( 2020-01-23 01:04:17 -0600 )edit

Thanks for your response.. How did you sue the Laser scan matcher with your already created map? Do you still have your launch files? If yes, please share...Thanks

femitof gravatar image femitof  ( 2020-01-23 01:50:56 -0600 )edit

answered 2019-02-12 20:21:40 -0600

jordan gravatar image

By 'big rotation'... Does it work OK with rotations having a low angular velocity? ie. does the problem only appear when the robot turns quickly? If yes, then the problem might be the scan match failing due to exceeding the angular search range. You may need to limit the angular velocity of the robot, or perhaps get a faster LiDAR. If anyone knows how to expand the scan matching to tolerate larger rotations between scans (at the cost of CPU load?) in hector... that might be interesting too.

edit flag offensive delete link more


Yeah I suppose that my LIDAR is maybe too slow. Perhaps by reducing the angular velocity of the robot can resolve the problem.

I just tried to rotate slowly and whitout ACML i got good results, not perfect but still ok.

Strangely when I use ACML all goes mad when I move the robot.

JankenGatsu gravatar image JankenGatsu  ( 2019-02-13 07:16:21 -0600 )edit

Question Tools

1 follower


Asked: 2019-02-12 17:30:44 -0600

Seen: 1,458 times

Last updated: Jan 22 '20