Robotics StackExchange | Archived questions

tf frame_Id active all the time

Hey there,

Example:

1) publish tf with frame_id = hallo1

2) stop publishing tf with frame_id hallo1

If I do:

print listener.frameExists("hallo1")

I will always get True as result even if this frame is not published anymore. If I do

 rostopic echo /tf |grep hallo1

I will only see the result for case 1) not for case 2)

How do I check if a tf target_frame is still published using rospy?

Asked by Markus on 2019-03-07 08:26:54 UTC

Comments

Realistically, there is no concept of "still active" in TF, as there is no automatic decay of frames (RViz does something, but does it by itself).

Could you not check the stamp of the last available transform for the frame?

Asked by gvdhoorn on 2019-03-07 08:55:53 UTC

Answers

The frame id still exists but the data is older. If you care about the specific time at which a frame is available you can query for a transform between it and its parent using a timestamp of zero. This will return the latest valid transform with the timestamp associated with that value. Then you can test for how old that transform is to determine if you consider it to have been stopped publishing.

The age at which something is determined to be not publishing anymore is application and situation specific.

I don't know your use case, but I suspect that you will be better served using canTransform queries than frameExists

Asked by tfoote on 2019-03-07 12:21:23 UTC

Comments