AMCL not publishing map->odom
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 frameid of "scan" topic and baseframeid? Am I supposed to edit my urdf to include odom? Or do I use something like robotlocalization to publish a map->odom->base_link/footprint for AMCL to use?
The output of rosrun rqt_tf_tree rqt_tf_tree
has map -> basefootprint -> baselink -> 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>
Asked by MrOCW on 2022-02-03 14:16:59 UTC
Answers
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
.
Asked by miura on 2022-02-03 17:43:29 UTC
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?
Asked by miura on 2022-02-03 17:43:43 UTC
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
Asked by MrOCW on 2022-02-03 22:27:41 UTC
AMCL requires odom to be published by another node, e.g. robot_localization, laser_scan_matcher etc.
Asked by MrOCW on 2022-02-04 01:29:44 UTC
Comments
What is publishing the map -> base_footprint transform? Also, is something publishing odometry data? AMCL requires odometry.
Asked by tryan on 2022-02-03 23:40:21 UTC
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!
Asked by MrOCW on 2022-02-04 01:28:14 UTC
Congratulations!
Asked by miura on 2022-02-04 17:35:48 UTC