Went through the explanation of quaternion rotations in here.
I try to figure out some starting assumptions and I am not sure how to approach them.
- If I have a left-hand coordinate system where rotations are made in the order: yaw (Y - up axis) -> pitch (X - right axis) -> roll (Z - forward axis) and moreover they are defined as follows:
- yaw axis is defined by the left-hand rule (counter-clockwise along the Up axis)
- pitch axis is defined by the right-hand rule (clockwise along the Right axis)
- roll axis is defined by the right-hand rule (clockwise along the Forward axis)
Does this orientation thing have effect on the signs of cosines and sines of quaternions?
- Are the order of those i, j, k related to XYZ frame or to the order of rotations? So in my case i would be for yaw (first axis) or pitch (X-axis)?
Thanks in advance!
We can write quaternions $w+xi+yj+zk$ as 4D vectors $[w,x,y,z]^T$.
Unit quaternions $q$ represent rotations (so $\lVert q\rVert_2=1$).
Every unit quaternion can be written as $$ q = \begin{bmatrix}\cos(\theta/2)\\\mathbf{v}\sin(\theta/2)\end{bmatrix},$$ where $\theta$ is the rotation angle and $\mathbf{v}\in\mathbf{R}^3$ with $\lVert\mathbf{v}\rVert_2=1$ is the rotation axis.
This means, if I understood your description correctly:
But I have to point out that in a unit quaternion $w+ix+jy+kz = [w,x,y,z]^T$ the $x,y,z$ do not directly correspond to amount pitch, yaw and roll amounts!