What causes intermittent gmapping tf cache errors? *update* [closed]

asked 2014-01-10 05:42:26 -0600

BlitherPants gravatar image

updated 2014-01-15 03:31:33 -0600

Hello,

I have a Turtlebot 2 (Kinect + Kobuki) running on ROS Groovy on Ubuntu 12.04

I am working on navigation applications but gmapping frequently crashes on me, and it's causing a lot of problems. One way to cause this error is to launch the following in order:

roslaunch turtlebot_bringup minimal.launch 
roslaunch turtlebot_navigation gmapping_demo.launch 
roslaunch turtlebot_rviz_launchers view_navigation.launch

I then go to the rviz window and drive the robot around by sending goals through the 2D navigation arrow. Eventually, the robot will halt or move slowly while gmapping spews something like the following:

*************RESAMPLE***************
Deleting Nodes: 1 2 4 5 7 16 18 21 24 28 33 39 40 44 47 48 49 51 57 60 61 66 68 69 78 Done
Deleting old particles...Done
Copying Particles and  Registering  scans... Done
update frame 5488
update ld=0.0294768 ad=1.08429
Laser Pose= 1.11996 -4.14241 0.223563
m_count 19
Average Scan Matching Score=288.294
neff= 68.2265
Registering Scans:Done
update frame 5489
update ld=0.672784 ad=1.15686
Laser Pose= 1.47247 -3.56938 1.38042
m_count 20
Average Scan Matching Score=364.078
neff= 51.4595
Registering Scans:Done
update frame 5490
update ld=1.54055 ad=0.424176
Laser Pose= 1.24882 -2.04515 1.8046
m_count 21
Average Scan Matching Score=465.802
neff= nan
Registering Scans:Done
update frame 5491
update ld=0.931361 ad=0.0987148
Laser Pose= 1.06595 -1.13192 1.70588
m_count 22
Average Scan Matching Score=474.252
neff= nan
Registering Scans:Done
update frame 5492
update ld=0.990247 ad=0.125566
Laser Pose= 1.01411 -0.143027 1.58032
m_count 23
Average Scan Matching Score=552.896
neff= nan
Registering Scans:Done
update frame 5493
update ld=1.3291 ad=0.172341
Laser Pose= 1.05892 1.18531 1.40798
m_count 24
[ERROR] [1389373592.427829667]: Extrapolation Error: Unable to lookup transform, cache is empty, when looking up transform from frame [/odom] to frame [/map]

[ERROR] [1389373592.428182780]: Global Frame: /odom Plan Frame size 86: /map

[ WARN] [1389373592.428429082]: Could not transform the global plan to the frame of the controller
[ERROR] [1389373595.427672918]: Extrapolation Error: Unable to lookup transform, cache is empty, when looking up transform from frame [/odom] to frame [/map]

[ERROR] [1389373595.427752885]: Global Frame: /odom Plan Frame size 41: /map

[ WARN] [1389373595.427821381]: Could not transform the global plan to the frame of the controller
[ERROR] [1389373595.627703860]: Extrapolation Error: Unable to lookup transform, cache is empty, when looking up transform from frame [/odom] to frame [/map]

[ERROR] [1389373595.627774520]: Global Frame: /odom Plan Frame size 4: /map

[ WARN] [1389373595.627844069]: Could not transform the global plan to the frame of the controller
[ERROR] [1389373596.227662558]: Extrapolation Error: Unable to lookup transform, cache is empty, when looking up transform from frame [/odom] to frame [/map]

[ERROR] [1389373596.227748353]: Global Frame: /odom Plan Frame size 4: /map

[ WARN] [1389373596.227823085]: Could not transform the global plan to the ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2018-05-17 18:18:02.258907

Comments

Those errors are usually due, if you have not set a right transform_tolerance in your parameter configuration files. and your transform publisher should publish at the rate of 30hz on average for the best result. run rosrun tf tf_monitor to see how often your tf are published specially odom -> base_link

hamidoudi gravatar image hamidoudi  ( 2014-01-12 14:20:56 -0600 )edit

Thanks for your suggestion. I have posted an update on my original question. Still I am confused though. If the transform was just slow, wouldn't the error message say that explicitly, instead of saying it doesn't exist?

BlitherPants gravatar image BlitherPants  ( 2014-01-13 04:29:27 -0600 )edit

I had similar problems with my tf. If you are you running your roscore on your robot and do some processing on your workspace the tfs may have some kine of delay. 1) Try to find out what timing offset you have between your workspace and the robot (sudo ntpdate). You can synchronize both computers if you have a higher timing offset (i think the command was sudo ntpdate -q). 2) increase the transform_tolerance parameter to 20 or 50. That should fix it. This allows "older" tfs being considered as valid.

dneuhold gravatar image dneuhold  ( 2014-01-13 23:31:37 -0600 )edit

Hi @dneuhold, thanks for the suggestion. Do you mean, am I running one laptop for the robot and one for the workstation? No, I have just the robot laptop. Wouldn't a transform tolerance of 20 seconds be extreme?

BlitherPants gravatar image BlitherPants  ( 2014-01-14 02:06:51 -0600 )edit

The "cache is empty" suggests that you have a connectivity issue. To confirm you are running everything on a single laptop? And your load average is not very high?

tfoote gravatar image tfoote  ( 2014-01-14 15:03:35 -0600 )edit

Yes. I have the laptop in the question body controlling my Turtlebot. That's the only computer I am using. I have tried turning off wireless but that doesn't help much. Neither does keeping wireless on and synching chrony before starting everything. What do you mean by load average?

BlitherPants gravatar image BlitherPants  ( 2014-01-14 16:07:14 -0600 )edit

It's a measure of how heavily loaded your CPU is. You can get the value from uptime or top. I suggest you try googling it to understand it better.

tfoote gravatar image tfoote  ( 2014-01-14 20:00:19 -0600 )edit

Thanks. Please see Update 2 for the answer on that (too big to post here)

BlitherPants gravatar image BlitherPants  ( 2014-01-15 03:28:44 -0600 )edit