10-06-2016, 05:02 PM

Hi All--

I've been experimenting with the MPU6050. I've gotten the MPUTeapot demo to work using Jeff Rowberg's libraries. I am wondering why the formula used for phi in the B-Robot code, calculated from the MPU6050's dmp quaternion values:

return (atan2(2 * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z) * RAD2GRAD);

produces different results than the phi produced by the MPU6050's dmp:

mpu.dmpGetEuler(euler, &q);

Aren't these calculated straight from the quaternion values as well? Any thoughts would be appreciated.

I've been experimenting with the MPU6050. I've gotten the MPUTeapot demo to work using Jeff Rowberg's libraries. I am wondering why the formula used for phi in the B-Robot code, calculated from the MPU6050's dmp quaternion values:

return (atan2(2 * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z) * RAD2GRAD);

produces different results than the phi produced by the MPU6050's dmp:

mpu.dmpGetEuler(euler, &q);

Aren't these calculated straight from the quaternion values as well? Any thoughts would be appreciated.