MotionFX "nan" values after a while on Discovery kit IoT node
Hi,
I'm testing the MotionFX library with the Discovery Kit IoT node [B-L4S5I-IOT01-A] and I have a problem: randomly the sensor fusion algorithm "explodes" and I can only get only "nan" values for all the `MFX_MagCal_output_t` values, Gyro Biases included.
What can be the cause of this behavior?
Following my initialization code:
int32_t initMotionFX()
{
char lib_version[MFX_STR_LENG];
MFX_knobs_t iKnobs;
/* Sensor Fusion API initialization function */
MotionFX_initialize();
MotionFX_GetLibVersion(lib_version);
MotionFX_getKnobs(&iKnobs);
iKnobs.LMode = 1;
iKnobs.gyro_orientation[0] = 'n';
iKnobs.gyro_orientation[1] = 'w';
iKnobs.gyro_orientation[2] = 'u';
iKnobs.acc_orientation[0] = 'n';
iKnobs.acc_orientation[1] = 'w';
iKnobs.acc_orientation[2] = 'u';
// Note: the magnetometer is rotated by 180° respect to the IMU
iKnobs.mag_orientation[0] = 's';
iKnobs.mag_orientation[1] = 'e';
iKnobs.mag_orientation[2] = 'u';
MotionFX_setKnobs(&iKnobs);
// ----> Experimental init bias value
// Note: to be replaced by flash memory reading
init_gyro_calib[0] = 0.08;
init_gyro_calib[1] = 0.02;
init_gyro_calib[2] = 1.02;
MotionFX_setGbias(init_gyro_calib);
// <---- Experimental init bias value
MotionFX_enable_6X(MFX_ENGINE_ENABLE);
MotionFX_enable_9X(MFX_ENGINE_ENABLE);
return 0;
}