Why does a 90° rotation about the z axis not swap pitch and roll?

222 Views Asked by At

I would like to rotate a quaternion 90° about the z axis. Using an online calculator, I found this rotation to be represented by $\frac{\sqrt 2}{2} + \frac{\sqrt 2}{2}k$. When viewing this rotation in Euler angles, it is a 90° rotation in yaw. I would therefore expect pitch to become roll and roll to become negative pitch. This can be more clearly shown using the equivalent rotation matrix $\begin{bmatrix} 0 & -1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 1 \end{bmatrix}$.

However, when performing the multiplication, this is not the behavior I observe. For instance, $0.5 + 0.5i - 0.5j + 0.5k$ has (XYZ) Euler angles $(\frac{\pi}{2},0,\frac{\pi}{2})$. Therefore, I expect the result of multiplying this quaternion by $\frac{\sqrt 2}{2} + \frac{\sqrt 2}{2}k$ on the left to have Euler angles $(0,\frac{\pi}{2},\pi)$ or something similar. Instead, we get $\frac{\sqrt 2}{2}i + \frac{\sqrt 2}{2}k$ which has Euler angles $(\pi, \frac{\pi}{2}, 0)$.

My question is, how do I represent the rotation of 90° about the z axis such that roll and pitch are swapped? I want to be able to account for a z axis disparity between measurement frame and world frame.

1

There are 1 best solutions below

0
On

I've solved it! Rotations to modify the frame of reference should actually be applied to both sides in the form $rqr^{-1}$.