localization using just an rplidar

asked 2021-04-05 03:30:46 -0600

saief gravatar image

updated 2021-04-05 08:40:35 -0600

tryan gravatar image

Hello everyone, I'm trying to localize my RpLidar within a map i already have using Amcl and laser_scan_matcher but nothing is working so far. Rviz is not showing the red particles. When running the laser_scan matcher it shows this warning " Error in scan matching" and when running amcl using "rosrun amcl amcl scan:=scan" it shows this warning(Warning: TF_OLD_DATA ignoring data from the past for frame base_link at time 0 according to authority unknown_publisher). (Am not sure yet if i should use (rosrun amcl amcl scan:=scan) for localization or an Amcl launch file ( my amcl launch file shows no warnings).

these are my launch files "AMCL"


  <!-- Arguments -->
  <arg name="scan_topic"     default="scan"/>
  <arg name="initial_pose_x" default="0.0"/>
  <arg name="initial_pose_y" default="0.0"/>
  <arg name="initial_pose_a" default="0.0"/>

  <!-- AMCL -->
  <node pkg="amcl" type="amcl" name="amcl">

    <!-- <param name="min_particles"             value="500"/>
    <param name="max_particles"             value="3000"/>
    <param name="kld_err"                   value="0.02"/>
    <param name="update_min_d"              value="0.20"/>
    <param name="update_min_a"              value="0.20"/>
    <param name="resample_interval"         value="1"/>
    <param name="transform_tolerance"       value="0.5"/>
    <param name="recovery_alpha_slow"       value="0.00"/>
    <param name="recovery_alpha_fast"       value="0.00"/>
    <param name="initial_pose_x"            value="$(arg initial_pose_x)"/>
    <param name="initial_pose_y"            value="$(arg initial_pose_y)"/>
    <param name="initial_pose_a"            value="$(arg initial_pose_a)"/>
    <param name="gui_publish_rate"          value="50.0"/>
    <remap from="scan"                      to="$(arg scan_topic)"/>
    <param name="laser_max_range"           value="3.5"/>
    <param name="laser_max_beams"           value="180"/>
    <param name="laser_z_hit"               value="0.5"/>
    <param name="laser_z_short"             value="0.05"/>
    <param name="laser_z_max"               value="0.05"/>
    <param name="laser_z_rand"              value="0.5"/>
    <param name="laser_sigma_hit"           value="0.2"/>
    <param name="laser_lambda_short"        value="0.1"/>
    <param name="laser_likelihood_max_dist" value="2.0"/>
    <param name="laser_model_type"          value="likelihood_field"/>
    <param name="odom_model_type"           value="diff"/>
    <param name="odom_alpha1"               value="0.1"/>
    <param name="odom_alpha2"               value="0.1"/>
    <param name="odom_alpha3"               value="0.1"/>
    <param name="odom_alpha4"               value="0.1"/>
    <param name="odom_frame_id"             value="odom"/>
    <param name="base_frame_id"             value="base_footprint"/> -->



  <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="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 100" />

i would really appreciate it if anyone helps me

edit retag flag offensive close merge delete


Did you find a solution to this? I am in a very similar situation too.

androadi gravatar image androadi  ( 2022-01-08 05:20:07 -0600 )edit