Basic Kinematics#
The pose of a rigid body in 3D space is described by its position and orientation with respect to a reference frame. As shown in Fig. 1{reference-type=”ref” reference=”fig.rbpos”}, let \(O- x y z\) be the reference frame and \(\{\boldsymbol{x}, \boldsymbol{y}, \boldsymbol{z}\}\) be the unit vectors of the frame axes. In order to represent the pose of the rigid body, we pick a fixed point \(O^\prime\) on the rigid body, and attach an orthonormal body frame \(O^{\prime} - x^{\prime} y^{\prime} z^{\prime}\) to the body, with origin in \(O^{\prime}\). \(\{\boldsymbol{x}^{\prime}, \boldsymbol{y}^{\prime}, \boldsymbol{z}^{\prime}\}\) are the unit vectors of the body frame axes,
To describe the position of the rigid body, we 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}\) are projections of \(\boldsymbol{o}^{\prime}\) in each axis in \(\{\boldsymbol{x}, \boldsymbol{y}, \boldsymbol{z}\}\), and they are called the coordinates of the vector.
To describe the orientation of the rigid body, we find the coordinates of each unit axis in \(\{\boldsymbol{x}^{\prime}, \boldsymbol{y}^{\prime}, \boldsymbol{z}^{\prime}\}\) of rigid body frame, in terms of \(\{\boldsymbol{x}, \boldsymbol{y}, \boldsymbol{z}\}\) of reference frame:
Write the above into the following compact notation:
with each column being the coordinates of each unit vector in \(\{\boldsymbol{x}^{\prime}, \boldsymbol{y}^{\prime}, \boldsymbol{z}^{\prime}\}\).
Important
The \(\boldsymbol{R}\) is called rotation matrix. Some properties of Rotation Matrix include
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 via rotations of the reference frame about coordinate axes. Below, we consider right-handed rotation convention: rotations are positive if counter-clockwise about a axis.
As shown in Fig. 3{reference-type=”ref” reference=”c1.rotation1”}, 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
Note
Takeaway: the rotation matrix can be interpreted geometrically as a rotation about an axis in space needed to align a reference frame to a body frame.
Transformation via Rotation Matrix#
Passive Rotation#
Consider that the origin of the body frame coincides with the origin of the reference frame, and that a point \(P\) in space expressed in \(O- x y z\) is
The same point can also be expressed in \(O- x^{\prime} y^{\prime} z^{\prime}\) as
To establish the relationship between two coordinates, we need to replace the unite vectors \(\{\boldsymbol{x}^{\prime}, \boldsymbol{y}^{\prime}, \boldsymbol{x}^{\prime}\}\) of the body frame with their coordinates in the reference frame using the rotation matrix \(\boldsymbol{R}\). This leads to
Note
Takeaway: \(\boldsymbol{R}\) represents the transformation matrix of the coordinates in frame \(O- x^{\prime} y^{\prime} z^{\prime}\) to the coordinates of the same vector in frame \(O- x y z\).
Active Rotation#
In another perspective to look at ([equ.transform]{reference-type=”ref” reference=”equ.transform”}), we can interpret \(\boldsymbol{p}^{\prime}\) be a vector also in the reference frame \(O- x y z\); \(\boldsymbol{R} \boldsymbol{p}^{\prime}\) yields a vector \(\boldsymbol{p}\) with the same norm as that of \(\boldsymbol{p}^{\prime}\) but rotated with respect to \(\boldsymbol{p}^{\prime}\) according to the matrix \(\boldsymbol{R}\).
Note
Takeaway: \(\boldsymbol{R}\) can be also interpreted as the matrix operator allowing rotation of a vector by a given angle about an axis in space.
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}\).
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”.
To apply the postmultipcation rule, we need to find out the equivalent rotation to \(\boldsymbol{R}_{1,2}^0\) but ‘expressed’ in the current frame \(O- x_{1} y_{1} z_{1}\). This will lead to the concept of similarity transformation derived using the perspective of “rotation matrix as a active transformation” (how?).
Important
Given a rotation matrix \(\boldsymbol{R}^0\) ‘expressed’ in the frame \(O- x_{0} y_{0} z_{0}\), the equivalent rotation matrix \(\boldsymbol{R}^1\) ‘expressed’ in another frame \(O- x_{1} y_{1} z_{1}\), where \(O- x_{1} y_{1} z_{1}\) is rotated by \(\boldsymbol{R}_1^0\) from \(O- x_{0} y_{0} z_{0}\) is
Back to the matrix \(\boldsymbol{R}_{1,2}^0\), the equivalent rotation matrix ‘expressed’ in the current frame \(O- x_{1} y_{1} z_{1}\) is
Then, following the postmultipcation rule, we can follow the to obtain the total rotation $\(\boldsymbol{R}_{2}^{0}=\boldsymbol{R}_{1}^{0} \boldsymbol{R}_{1,2}^1=\boldsymbol{R}_{1}^{0} (\boldsymbol{R}_1^0)^T\boldsymbol{R}_{1,2}^0\boldsymbol{R}_1^0=\boldsymbol{R}_{1,2}^0\boldsymbol{R}_1^0\)$
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#
A rotation matrix has 9 elements, its mutual orthogonality and unity properties bring 6 constraints. Thus, only three independent parameters can minimally and sufficiently parameterize a rotation matrix.
Euler Angles#
A rotation in space can be understood as a sequence of three elementary rotations. To fully describe all possible orientations, two successive rotations should not be made around parallel axes. When the first and third rotations are made around the same axis, the parameterization is called proper Euler angles. In the following, two sets of Euler angles are used; namely, the ZYZ Euler angles and the RPY (or Roll-PitchYaw) 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 Euler Angles: the rotation from RPY Euler angles is obtained by first, rotating the reference frame by the angle \(\varphi\) about the current axis \(\boldsymbol{z}\) (roll), then, rotating the current frame by \(\vartheta\) about the fixed axis \(\boldsymbol{y}\) (pitch), and then, rotating the current frame by \(\psi\) about fixed axis \(\boldsymbol{x}\) (yaw). Thus, the resulting rotation matrix is obtained by premultiplication 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#
The angle-axis is a non-minimal implementation of rotations, which is defined by an angle \(\vartheta\) and a rotation axis vector \(\boldsymbol{r}=\left[r_{x}, r_{y}, r_{z}\right]^{T}\) (unit vector) in the reference frame \(O- x y z\).
To derive the rotation matrix \(\boldsymbol{R}(\vartheta, \boldsymbol{r})\) from \((\vartheta, \boldsymbol{r})\), we first create a ‘virtual’ frame \(O_1- x_1 y_1 z_1\) with its axis \(\boldsymbol{z_1}\) aligned with \(\boldsymbol{r}\). Then, the rotation matrix for the rotation \((\vartheta, \boldsymbol{r})\) is ‘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 apply the previous similarity transformation:
with \(\boldsymbol{R}_{1}\) denoting the rotation from the reference frame to the virtual frame. From the geometry in Fig. 5{reference-type=”ref” reference=”c1.fig.axis-angle”},
In sum, the rotation matrix is
with
Also, the following property holds: $\(\boldsymbol{R}(-\vartheta,-\boldsymbol{r})=\boldsymbol{R}(\vartheta, \boldsymbol{r})\)$
Inversely, given rotation matrix $\(\boldsymbol{R}=\left[\begin{array}{lll} r_{11} & r_{12} & r_{13} \\ r_{21} & r_{22} & r_{23} \\ r_{31} & r_{32} & r_{33} \end{array}\right],\)$
then,
if \(\sin \vartheta \neq 0\); otherwise, \((\vartheta, \boldsymbol{r})\) is undefined.
Quaternion#
A non-minimal representation of rotations which does not suffer from the disadvantage encountered with the angle axis is provided by unit quaternions, 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\).
The quaternion corresponding to \(\boldsymbol{R}^{-1}=\boldsymbol{R}^{T}\) is denoted as \(\mathcal{Q}^{-1}\), and can be 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 another frame \(O_{1}- x_{1} y_{1} z_{1}\). Let \(\boldsymbol{o}_{1}^{0}\) be the coordinate vector of the origin of Frame 1 w.r.t. Frame 0, and \(\boldsymbol{R}_{1}^{0}\) be the rotation matrix of Frame 1 w.r.t. Frame 0. Let \(\boldsymbol{p}^{0}\) be the coordinate vector of any point \(P\) w.r.t. Frame 0, and \(\boldsymbol{p}^{1}\) be the coordinate vector of the same point \(P\) w.r.t. Frame 1. Then, we have the following relationship
To achieve a compact representation, the homogeneous representation of a generic vector \(\boldsymbol{p}\) is introduced:
Then, the above relationship can be compactly written as
with
which is called homogeneous transformation matrix. All homogeneous transformation matrices belong to the Special Euclidean Group, denoted as \(\boldsymbol{A}_{1}^{0}\in SE(3)\).
The inverse transformation,
with
Notice that for the homogeneous transformation matrix the orthogonality property does not hold;
Analogously to what presented for the rotation matrices, it is easy to verify that a sequence of coordinate transformations can be composed by the postmultiplication rule
where \(\boldsymbol{A}_{i}^{i-1}\) denotes the homogeneous transformation of Frame \(i\) with respect to the current Frame \(i-1\).