Define q∈R4 according to
q=q1q2q3qr=[ϕsin2θcos2θ]
where ϕ is the rotational axis (unit vector) and θ∈[0,π] is the angle.
Properties:
- ∣∣q∣∣=1
- qr=211+r11+r22+r33, where the r‘s are the diagonal entries of the 3×3 rotation matrix R corresponding to q
Note that we can also write
q1q2q3=4qr1r32−r23r13−r31r21−r12
for qr=0.
Note that we can write
R=qr2+q12−q22−q322(qrq3+q1q2)2(q1q3−qrq2)2(q1q2−qrq3)qr2−q12+q22−q322(qrq1+q2q3)2(qrq2+q1q3)2(q2q3−qrq1)qr2−q12−q22+q32
ROS uses a unit quaternion which is denoted by a 4-tuple [x,y,z,w].
Example