Basic Kinematics#
The pose of a rigid body in 3D space is represented by its position and orientation with respect to a reference frame. As shown in Fig. 18, let \(O-xyz\) be the reference frame and \(\{\boldsymbol{x}, \boldsymbol{y}, \boldsymbol{z}\}\) be the unit vectors of the frame axes. To represent the pose of the rigid body, we pick a fixed point \(O^\prime\) on the rigid body, and attach an body frame \(O^{\prime}-x^{\prime} y^{\prime} z^{\prime}\) to the body, with origin in \(O^{\prime}\) and \(\{\boldsymbol{x}^{\prime}, \boldsymbol{y}^{\prime}, \boldsymbol{z}^{\prime}\}\) being the unit vectors.
To describe the position of the rigid body, define a position vector \(\boldsymbol{o}^{\prime}\) pointing from the reference frame origin \(O\) to the body frame origin \(O'\). We express \(\boldsymbol{o}^{\prime}\) in terms of \(\{\boldsymbol{x}, \boldsymbol{y}, \boldsymbol{z}\}\) of reference frame:
where \(o_{x}^{\prime}, o_{y}^{\prime}, o_{z}^{\prime}\), called the coordinates of the vector \(\boldsymbol{o}^{\prime}\), are projections of \(\boldsymbol{o}^{\prime}\) in \(\{\boldsymbol{x}, \boldsymbol{y}, \boldsymbol{z}\}\).
To describe the orientation of the rigid body, we find the coordinates of each unit axis \(\{\boldsymbol{x}^{\prime}, \boldsymbol{y}^{\prime}, \boldsymbol{z}^{\prime}\}\) of the body frame, in the reference frame:
We write the above into the following compact notation:
with each column being the coordinates of each unit vector \(\{\boldsymbol{x}^{\prime}, \boldsymbol{y}^{\prime}, \boldsymbol{z}^{\prime}\}\).
Important
The above \(\boldsymbol{R}\) is called rotation matrix. Some properties of Rotation Matrix:
Mutual orthogonality: \(\boldsymbol{x}^{\prime T} \boldsymbol{y}^{\prime}=0\), \(\boldsymbol{y}^{\prime T} \boldsymbol{z}^{\prime}=0\), and \(\boldsymbol{z}^{\prime T} \boldsymbol{x}^{\prime}=0\)
Unity: \(\boldsymbol{x}^{\prime T} \boldsymbol{x}^{\prime}=1\), \(\boldsymbol{y}^{\prime T} \boldsymbol{y}^{\prime}=1\), and \(\boldsymbol{z}^{\prime T} \boldsymbol{z}^{\prime}=1\)
Orthogonal matrix: \(\boldsymbol{R}^{T} \boldsymbol{R}=\boldsymbol{I}_{3} \quad \rightarrow \quad \boldsymbol{R}^{T}=\boldsymbol{R}^{-1}\)
The determinant of \(\boldsymbol{R}\): \(|\det \boldsymbol{R}|=1\)
Elementary Rotations#
Consider the origin of the body frame coincides with the origin of the reference frame. The orientation of a body frame can be obtained by the rotating the reference frame about its axes. Below, we consider right-handed rotation convention: rotations are positive if counter-clockwise about a axis.
As shown in Fig. 19, suppose the body frame \(O- x^{\prime} y^{\prime} z^{\prime}\) is a result of rotating a reference frame \(O- x y z\) by an angle \(\alpha\) about the axis \(\boldsymbol{z}\). Then, the rotation matrix of \(O- x^{\prime} y^{\prime} z^{\prime}\) is
Similarly, the rotation matrix for an angle \(\beta\) about axis \(\boldsymbol{y}\) is
and the rotation matrix for an angle \(\gamma\) about axis \(\boldsymbol{x}\) is
Transformation via Rotation Matrix#
Passive Rotation#
As in Fig. 20, consider that the origin of the body frame coincides with the origin of the reference frame, and that a point \(P\) expressed in \(O- x y z\) is
The same point can also be expressed in \(O- x^{\prime} y^{\prime} z^{\prime}\) as
where we have applied the definition of the rotation matrix in (1). Therefore, one has
and we simply write the above as
Note
\(\boldsymbol{R}\) is a transformation (mapping) for the coordinates of the same vector, from frame \(O- x^{\prime} y^{\prime} z^{\prime}\) to the to frame \(O- x y z\).
Active Rotation#
In another perspective to look at (2), we can interpret \(\boldsymbol{p}^{\prime}\) be a vector also expressed in the reference frame \(O- x y z\), that is,
\(\boldsymbol{R} \boldsymbol{p}^{\prime}\) turns the vector \(\boldsymbol{p}^{\prime}\) to a new vector \(\boldsymbol{p}\) in the same reference frame \(O- x y z\), according to the matrix \(\boldsymbol{R}\).
Note
\(\boldsymbol{R}\) can be also interpreted as the rotation operator to rotate a vector to a new vector in the same coordinate system, where both vectors are expressed.
Composition of Rotations#
Rotation around Current Frame#
Let \(O-{x_{0} y_{0} z_{0}}\), \(O- x_{1} y_{1} z_{1}, O- x_{2} y_{2} z_{2}\) be three frames with common origin \(O\). The same vector \(\boldsymbol{p}\) can be expressed in each of the above frames, denoted as \(\boldsymbol{p}^{0}, \boldsymbol{p}^{1}, \boldsymbol{p}^{2}\), respectively. Let \(\boldsymbol{R}_{i}^{j}\) denote the rotation matrix of frame \(i\) w.r.t. frame \(j\). One has
From the above equations, one can derive
which is the composition of two rotations. \(\boldsymbol{R}_{2}^{0}\) can be thought of as first rotating \(O- x_{0} y_{0} z_{0}\) to \(O- x_{1} y_{1} z_{1}\), according to \(\boldsymbol{R}_{1}^{0}\), and then rotating \(O- x_{1} y_{1} z_{1}\) to \(O - x_{2} y_{2} z_{2}\), according to \(\boldsymbol{R}_{2}^{1}\). Here, the first rotation matrix \(\boldsymbol{R}_{1}^{0}\) is expressed in \(O- x_{0} y_{0} z_{0}\), and the second rotation matrix \(\boldsymbol{R}_{2}^{1}\) is expressed in \(O- x_{1} y_{1} z_{1}\) (we will call it current frame).
Important
Hence, we can conclude the following postmultiplication rule:
The frame with respect to which a rotation occurs (and the rotation matrix is ‘expressed’) is called the current frame.
The composition of each rotation around the current frame is obtained by postmultiplication of the rotation matrices in order.
Rotation around Fixed Frame#
Let’s consider the following case. Suppose that we first rotate \(O- x_{0} y_{0} z_{0}\) to frame \(O- x_{1} y_{1} z_{1}\), according to \(\boldsymbol{R}_{1}^{0}\) (which is expressed in the initial frame \(O- x_{0} y_{0} z_{0}\)). Next, we rotate the current frame \(O- x_{1} y_{1} z_{1}\) to the frame \(O- x_{2} y_{2} z_{2}\), according to a new rotation matrix
which is ‘expressed’ still in the initial frame \(O- x_{0} y_{0} z_{0}\) (instead of the current frame \(O- x_{1} y_{1} z_{1}\) itself). We call this type of rotation “the rotation around the fixed frame”, i.e., the rotation happens in the ‘very original’ frame.
To apply the postmultipcation rule, we need to find out a rotation \(\boldsymbol{R}_{2}^1\), which is equivalent to \(\boldsymbol{R}_{1,2}^0\), but ‘expressed’ in the current frame \(O- x_{1} y_{1} z_{1}\).
Note
To do so, let’s consider any vector \(\boldsymbol{p}^1\) expressed in frame \(O- x_{1} y_{1} z_{1}\). We follow the following procedure.
Step 1: passive rotation. Let’s first transform \(\boldsymbol{p}^1\) to the corrdinates in frame 0: \(\boldsymbol{R}^0_1\boldsymbol{p}^1\)
Step 2: active rotation. In frame 0, use the rotation matrix \(\boldsymbol{R}_{1,2}^0\) to turn \(\boldsymbol{R}^0_1\boldsymbol{p}^1\) into a new vector but still in frame 0:
Step 3: passive rotation. Since the above \(\boldsymbol{R}_{1,2}^0\boldsymbol{R}^0_1\boldsymbol{p}^1\) is in frame 0, we want to transform it back to frame 1, by
Step 4: active rotation. Now, \((\boldsymbol{R}^0_1)^T\boldsymbol{R}_{1,2}^0\boldsymbol{R}^0_1\boldsymbol{p}^1\) is in frame 1, which is definitely different from our original \(\boldsymbol{p}^1\). So, we can consider this difference is due to we have applied an active rotation \(\boldsymbol{R}^1_2\) to turn \(\boldsymbol{p}^1\) into \((\boldsymbol{R}^0_1)^T\boldsymbol{R}_{1,2}^0\boldsymbol{R}^0_1\boldsymbol{p}^1\). That is to say,
Then, we have
We call the above equation the “similarity transformation”: it is used to transform a rotation \(\boldsymbol{R}_{1,2}^0\) from frame 0 to frame 1.
Following the postmultipcation rule, we can follow the to obtain the total rotation
Important
Hence, we can conclude the following premultiplication rule:
The same frame with respect to which a rotation occurs (and the rotation matrix is ‘expressed’) is called the fixed frame.
The composition of each rotation around the fixed frame is obtained by premultiplication of the rotation matrices in order.
Note: composition of rotations not commutative!
Rotation Parameterization (Representation)#
A rotation matrix has 9 elements, its mutual orthogonality and unity properties bring 6 constraints. Thus, each robotion matrix has 3DOFs! We only need to use three independent parameters to represent a rotation matrix.
Euler Angles#
A rotation in space can be understood as a sequence of three elementary rotations. Such rotation representation is called Euler-angles represnetation, and the elementary rotation angles are called Euler angles. To fully describe all possible orientations, two successive rotations should not be made around parallel axes. In the following, two sets of Euler angles are used; namely, the ZYZ Euler angles and the Roll-Pitch-Yaw (RPY) (or ZYX Euler angles).
ZYZ Euler Angles: the rotation described by ZYZ Euler angles is done by first, rotating the current frame by \(\varphi\) about axis \(\boldsymbol{z}\), second, rotating the current frame by angle \(\vartheta\) about axis \(\boldsymbol{y}^{\prime}\), and then, rotating the current frame by the angle \(\psi\) about axis \(\boldsymbol{z}^{\prime\prime}\). Thus, the rotation matrix from ZYZ Euler angles \(\boldsymbol{\phi}=\left[\begin{array}{lll}\varphi & \vartheta & \psi\end{array}\right]^{T}\) is
Inversely, given a rotation matrix
the corresponding ZYZ Euler angles \(\boldsymbol{\phi}=\left[\begin{array}{lll}\varphi & \vartheta & \psi\end{array}\right]^{T}\) is
if \(s_{\vartheta}=0\), i.e., \((r_{23}, r_{13})\not=(0,0)\); otherwise, only the sum or difference of \(\varphi\) and \(\psi\) is determined (why?)
RPY (ZYX Euler angles): I think about RPY rotations is a process of “a fighter jet from parking –> taxiing (yaw) –> take-off (pitch) –> fighting (roll)”. Formally, RPY is obtained by first, rotating the reference frame by the angle \(\varphi\) about the current axis \(\boldsymbol{z}\) (yaw), then, rotating the current frame by \(\vartheta\) about the current axis \(\boldsymbol{y}\) (pitch), and then, rotating the current frame by \(\psi\) about current axis \(\boldsymbol{x}\) (roll). Thus, the resulting rotation matrix is obtained by postmultiplication rule.
Inversely, given rotation matrix
the corresponding ZYX Euler Angles is
if \(c_{\vartheta}\not=0\); otherwise, only the sum or difference of \(\varphi\) and \(\psi\) can be determined.
Angle Axis#
Given a rotation defined by an angle \(\vartheta\) around a unit axis vector \(\boldsymbol{r}=\left[r_{x}, r_{y}, r_{z}\right]^{T}\) in the reference frame \(O- x y z\), the angle-axis representation is defined as \((\vartheta, \boldsymbol{r})\).
To derive the rotation matrix \(\boldsymbol{R}(\vartheta, \boldsymbol{r})\) from \((\vartheta, \boldsymbol{r})\), we first create a body frame \(O_1- x_1 y_1 z_1\) with its axis \(\boldsymbol{z_1}\) aligned with \(\boldsymbol{r}\). Then, the rotation of \(\vartheta\) about \(\boldsymbol{r}\) can be ‘expressed’ in the current frame: \(\boldsymbol{R}_{z}(\vartheta)\). Since our goal is to find the rotation matrix \(\boldsymbol{R}(\vartheta, \boldsymbol{r})\) ‘expressed’ in the reference frame \(O- x y z\), we similarly apply the previous similarity transformation:
with \(\boldsymbol{R}_{1}\) denoting the rotation of the body frame in reference framework. From Fig. 22, we have
In sum, the rotation matrix is
with
Also, the following property holds:
Inversely, given rotation matrix
then,
if \(\sin \vartheta \neq 0\); otherwise, \((\vartheta, \boldsymbol{r})\) is undefined.
Quaternion#
Given a rotation defined by an angle \(\vartheta\) around a unit axis vector \(\boldsymbol{r}=\left[r_{x}, r_{y}, r_{z}\right]^{T}\) in the reference frame \(O- x y z\), its quaternion is defined as
\(\eta\) is called the scalar part while \(\boldsymbol{\epsilon}=\left[\epsilon_{x} , \epsilon_{y} , \epsilon_{z}, \right]^{T}\) is called vector part of the quaternion, and \(\eta^{2}+\epsilon_{x}^{2}+\epsilon_{y}^{2}+\epsilon_{z}^{2}=1\). It is worth remarking that, unlike the angle/axis representation, a rotation by \((-\vartheta, -\boldsymbol{r})\) gives the same quaternion as that by \((\vartheta, \boldsymbol{r})\).
The rotation matrix corresponding to a given quaternion is
Inversely, given rotation matrix
the quaternion is
where \(\operatorname{sgn}(x)=1\) for \(x \geq 0\) and \(\operatorname{sgn}(x)=-1\) for \(x<0\).
Similar to the inverse of a rotation matrix \(\boldsymbol{R}\), a quaternion also has its own inverse, denoted as \(\mathcal{Q}^{-1}\), corresponding to \(\boldsymbol{R}^{-1}=\boldsymbol{R}^{T}\). Quanternion inverse can be easily computed as
Let \(\mathcal{Q}_{1}=\left\{\eta_{1}, \boldsymbol{\epsilon}_{1}\right\}\) and \(\mathcal{Q}_{2}=\left\{\eta_{2}, \boldsymbol{\epsilon}_{2}\right\}\) denote the quaternions corresponding to the rotation matrices \(\boldsymbol{R}_{1}\) and \(\boldsymbol{R}_{2}\), respectively. The quaternion corresponding to the product \(\boldsymbol{R}_{1} \boldsymbol{R}_{2}\) is given by
where the quaternion product operator “*” has been formally introduced.
Homogeneous Transformations#
Consider a reference frame \(O_{0}- x_{0} y_{0} z_{0}\) and body frame \(O_{1}- x_{1} y_{1} z_{1}\). Let \(\boldsymbol{o}_{1}^{0}\) be the coordinate of the origin of body frame in reference frame, and \(\boldsymbol{R}_{1}^{0}\) be the rotation matrix of body frame in reference frame. Let \(\boldsymbol{p}^{0}\) be the coordinate of any point \(P\) in reference frame, and \(\boldsymbol{p}^{1}\) be the coordinate of the same point \(P\) in body frame. Then, we have the following relationship
To achieve a compact representation, we first introduce the concept of “homogeneous coordinate” of a 3D vector \(\boldsymbol{p}\), defined as
Then, the above relationship can be compactly written as
with
which is called homogeneous transformation matrix.
The inverse of the homogeneous transformation \(\boldsymbol{T}_{1}^{0}\),
with
Notice that for the homogeneous transformation matrix the orthogonality property does not hold:
Following the derivation of sequential rotation transformation, it is easy to verify that a sequence of homogeneous transformations can be composed by the postmultiplication rule
where \(\boldsymbol{T}_{i}^{i-1}\) denotes the homogeneous transformation of frame \(i\) with respect to the current frame \(i-1\).