I'm working on integrating the ICM-20948 with the DMP running sensor fusion (to obtain absolute orientation/"9-axis" quaternions). After much work, I've been able to come up with code to enable the magnetometer and the DMP and get the quaternion output from the DMP. However, the problem that I am currently having is that the raw gyroscope data has a very large static offset, and this is getting passed through to the DMP. As a result, if I allow the DMP's algorithm to integrate the gyro data, the DMP thinks the device is constantly spinning. If I turn off the gyroscope (and only let it integrate the accelerometer and magnetometer), I get stable quaternion values.
If the gyroscope values are from -32768 to 32767, I'll see a static offset in the order of +/- 1000 to 3000 in at least one of the 3 axes. I've tried manually computing the offset and writing it to the DMP's gyro bias registers (or to the ICM-20498's gyro offset registers), but this does not seem to zero it out. So:
1. Should an offset this large be expected?
2. Should the DMP's algorithms calibrate the offset on the fly?