ROS Navigation Rosject Real Robot Error: Timed out waiting for transform

Hi,

I am working on the Real Robot TurtleBot for ROS Navigation in 5 Days Rosject.

Whenever I launch my launch file containing map_server, amcl and move_base together, I keep getting the following error immediately after launching (does not happen with slam_gmapping though):

[ WARN] [1673619570.564902809]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.100365 timeout was 0.1.
[ WARN] [1673619575.652131796]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.100419 timeout was 0.1.
[ WARN] [1673619580.699807134]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.101927 timeout was 0.1.
[ WARN] [1673619585.747455295]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.100347 timeout was 0.1.
[ WARN] [1673619590.791715059]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.103067 timeout was 0.1.
[ WARN] [1673619595.838631137]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.100061 timeout was 0.1.

I have checked each and every parameter that I am using in my packages, and to my best knowledge, I do not have any parameter with 10.0 as frequency (0.1 = 10.0 Hz).

I also checked almost all the issues on this forum with the same problem and the most common solution was: Change Fixed Frame from “base_link” to “map” in Rviz, but in my case, it is already on “map”.

The good thing is that, my program and packages work as expected.
**But,**
The laser scan takes quite some time to load after all the above error messages but it still fails with the following error message:

[ERROR] [1673619569.927966766]: Couldn't determine robot's pose associated with laser scan.

My map_server, amcl and move_base nodes were running, got that info from rosnode list.

I also have a service that will automatically localize the robot when called. I specifically created this service to NOT PERFORM 2D POSE ESTIMATE on Rviz. But the problem is, if I don’t do the 2D Pose Estimate on Rviz, the error continues forever and ever and ever… does not stop!

My question:
How can I get rid of this warning? It is really annoying me.
(Or I might have not understood something, in this case please clarify why this happens.)

Thanks,
Girish

Hi Girish,

I would first separate move_base from your debugging because this is for sure an amcl problem.

I think the reason that TF timeout is happening is because amcl is unable to make the connection between the map frame which is published by it and the odom frame of your robot. Maybe change the base_footprint and check? Because I think it should be map->odom->base_footprint.

Do you launch the localization at times where you don’t know where the robot is? Because you can set the initial position directly in your config, since you know where it is (usually where it gets spawned at first).

What does your localizing service does specifically that is different from setting an initial position?

Finally, it makes sense that the error happens before setting the pose estimate, so I think setting an initial pose in your config would also solve the second error.

Hi @roalgoal ,

Thanks for the reply.

No. I know where the robot is (although not exactly, but roughly) when I launch my localization.

Currently, I have set it to x=0.0, y=0.0, z=0.0, only because I am localizing it later, so it does not matter where it starts. Consider the real robot, I can never know where the robot is beforehand, therefore implying the same situation to the simulation also.

My simulation works clean and perfect, by the way. I get this issue only with real robot.

It calls /global_localization, gets pose from /odom (5 secs average) and sends it to /initialpose.
This service works perfectly on simulation and on real robot. But my problem happens before doing this service call only on the real robot.

I already have set initial position as 0,0,0 as mentioned before.

Thanks,
Girish