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

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
0

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

Question Tools

1 follower

Stats

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

Seen: 371 times

Last updated: Oct 21 '15