ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

how to access old transforms tf

asked 2011-06-27 07:23:03 -0500

phil0stine gravatar image

Let's say I have an algorithm that takes timestamped data and processes it, with the processing taking > 10 seconds. Not exactly blazing fast, I know, but for arguments sake let's say the code is well written and optimized :)

If the tf buffer is only set to 10 seconds, then publishing or listening to tf with the original timestamp will fail.

Is there a way to control the size of the tf buffer, or is tf not the tool for applying transforms in this case?

Has anybody else ran into this issue? I would not be surprised if this came up for the UCB clothes folding app.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
9

answered 2011-06-27 07:29:08 -0500

Eric Perko gravatar image

You can indeed control the size of the tf buffer that your code uses. When creating the TransformListener, you can pass in a ros::Duration object that sets the length of the transform cache. See the TransformListener constructor docs for more info and the specific ordering of arguments and such.

This is assuming you are using the cpp version of the tf library. If you are using Python, feel free to examine the Code API for the Python version, as there is likely an analogous constructor for Python.

edit flag offensive delete link more

Comments

Thanks! This will help, although it reinforces the fact that I don't really understand how tf works. I would have guessed that there was a global cache that tf would use for all nodes in the environment, but actually each node stores its own tf cache?
phil0stine gravatar image phil0stine  ( 2011-06-27 08:39:38 -0500 )edit
Nope, no global cache. Each TransformListener instance maintains its own cache. It fills that by simply listening to the /tf topic.
Eric Perko gravatar image Eric Perko  ( 2011-06-27 08:53:53 -0500 )edit

Thanks tom temple!!!

zkytony gravatar image zkytony  ( 2016-09-13 11:11:51 -0500 )edit
4

answered 2012-08-21 08:17:53 -0500

tom temple gravatar image

updated 2018-08-04 18:58:06 -0500

130s gravatar image

The python API is very thoroughly buried so I'll post it here to save the next guy some time. TransformListener.__init__ takes two positional arguments. The first is boolean, whether to interpolate, and the second is length of the transform cache (rospy.Duration)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-06-27 07:23:03 -0500

Seen: 6,529 times

Last updated: Aug 04 '18