[ros-users] Flushing / resetting the TF buffer

Tully Foote tfoote at willowgarage.com
Thu Mar 4 08:06:19 UTC 2010

There are many parts of the system which are not robust to backwards jumps
in time.  tf is one of the most visible ones.  A common pattern for us is to
have the processing in a launch file which is designed to setup the system
to be ready for bag file playback.  And once it's up playback the bag file.
to restart we just relaunch the launch script and playback the bag again.

Can you provide a little more insight into what processes you're running,
how your workflow goes when repeatedly playing a bag file, and how you're
detecting the jumpy results?

I'm not sure which process in which you are seeing the jumpy results in, but
if you just restart that node it will clear the tf data for that node.  tf
is an entirely distributed system.  All data is stored locally in each

Also, tf only keeps a 10 second buffer, which means that if you go back more
than 10 seconds in time to the beginning of your bag file, all incoming tf
data will be discarded as too old.  Which would suggest tf would fail to


On Wed, Mar 3, 2010 at 10:09 AM, Josh Faust <jfaust at willowgarage.com> wrote:

> If you're looking to do it programmatically there's a clear() call on
> tf::Transformer:
> http://www.ros.org/doc/api/tf/html/c++/classtf_1_1Transformer.html#7362fc77d997e2b4bf93927309bcbcd1
> Josh
> On Wed, Mar 3, 2010 at 7:33 AM, Armin Hornung <
> HornungA at informatik.uni-freiburg.de> wrote:
>> Hi!
>> Is there a way to flush or reset the TF buffer, i.e. clearing all
>> transformations currently stored?
>> A little background: I am using a method similar to the one in the
>> "amcl" node to overcome the limitations from the tree-structure of TF.
>> The robot model and all transformations to joints and sensors are in an
>> "odom" frame, so when running localization I publish a transformation of
>> the odometry frame in the map frame that results in the robot's
>> base_frame ending up in the localized pose. To avoid timeouts I use the
>> hack / workaround from the "amcl"-node and publish the tf to "odom" a
>> little in the future. Now, when localizing from bag files (all times are
>> with respect to the originally recorded data) it seems like coordinate
>> frames are jumping back and forth sometimes, which I think results from
>> TFs still being in the buffer from a previous run (through the same or a
>> different log file). When there is a way of clearing the TF buffer, that
>> would help when being called at the start of localization, without the
>> need of restarting roscore.
>> Cheers,
>> Armin
>> --
>> Armin Hornung                              Albert-Ludwigs-Universität
>> www.informatik.uni-freiburg.de/~hornunga<http://www.informatik.uni-freiburg.de/%7Ehornunga>  Dept. of Computer Science
>> HornungA at informatik.uni-freiburg.de        Humanoid Robots Lab
>> Tel.: +49 (0)761-203-8010                  Georges-Köhler-Allee 79
>> Fax : +49 (0)761-203-8007                  D-79110 Freiburg, Germany
>> _______________________________________________
>> ros-users mailing list
>> ros-users at code.ros.org
>> https://code.ros.org/mailman/listinfo/ros-users
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users

Tully Foote
Systems Engineer
Willow Garage, Inc.
tfoote at willowgarage.com
(650) 475-2827
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100304/6042eb3d/attachment-0004.html>

More information about the ros-users mailing list