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

TF get the time of last transform

asked 2023-03-08 04:02:54 -0500

labude gravatar image

Hello! I want to check if the tf2_ros::Buffer received a valid transform from A to B in the last x seconds (to throw an error in case of time out). So something like buffer.canTransform(A, B, ros::Time(0)) with an additional argument for how far in the past the transform can be.

Is there a way to get the timestamp of the last available transform so that I can compare it to the current time? This sounds like a pretty common use case to me, but I could not find anything suitable.

Thanks a lot!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-03-08 10:34:59 -0500

tfoote gravatar image

To achieve your query, you can do a lookupTransform and then check the resultant (latest) transform's timestamp is in your query window.

edit flag offensive delete link more

Comments

That's a good idea, thanks.

labude gravatar image labude  ( 2023-03-11 05:53:19 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2023-03-08 04:02:54 -0500

Seen: 242 times

Last updated: Mar 08 '23