I came to a situation on getting Tibia angles from an IMU. The sensor is giving me quaternions and also Euler Angles (order XYZ). I need to know based on a reference plane, the Z angle on plane XZ (Directing z up)
My protocol is to get the person standing and get a calibrated quaternion from that position and then when the person walks I still need to know that angle based like if the sensor was still positioning that plane.
I came into an interesting paper that explains exactly my problem and application on equation 6.
For my understanding, I need to get a DCM matrix out of each measurement quaternion and then apply the directional unit vector from euler angles during calibration and apply to that matrix, then apply atan of division of component X and Z of the result of that multiplication.
Based on that my steps are:
1 - Get calibrated quaternion Q1 and calculate directional vector of my Euler angles. 2 - As the sensor measures, I take the Directional Cosine Matrix of Q1 apply to the calibrated direction vector my coordinate transformation 3 - calculate the Atan of components X and Z of that directional vector on sensor coordinate system.
However, I am getting different results and I am not understanding what is that equation really doing.