I cannot comment on the original answer, so I had to ask like this.
I am trying to learn IMU's, accelerometers, gyros etc. for a while.
So I came across with this answer below,
https://engineering.stackexchange.com/a/22182/21263
From the accelerator sensor data, you can only calculate pitch and roll. The bellow document from Freescale explains with plenty of information what you need:
[AN3461 - Tilt Sensing Using a Three-Axis Accelerometer][1]
Based on the sayings of the document,
$$\tan \phi_{xyz} = \frac{G_{py}}{G_{pz}}$$
$$\tan \theta_{xyz} = \frac{-G_{px}}{G_{py}\sin \phi + G_{pz}\cos > \phi} = \frac{-G_{px}}{\sqrt{G_{py}^2 + G_{pz}^2}}$$
which equates to:
roll = atan2(accelerationY, accelerationZ) pitch = atan2(-accelerationX, sqrt(accelerationY*accelerationY + accelerationZ*accelerationZ))
Of course, the result is this only when the rotations are occurring on a specific order (Rxyz):
- Roll around the x-axis by angle $\phi$
- Pitch around the y-axis by angle $\theta$
- Yaw around z-axis by angle $\psi$
Depending on the rotations order, you get different equations. For the $R_{xyz}$ rotation order, you can not find the angle $\psi$ for the Yaw around z-axis.
[1]: https://cache.freescale.com/files/sensors/doc/app_note/AN3461.pdf
[2]: https://i.sstatic.net/hSXgP.png
But I don't see how the order of turn motions matters in case of getting pitch & roll from accelerometer data. Without the histoy of orders, the accelerometer will give specific outputs at specific orientations.
So what I am actually asking is whether the answer I shared is logical or not. Could you please clear the situation for me?
Thanks.
gimbal lock
$\endgroup$