Ask Your Question

tf canTransform doesn't update return

asked 2015-10-21 12:50:49 -0500

amasiero gravatar image

I have this code:

        dist.is_calibrated = listener.canTransform('/openni', '/torso_1', rospy.Time(0))
        if dist.is_calibrated:
            (trans, rot) = listener.lookupTransform('/openni', '/torso_1', rospy.Time(0))

When canTransform function returns True, it never come False again even if /torso_1 doesn't exists anymore.

Anyone knows why it happen?

Best Wishes.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-10-21 14:36:02 -0500

tfoote gravatar image

If you use Time(0) construction it asks for the "latest valid time". If you stop publishing a transform the transform still exists at the older time and tf will return it.

It is good practice to bounds check the timestamp of the returned transform if there is some expected valid range. You can see it through listener.getLatestCommonTime

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2015-10-21 12:50:49 -0500

Seen: 237 times

Last updated: Oct 21 '15