Position, Orientation and Coordinate Transformations

To represent the relative pose (position and orientation) of one rigid body with respect to another, coordinate frames are attached to each body, and then the geometric relationship between these two coordinate frames is specified.

Position

The position of the origin of one frame with respect to another frame can be described with a translation vector (3x1):

Orientation

The orientation of one coordinate frame relative to another frame can be described with a rotation matrix (3x3):

Pose

A homogeneous transformation matrix (4x4) can simultaneously represent the position and orientation of one coordinate frame relative to another:

Roll-Pitch-Yaw

A rigid body possesses at most three rotational degrees of freedom. This means that an arbitrary rigid body orientation can be represented using only three independent quantities. One such minimal representation of orientation is the Roll-Pitch-Yaw representation, defined by Roll (), Pitch (), and Yaw () angles:

The advantages of Roll-Pitch-Yaw representation are that it requires only three values and that these values are geometrically easy to understand compared to other representations. The disadvantages are that the values are not continuous and that the final orientation depends on the order of rotations and whether the rotations are applied about moving axes (intrinsic rotations) or fixed axes (extrinsic rotations).

The Roll-Pitch-Yaw representation is common among robot vendors. However, not all assume the same convention, and understanding the convention, i.e. order of rotations and whether they are intrinsic or extrinsic, is necessary for converting Roll-Pitch-Yaw angles to other representations.

Axis-Angle / Rotation Vector

Axis-angle representation describes a rotation by a unit vector () indicating the axis of rotation direction, and an angle () describing the magnitude of rotation about the axis; four parameters in total. To minimize the number of parameters, it is common to multiply each element of the unit vector with the angle, the result of which is the rotation vector ():

The advantage of the axis-angle representation over Roll-Pitch-Yaw angles is that it is free from continuity and rotational sequence issues. However, it is hard to match between the physical orientation and the numerical values of the rotation vector. Another disadvantage is that it is impossible to apply the rotation directly on a 3D point; doing this requires conversion to a different representation.


Unit Quaternion

Unit quaternions represent a simple but robust method to encode the axis-angle representation with four parameters.

Unit quaternions are considered to be the best method of representing orientation between two coordinate frames. This is because they are more compact, more numerically stable, and more efficient than rotation matrices. Compared to Roll-Pitch-Yaw representation, unit quaternions do not suffer from gimbal lock (impossibility to uniquely represent orientation), and unlike axis-angle representation, they can be directly applied to 3D points.


Coordinate Transformations

Any coordinate transformation of a rigid body in 3D can be described with a rotation and a translation. For example, a point (or a point cloud) can be transformed from one to another coordinate frame with a rotation matrix describing the orientation between the two frames and a translation vector describing the position between the two frames:

The same can be done with a homogeneous transformation matrix describing the pose between the two frames: