Should I publish transforms with future stamps to keep them "valid"?
When writing a custom transform publisher and messing with the transform timestamps, a common problem I face is that other subsystems that end up using the transform sometimes encounter the extrapolation error
Extrapolation Error: Lookup would require extrapolation into the future.
One way I brush this problem under the rug is to just publish the transform with a stamp slightly in the future to keep them valid.
This obviously looks hacky. So what is the correct way of publishing transforms such that other nodes can properly look up transforms without facing the extrapolation error?
An example is base_local_planner
throwing Extrapolation Error when looking up transform /map -> /odom
, which is a transform that I'm manually publishing. I tried publishing at various different frequencies but only changing the stamp to be slightly in the future (e.g. now + ros::Duration(0.5)) fixes the issue.