Ask Your Question

Lookup transform from tf with some flexibility

asked 2018-08-13 11:35:40 -0500

Metalzero2 gravatar image

updated 2022-01-31 08:51:55 -0500

lucasw gravatar image

Hello all,

I'm running ROS melodic on Ubuntu 18.04. I need help relative to the tf package

I have two frames in my /tf that I update with transformations for a few minutes. After a while, I want to look up one of the past transformations that I added. However, I don't want the need to declare the exact nsec but something close to it.

For example, let us say I have entrees at nsec= [912339188], [923085185] and [932359819]. Then, I want to run the following:

tf::TransformListener::waitForTransform( target_frame, source_frame, time, transform);

with time.nsec == 923085200

As you can see that is not the exact nsec as the ones in /tf but is very close to the second entree. Is there a way to get it? (I would prefer to avoid using tf2 if possible but will do it if needed)


Currently, when ever I run tf::TransformListener::canTransform(...), with the above input information, it returns false.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-08-22 07:53:22 -0500

Metalzero2 gravatar image

So I found an other question on this forum that answers my question. It can be found here:

I was not aware of the concept of "interpolation" of data points. It seems I do not need to have the exact time stamp in the tf for the transformation to be found, as long as my requested transformation is inside the buffer of the tf map.

edit flag offensive delete link more


p.s. although this question can be considered a duplicate, I would suggest not to delete it because there may be other people not familiar with the concept of interpolation.

Metalzero2 gravatar image Metalzero2  ( 2018-08-22 07:54:43 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-08-13 11:35:40 -0500

Seen: 327 times

Last updated: Aug 22 '18