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

AMCL not publishing map->odom

asked 2022-02-03 13:57:46 -0500

MrOCW gravatar image

updated 2022-02-03 15:08:16 -0500

Hi, I am trying to just localize my robot with amcl. I have a YDLidarX2L publishing to "scan" but i keep getting

No laser scan received (and thus no pose updates have been published) for 1643915311.541232 seconds. Verify that data is being published on the /scan topic.

I've read that AMCL is supposed to publish map->odom given the tf transform between frame_id of "scan" topic and base_frame_id? Am I supposed to edit my urdf to include odom? Or do I use something like robot_localization to publish a map->odom->base_link/footprint for AMCL to use?

The output of rosrun rqt_tf_tree rqt_tf_tree has map -> base_footprint -> base_link -> lidar_link But no map->odom after running AMCL

This is my launch file:

<launch>
  <!-- Arguments -->
  <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" output="screen">
    <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"/>
    <param name="use_map_topic"             value="true"/>

    <param name="odom_model_type"           value="omni-corrected"/>
    <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_alpha5"               value="0.1"/>
    <param name="odom_frame_id"             value="odom"/>
    <param name="base_frame_id"             value="base_footprint"/>
    <param name="global_frame_id"           value="map"/>
    <param name="tf_broadcast"              value="true"/>

  </node>
</launch>
edit retag flag offensive close merge delete

Comments

3

What is publishing the map -> base_footprint transform? Also, is something publishing odometry data? AMCL requires odometry.

tryan gravatar image tryan  ( 2022-02-03 22:40:21 -0500 )edit
1

ok i got it to work with laser_scan_matcher and ekf with IMU, did not know AMCL requires odom to be published before it can be used. Thanks!

MrOCW gravatar image MrOCW  ( 2022-02-04 00:28:14 -0500 )edit

Congratulations!

miura gravatar image miura  ( 2022-02-04 16:35:48 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-02-04 00:29:44 -0500

MrOCW gravatar image

AMCL requires odom to be published by another node, e.g. robot_localization, laser_scan_matcher etc.

edit flag offensive delete link more
0

answered 2022-02-03 16:43:29 -0500

miura gravatar image

Is the package you are using the following?

https://github.com/YDLIDAR/ydlidar_ros

If so, the name of the TF may not match because you have not set the frame_id yet. By default, it is laser_frame, so you need to change it to lidar_link.

edit flag offensive delete link more

Comments

I was also wondering if odom exists. The output of rosrun rqt_tf_tree rqt_tf_tree says that map->odom does not exist, but is there odom itself?

miura gravatar image miura  ( 2022-02-03 16:43:43 -0500 )edit

set the frame_id in ydlidar? I've done that as well. editted question to show the ydlidar node. no the rqt_tf_tree doesnt show any odom frame at all, its only a single tree of map -> base_footprint -> base_link -> lidar_link + other links. rostopic list doesnt show anything odom related

MrOCW gravatar image MrOCW  ( 2022-02-03 21:27:41 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-02-03 13:16:59 -0500

Seen: 805 times

Last updated: Feb 04 '22