Hi, I am new to using the MPU9150 and DMP, so this may be a dumb question.
From the example code, I noticed that the initial accelerometer and gyroscope bias are obtained from calling mpu_run_self_test. Then, after multiplying the sensitivity of the sensors, the scaled biases are pushed to the DMP as illustrated below.
long gyro[3], accel[3];
result = mpu_run_self_test( gyro, accel );
if( result == 0x7 )
{
/* Test passed. We can trust the gyro data here, so let's push it down
* to the DMP. */
float sens;
unsigned short accel_sens;
mpu_get_gyro_sens( &sens );
//checkpoint
gyro[0] = ( long )( ( float )gyro[0] * sens );
gyro[1] = ( long )( ( float )gyro[1] * sens );
gyro[2] = ( long )( ( float )gyro[2] * sens );
dmp_set_gyro_bias( gyro );
}
from another thread, it was explained that the self test returns biases in G's and degrees/s (in q16 format according to API).
https://invensense.tdk.com/developers/forum/viewtopic.php?f=3&t=1073
I looked around in forum, the q16 format seems to be a fixed point 16 bit, and to convert it to a float, we do num * 2^-16 or right shift 16 places.
Is my understanding correct? If so, what is the best method for this conversion? I cannot seem to get sub degree accuracy as as soon as I right shift, the digits after the decimal point is truncated.