ros2 tf2 get latest transform not working as expected
I am using tf2::canTransform() and tf2::lookupTransform() with time set to TimePointZero. My understanding was that these calls would return the latest available transform i.e canTransform() would return true if there was any available transform and lookupTransform() would return the latest available transform.
In my application, I am publishing the transform periodically at a fairly high rate. Another node subscribes to this transform but occasionally canTransform() and/or lookupTransform() fails especially when there are occasional processor load spikes on the ros machine. I would have expected that once a transform has been published, canTransform() and lookupTransform() should never fail if you are asking for the latest available transform using TimePointZero. Maybe I am misunderstanding what it means by latest available transform.