You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 31, 2025. It is now read-only.
We noticed that the transforms return from tf/tf2 occasionally contain NaN values in the translation part. Some debugging revealed that this is caused by the interpolation logic of the time cache. The bug is hidden here:
tf2Scalar ratio = (time.toSec() - one.stamp_.toSec()) / (two.stamp_.toSec() - one.stamp_.toSec());
The equality check compares the timestamps based on sec/nsec integers, however the ratio converts them to double. In our case the two timestamps are only a few nanoseconds apart, and the resolution after the toSec() conversion is not enough. Thus there is a division by zero and the interpolation returns meaningless results due to ratio being NaN.
I will open a PR with the most obvious fix: Checking that the toSec() difference is non-zero instead of the stamp equality check.