Quaternion-based State Estimation giving wrong values when pitch approaches 90 degrees (STM32 project in C)
I had a problem concerning state estimation with quaternions, specifically with the practical application with an actual IMU. In my simulation in Matlab, my state estimation model worked fine (I used the angle-axis method to update the quaternion), however, when I actually hook up an IMU, I get problems when pitch approaches 90 degrees. Suddenly roll and yaw get crazy big values. Upon further investigation on the quaternion when pitch is 90 degrees, I found something interesting, which I don’t know how to solve:
For example, if I take one of the quaternions I get when pitching with 90 degrees, put it into matlab to figure out whether the angles given are right, this is what I receive (angles in rad/s):