The following from Wikipedia page is used to convert Quaternion to Euler angles.
float q0 = Quaternion[0]; float q1 = Quaternion[1]; float q2 = Quaternion[2]; float q3 = Quaternion[1];
float phi = (float)Math.Atan2(2 * (q2 * q3 - q0 * q1), 2 *( q0 * q0 + q3 * q3)-1) * 180.0f/Math.PI;
float theta = -(float)Math.Asin(2 * (q1 * q3 + q0 * q2))*180.0f/Math.PI;
float psi = (float)Math.Atan2(2 * (q1 * q2 - q0 * q3), 2 * (q0 * q0 + q1 * q1)-1)*180.0f/Math.PI;
These angles have range +/-180, +/-90, +/-180 respectively. For 3D orientations, these angles depends on one another (For example, if I rotate 90 degrees or more about X or Y axes, there will be some angle about Z axes). Seems gimbal lock problem. See the following Figure for rotation about Y, X & Z axes respectively. This figure is a help from http://harinadha.wordpress.com/.
https://dl.dropboxusercontent.com/u/14046521/EulerAngles.png
Where we can see this problem during Part (a) of the figure.
I'm interested in the angle about an axis of the sensor board with respect to a fixed world coordinate axes & doesn't depends on the angle of other axis.
Is the question correct or am I simply confused in understanding these angles stuff?