Rotation and Homogeneous Transformation
Last updated
Last updated
In this document, we will focus on rotation. We assume the reader is familiar with basic linear algebra.
Rotations and homogeneous transformations are key in robotic control. They are mathematical tools that represent rigid-body motion. In this document, we focus on different representations of rotation.
Most of the content of this document is based on the following three books:
It's important we have an intuitive notations in formula when we study robotics. In robotics, we need to deal with many different frames and coordinate systems and it's critical that we know unambiguously which frames we are working with. In this document, we adapt the notations from the book and .
There are many representations of rotations. The most common ones are the following:
rotation matrices
Euler and Cardan angles representation
rotation axis and angle
exponential coordinates
unit quaternions
In this section we will briefly go through each one of them.
The rotation matrices representation is a direct application of the change of basis. Columns in a rotation matrix represents the coordinates of bases of the transformed frame in the base frame. It has the following properties:
In this case, the rotation is around the z-axis and the rotation matrix takes the following form
There are two interpretations/views of rotation. As we mentioned earlier, the rotation matrix represents the change of basis. It relates the coordinates of the same point in two differnet frames.
The second view of the rotation matrix is that it applies the rotation transformation on an object. In this view, the coordinates are all in the same frames (i.e. the original frame) and no other frames are involved. The effect is that it transforms the coordinates of the blue dot in the black frame in the figure below to the coordinates of the red dot in the black frame. (The orange frame is the frame after the rotation as it's rigidly related to the dot. However it's not involved in the formula)
Euler's rotation theorem:
Any two independent orthonormal coordinate frames can be related by a sequence of rotations (not more than three) about coordinate axes, where no two successive rotations may be about the same axis (Kuipers 1999)
According to the Euler's theorem, a rotation between any coordinate frames can be constructed by a sequence of rotation about a particular axis. During the process of constructing the intermediate rotations, new coordinate frames are created and the next rotation is about one of the axis in the current frame (not the original one). More specifically, suppose the original frame is denoted by and the consecutive rotations are denoted by , , and . We use to denote the final frame and we have the transformation sequence below:
Because the rotation is about an axis in the current frame, we can simply compose the transformation:
The bottom line is that when we use the three-angle representation of rotations, we need to
Remember the rotation axis is in the "current" or "latest" intermediate frame.
Simply compose the rotation following the order.
Example: Roll-pitch-yaw with ZYX sequence
Remember that the composition order is simply the order of the rotation sequence. In this example, the rotation sequence is , , and . Therefore, the overall rotation is:
A rotation can be viewed as the result of the object being subject to a constant angular velocity during the unit of time (i.e. 1 second). Suppose the rotation axis is given by the unit vector , the angular velocity can be represented by
We also have the formula of the velocity of a point subject to the angular velocity:
TODO: this is a bit complicated. It's related to the twist concetp.
The most natural way to describe a rotation is to specify the rotation axis and the rotation angle.
The relationship between the axis-angle pair and the rotation matrix is established by the Rodrigues' rotation formula:
where is the rotation angle, is the unit vector that represents the rotation axis. is a skew-symmetric matrix constructed from the rotation axis vector.
This formula has a variation:
where and .
We can also recover the the rotation axis vector and the rotation angle from the rotation matrix. The rotation axis vector is the eigen vector with eigen value equals to 1. Note that a rotation matrix always has a real eigenvalue 1 because vectors on the rotation axis will not be changed by the rotation. The other two eigenvalues are where is the rotation angle.
and a rotation with axis and angle can be represented by a unit quaternion:
We can apply the following operations to a quaternion:
In the book , the author mentions that Euler angles is an ambiguous term. What's more confusing is that the rotation sequence depends on the context. For example, when we say roll-pitch-yaw angle, it could mean either XYZ or ZYX rotation.
Quaternions is frequently used in ROS. For information about quaternion in ROS, you can refer to the article .
We adopt the notation in the book and represent a quaternion using the following form: