quat2euler¶

Quaternion to Euler angles transformation.

Transforms a normalised quaternion $$\chi\longrightarrow[\phi, \theta, \psi]$$ to roll, pitch and yaw angles respectively.

The transformation is valid away from the singularity present at:

$\Delta = \frac{1}{2}$

where $$\Delta = q_0 q_2 - q_1 q_3$$.

The transformation is carried out as follows:

$\begin{split}\psi &= \arctan{\left(2\frac{q_0q_3+q_1q_2}{1-2(q_2^2+q_3^2)}\right)} \\ \theta &= \arcsin(2\Delta) \\ \phi &= \arctan\left(2\frac{q_0q_1 + q_2q_3}{1-2(q_1^2+q_2^2)}\right)\end{split}$
param quat

Normalised quaternion.

type quat

np.ndarray

returns

Array containing the Euler angles $$[\phi, \theta, \psi]$$ for roll, pitch and yaw, respectively.

rtype

np.ndarray

References

Blanco, J.L. - A tutorial on SE(3) transformation parameterizations and on-manifold optimization. Technical Report 012010. ETS Ingenieria Informatica. Universidad de Malaga. 2013.