I am trying to calculate the odometry from the IMU data with the robot localization package, but I am stuck with the covariance/variance matrix in the IMU msg. Is this some data declared in the HEBI datasheet, relative to the sensors or should I determine the matrix somehow? If it's declared in the datasheet can you redirect me to it ?
Thanks for the question. We have received this question a few times in the past. Sorry in advance for the long response.
Odometry from IMUs:
Obtaining position estimates from IMUs is really tough to do in practice. The IMUs we use (either the MPU-6500 or the ICM-20602 from TDK) do not have the precision, accuracy, and calibration you would need to make this work well. At best, any odometry estimate will work for only a few seconds.
The reason behind this is that you need to separate out a large gravitational acceleration from a small linear acceleration (which with the IMU alone is not observable), and then double-integrate this noisy signal to obtain a position reading. Most of the work in robotics research literature that we have seen attempting this uses IMUs fused with additional sensors like joint angles / wheel odometry to help detect, slip, etc. IMUs are a key part of AR/VR systems but they're always paired with external tracking from vision / LiDAR / etc.
Covariance / State Estimation:
If you're referring the quaternion pose estimate that gets reported in actuator feedback, we unfortunately do not have good estimates for covariance. The onboard pose estimator in the actuators is a simplified complementary filter, not a full Kalman filter. This means that the filter does not produce, or is tuned with, an estimated covariance for orientation, linear acceleration, or other model parameters. However, the complementary filter still performs well because it runs at a very high rate, 1kHz in the actuator’s real-time control loop.
That said there are other things that can be done with IMUs, especially fused with other sensors, and sometimes making as accurate a model as possible is useful. The raw sensors themselves do have measurable Gaussian-ish noise that can be characterized. We have generally found the following:
- Gyros (X/Y/Z) have a standard deviation of about 0.001 rad/sec
- Accelerometers (X/Y/Z) have a standard deviation of about 0.015 m/sec
The IMU performance can vary somewhat actuator to actuator, so if you want the most accurate estimate of uncertainty we recommend characterizing each actuator. This can done by taking and analyzing a short ~10 sec log (you can use Scope) while the actuators or assembled system are perfectly still. It helps to have things on the floor if possible, as even sturdy tables can wobble enough to influence the accelerometer readings.
Hope this helps,