I’m currently working on a project using ROS and have encountered an issue with the tf tree and some warnings in the terminal
I replaced the map file with a custom file and started amcl, but a map frame does not appear in the tf tree and the map → odom conversion does not work.
In the tf tree, odom → base → trunk → laser & other joints are connected, and when you odom a fixed frame on rviz, you can check the scan topic, but it is not visible when you use it as a map.
(It seems to be a natural phenomenon because there is no map frame and there is no connection.)
Should I use static_transform_publisher to convert map->odom?
The error message is as follows:
[ WARN] [1714043627.072286182]: Timed out waiting for transform from base to map to become available before running costmap, tf error: canTransform: target_frame map does not exist… canTransform returned after 0.100264 timeout was 0.1.
[ WARN] [1714043631.952119372]: No laser scan received (and thus no pose updates have been published) for 1714043631.952039 seconds. Verify that data is being published on the /scan topic.
I’ve used the office.yaml map file generated by Hector SLAM.
Could you advise what might be causing these issues and how to resolve them? Any insights or suggestions would be greatly appreciated!
Could you please list the ros packages that you are running as well as the commands, as it is difficult to distinguish what is going on.
On a glance I think there are two issues you are facing. The first is that the parameter for AMCL of scan topic is incorrect. Please check the launch file and correct the configuration of the laserscan topic.
To find out the topic name do rostopic list and find out the topic name. It might be something like /go1/scan. Copy this into the AMCL launch file and/or where its configuration file is.
The second thing is that the map frame usually either comes from a custom node from GPS, SLAM, or a localization module such as AMCL.
I am assuming you running the default AMCL. When you run the AMCL, ensure that in its configuration file it has all the correct parameters especially the link names such as odom and base_link as well as the laserscan topic.
The next step to remember is that with algorithms such as AMCL you have to give the initial position via the 2D pose estimate in RVIZ. Without this there will be no transformations. To do this ensure AMCL, the robot driver, laserscan, and RVIZ is running.
Ensure the global frame is map (very important)
Select the 2D pose estimate arrow on the middle top of the screen
Add map topic to RVIZ
Click and drag the arrow on the estimated position of the robot on the map
The robot should teleport in RVIZ to that point and it should now be localizaed.