On our IMU (Phidgets Spatial 1044), the time reported by the IMU often
lags behind significantly (somewhere between 3 and 90 seconds). The lag
is (more or less) constant. The reason seems to be that phidgets_imu
assumes that the zero() function resets the IMU time, but it only
resets the Gyros.
This pull request checks whether the time difference exceeds a threshold
(hard coded to 0.1 seconds here), and if yes, resets the time offset
again. During my tests, this always happens exactly once (when the first
IMU message arrives); after that, all following messages are in sync.
On our IMU (Phidgets Spatial 1044), the time reported by the IMU often lags behind significantly (somewhere between 3 and 90 seconds). The lag is (more or less) constant. The reason seems to be that
phidgets_imu
assumes that thezero()
function resets the IMU time, but it only resets the Gyros.This pull request checks whether the time difference exceeds a threshold (hard coded to 0.1 seconds here), and if yes, resets the time offset again. During my tests, this always happens exactly once (when the first IMU message arrives); after that, all following messages are in sync.