CCNYRoboticsLab / phidgets_drivers

phidgets_drivers
6 stars 15 forks source link

fix IMU time lag #1

Closed mintar closed 11 years ago

mintar commented 11 years ago

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.