Robotics

Quaternion

Definition

A quaternion is a four-component mathematical object consisting of a scalar and a three-component vector. Robotics commonly uses unit quaternions to represent three-dimensional rotations without the coordinate singularities of Euler angles.

Also known as: Quaternions

Updated

Four components describe a rotation

A rotation quaternion has one scalar component and three vector components. Its four values satisfy a unit-length constraint, so they represent three rotational degrees of freedom, not four independent angles.

The SciPy rotation documentation defines the scalar using the cosine of half the rotation angle and the vector using the rotation axis scaled by the sine of half that angle. Opposite-sign unit quaternions represent the same rotation, a property called a double cover.

Check the component convention

Some interfaces place the scalar first, giving w, x, y, z. Others place it last, giving x, y, z, w. SciPy supports both and defaults to scalar last. A four-number array without its ordering and frame convention is therefore ambiguous.

Normalization also matters: an arbitrary four-component quaternion is not automatically a unit rotation quaternion.

Avoiding angle-coordinate singularities

MIT's manipulation notes explain how Euler angles become singular at particular orientations. Unit quaternions avoid that representation problem and can be converted to rotation matrices.

They do not remove a robot's kinematic singularities, which arise from the mechanism's motion capability rather than the chosen orientation coordinates.

Sources