Hey guys,

I am getting some really large values:

flag=0, yaw=1113416067, pitch=-1037714598, roll=1113299994

flag=0, yaw=1113416553, pitch=-1037714800, roll=1113299207

flag=0, yaw=1113416335, pitch=-1037714964, roll=1113299377

flag=0, yaw=1113416579, pitch=-1037715221, roll=1113298567

flag=0, yaw=1113416122, pitch=-1037715394, roll=1113299198

flag=0, yaw=1113415981, pitch=-1037715258, roll=1113299644

flag=0, yaw=1113415786, pitch=-1037715344, roll=1113299659

But I can see they change according to the angles, and go back to the original value when they return to original position. What's wrong here, can anyone point me a direction? Thanks

Edit #1:

I was using long to store the output and it should be float. Now I need to figure out how to fix the drifting.

Edit #2:

Not just the problem with drifting. Values from three axis change at the same time from ypr[].

When the IMU is rotating around z axis, yaw, roll, pitch change at the same time like from 0 to 180. It's yaw for gyro that changes.

When the IMU is rotating around x axis, only roll changes as it's supposed to like from 0 to 90, and yaw and pitch goes +- 3 degrees. gyro pitch changes.

When the IMU is rotating around y axis and yaw changes from 0 to 90, pitch change by 30 and roll change by 50 degrees. For gyro[], it's pitch that changes.

What is wrong here?

Edit #3:

I found I was using DMP_FEATURE_LP_QUAT which should be DMP_FEATURE_6X_LP_QUAT. I guess the quaternion formula is for 6X mode only.

Edit #4:

Weird I am testing out the angles, when the IMU is rotated around the y axis in one way for 90 degrees, it gets about 90 degrees, but when it's rotated in the other direction for 90 degrees, it gets only to 60. Does anyone get this?