Lie group and lie algebra for robotics

Table of Contents

  1. Vectors
  2. Euclidean Transformations
  3. Rotation Representations
  4. Homogeneous Transformations
  5. Rotational Kinematics
  6. Translation
  7. Lie Groups
  8. Lie Algebras
  9. Exponential and Logarithm Maps
  10. Adjoint Representation

Rigid Body Motion in 3D Space

How is the motion of a rigid body in three-dimensional space described?

This question is fundamental because when we describe the pose of a robot, we are essentially describing the motion of a rigid body in 3D. Moreover, in robotics we often need to estimate and optimize this pose. The way we represent the pose directly determines the form of the robot’s motion equations and optimization equations.

In 3D space, rigid body motion can be expressed using two concepts:

Rigid body motion illustration


1. Vectors

A vector is a physical entity in space, independent of scalar values.
To describe a vector, we must specify a coordinate frame and its basis vectors $[\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3]$.
A vector $\mathbf{a}$ in this frame can be written as:

\[\mathbf{a} = [\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3] \begin{bmatrix} a_1 \\ a_2 \\ a_3 \end{bmatrix}\]

Thus, vector coordinates depend both on the vector itself and the chosen coordinate system.

1.1 Vector Operations

Two key operations are dot product and cross product:

\[\mathbf{a}\cdot \mathbf{b} = \mathbf{a}^T \mathbf{b} = |\mathbf{a}||\mathbf{b}|\cos\langle\mathbf{a}, \mathbf{b}\rangle = \sum_{i=1}^3 a_i b_i\] \[\mathbf{a}\times \mathbf{b} = \begin{bmatrix} a_2 b_3 - a_3 b_2 \\ a_3 b_1 - a_1 b_3 \\ a_1 b_2 - a_2 b_1 \end{bmatrix} = \mathbf{a}^\wedge \mathbf{b}\]

where $\mathbf{a}^\wedge$ denotes the skew-symmetric matrix form of $\mathbf{a}$.

The cross product result is a vector perpendicular to both $\mathbf{a}$ and $\mathbf{b}$, with magnitude
$|\mathbf{a}||\mathbf{b}|\sin\langle\mathbf{a}, \mathbf{b}\rangle$.
It also encodes the idea of a rotation axis, linking to later descriptions of rotation.


2. Euclidean Transformations

Suppose we have two coordinate frames:

A point $\mathbf{p}$ exists physically, but has different coordinates in each frame. The mapping between the two coordinate representations is a Euclidean transformation.

Rigid body motion preserves vector length and direction, so the transformation consists of:

Euclidean transformation between frames

3. Rotation Representations

3.1 Rotation Matrix

Consider a vector $\mathbf{p}$ in two frames:

\[[\mathbf{e}_1, \mathbf{e}_2, \mathbf{e}_3] \begin{bmatrix} a_1 \\ a_2 \\ a_3 \end{bmatrix} = [\mathbf{e}_1', \mathbf{e}_2', \mathbf{e}_3'] \begin{bmatrix} a_1' \\ a_2' \\ a_3' \end{bmatrix}\]

Left multiplying by $[\mathbf{e}_1^T, \mathbf{e}_2^T, \mathbf{e}_3^T]^T$ gives:

\[\mathbf{a} = \mathbf{R}\mathbf{a}'\]

where $\mathbf{R}$ is the rotation matrix formed from inner products of the bases.
$\mathbf{R}$ is an orthogonal matrix with determinant $+1$, i.e.,

\[SO(n) = \{ \mathbf{R} \in \mathbb{R}^{n\times n} \mid \mathbf{R}\mathbf{R}^T = \mathbf{I},\; \det(\mathbf{R})=1 \}\]

This set is called the Special Orthogonal Group.

3.2 Rotation Vector

Rotation matrices have redundancy (9 elements, 3 DOF, with constraints).
A more compact 3-parameter representation is the rotation vector:

So the rotation vector is $\theta n$.

The conversion with rotation matrices uses Rodrigues’ formula:

\[\mathbf{R} = \cos \theta \mathbf{I} + (1-\cos\theta)n \dot n^T + \sin\theta \mathbf{n}^\wedge\]

3.3 Euler Angles

A rotation can also be decomposed into three successive rotations about axes.

For example, in photogrammetry and robotics:

Euler angles are intuitive but suffer from singularities (gimbal lock).

3.4 Quaternions

Euler angles and rotation vectors have singularities.
Quaternions provide a compact, non-singular representation.

A quaternion is defined as:

\[\mathbf{q} = q_0 + q_1 i + q_2 j + q_3 k = [s, \mathbf{v}]\]

where $s$ is the scalar part, and $\mathbf{v}=[q_1, q_2, q_3]^T$ is the vector part.

Unit Quaternion Representation of Rotation

For a rotation of angle $\theta$ around axis $\mathbf{n}$:

\[\mathbf{q} = \begin{bmatrix} \cos \tfrac{\theta}{2} \\ n_x \sin \tfrac{\theta}{2} \\ n_y \sin \tfrac{\theta}{2} \\ n_z \sin \tfrac{\theta}{2} \end{bmatrix}\]

The corresponding rotation matrix is:

\[\mathbf{R}= \begin{bmatrix} 1 - 2q_2^2 - 2q_3^2 & 2q_1q_2 - 2q_0q_3 & 2q_1q_3+2q_0q_2 \\ 2q_1q_2 + 2q_0q_3 & 1 - 2q_1^2 - 2q_3^2 & 2q_2q_3 - 2q_0q_1 \\ 2q_1q_3 - 2q_0q_2 & 2q_2q_3 + 2q_0q_1 & 1 - 2q_1^2 - 2q_2^2 \end{bmatrix}\]

Quaternion Operations

Quaternion sphere representation


4. Homogeneous Transformations

With both rotation ($\mathbf{R}$) and translation ($\mathbf{t}$), the transformation of a point is:

\[\mathbf{a}' = \mathbf{R}\mathbf{a} + \mathbf{t}\]

To make this linear, we use homogeneous coordinates:

\[\begin{bmatrix} \mathbf{a}' \\ 1 \end{bmatrix} = \begin{bmatrix} \mathbf{R} & \mathbf{t} \\ \mathbf{0}^T & 1 \end{bmatrix} \begin{bmatrix} \mathbf{a} \\ 1 \end{bmatrix}\]

The $4 \times 4$ matrix belongs to the Special Euclidean Group:

\[SE(3) = \left\{ \mathbf{T} = \begin{bmatrix} \mathbf{R} & \mathbf{t} \\ \mathbf{0}^T & 1 \end{bmatrix} \;\middle|\; \mathbf{R}\in SO(3),\; \mathbf{t}\in\mathbb{R}^3 \right\}\]

5. Rotational Kinematics

Assume frame $\mathbf{F}2$ rotates relative to $\mathbf{F}_1$ with angular velocity $\omega{21}$ (so $\omega_{12} = -\omega_{21}$).

The relationship between inertial and moving frame time derivatives:

\[\dot{\mathbf{r}} = \mathring{\mathbf{r}} + \omega_{21} \times \mathbf{r}\]

5.1 Angular Velocity and Rotation Matrix

Poisson’s formula:

\[\dot{\mathbf{C}}_{21} = -[\omega_2^{21}]_\times \mathbf{C}_{21}\]

and equivalently:

\[[\omega_2^{21}]_\times = -\dot{\mathbf{C}}_{21}\mathbf{C}_{21}^T\]

5.2 Euler Angles Representation

For a 1-2-3 Euler sequence:

\[\omega_2^{21} = \mathbf{S}(\theta_2, \theta_3)\dot{\theta}\]

where:

\[\mathbf{S}(\theta_2,\theta_3)= \begin{bmatrix} \cos \theta_2 \cos \theta_3 & \sin \theta_3 & 0 \\ -\cos \theta_2 \sin \theta_3 & \cos \theta_3 & 0 \\ \sin \theta_2 & 0 & 1 \end{bmatrix}\]

and the inverse relation:

\[\dot{\theta} = \mathbf{S}^{-1}(\theta_2, \theta_3)\omega_2^{21}\]

Note the singularity at $\theta_2=\pi/2$.

5.3 Perturbed Rotations

Rotations lie on the SO(3) group (non-commutative).
For perturbations, linearization is done in the tangent space.

For rotation matrix $\mathbf{C}(\bar{\theta}+\delta \theta)$:

\[\mathbf{C}(\bar{\theta}+\delta \theta) \approx (1 - [\delta\phi]_\times)\mathbf{C}(\bar{\theta})\]

5.4 Perturbations in Euler Angles

For a rotation sequence $\alpha-\beta-\gamma$:

\[\frac{\partial \mathbf{C}(\theta)\mathbf{v}}{\partial \theta} = (\mathbf{C}(\theta)\mathbf{v})_\times \mathbf{S}(\theta_2,\theta_3)\]

This yields Jacobians used in optimization and estimation.


6. Translation

For points:

\[\mathbf{r}^{pi} = \mathbf{r}^{pv} + \mathbf{r}^{vi}\]

In inertial frame:

\[\mathbf{r}^{pi}_i = \mathbf{C}_{iv}\mathbf{r}^{pv}_v + \mathbf{r}^{vi}_i\]

Homogeneous transformation:

\[\mathbf{T}_{iv} = \begin{bmatrix} \mathbf{C}_{iv} & \mathbf{r}^{vi}_i \\ \mathbf{0}^T & 1 \end{bmatrix}\]

Inverse:

\[\mathbf{T}_{vi} = \begin{bmatrix} \mathbf{C}_{vi} & \mathbf{r}^{iv}_v \\ \mathbf{0}^T & 1 \end{bmatrix}\]

Translation in SE(3)

7. Lie Groups

A group is a set $\mathcal{G}$ with a binary operation $\cdot$ such that:

  1. Closure: $a, b \in \mathcal{G} \implies a \cdot b \in \mathcal{G}$
  2. Associativity: $(a \cdot b)\cdot c = a \cdot (b \cdot c)$
  3. Identity: $\exists e \in \mathcal{G}$ such that $a \cdot e = e \cdot a = a$ for all $a$
  4. Inverse: For every $a \in \mathcal{G}$, there exists $a^{-1} \in \mathcal{G}$ such that $a \cdot a^{-1} = e$

A Lie group is a group that is also a smooth manifold, where group operations (multiplication and inverse) are smooth (differentiable) maps.
This dual structure allows us to combine algebraic properties (group theory) with geometric properties (manifold theory).

7.1 Manifolds

An $N$-dimensional manifold $\mathcal{M}$ is a geometric space that is locally Euclidean. For any point $\mathbf{x} \in \mathcal{M}$, there exists a neighborhood that is homeomorphic to $\mathbb{R}^N$.

manifold

Smooth: A map $f$ from $U\subset R^m$ to $V \subset R^n$ is smooth if all partial derivatives of $f$, of all orders, exist and are continuous.

A group can act on another set or space.
If $a,b \in G$ and $v \in V$:

Example:
Let $R \in SO(3)$ and $p \in \mathbb{R}^3$. Then the action is
\(R \cdot p = Rp\)
which means the group $SO(3)$ acts on vectors in $\mathbb{R}^3$ via rotation.

At any point $\mathbf{x} \in \mathcal{M}$, the tangent space $\mathcal{T}_{\mathbf{x}}\mathcal{M}$ is a linear vector space that approximates the manifold locally.

The tangent space at the identity element is called the Lie algebra.

7.2 SO(3): The Special Orthogonal Group

The set of valid 3D rotation matrices:

\[SO(3) = \{ C \in \mathbb{R}^{3\times 3} \;|\; C C^T = I, \det C = 1 \}\]

Thus, $SO(3)$ represents all possible orientations of a rigid body in 3D.

7.3 SE(3): The Special Euclidean Group

The set of rigid body transformations (rotation + translation):

\[SE(3) = \left\{ T = \begin{bmatrix} C & r \\ 0^T & 1 \end{bmatrix} \;\middle|\; C \in SO(3),\; r \in \mathbb{R}^3 \right\}\]

Here:

$SE(3)$ forms a Lie group with 6 degrees of freedom (3 for rotation, 3 for translation).

7.4 Application in Robotics

Key point: $SE(n)$ captures both the geometry (rotations + translations) and the algebra (group structure) of rigid motions.

7.5 Lie Group Calculus

If $f: \mathcal{M} \mapsto \mathcal{N}$ is a function between manifolds:

\[\mathbf{J} = \frac{Df(\mathbf{x})}{D\mathbf{x}} = \lim_{\tau \to 0} \frac{f(\mathbf{x}\oplus\tau)\ominus f(\mathbf{x})}{\tau}\]

This defines Jacobians on manifolds.

On Lie groups, states are modeled with perturbations:

\[\mathbf{x} = \bar{\mathbf{x}} \oplus \tau, \quad \tau = \mathbf{x}\ominus \bar{\mathbf{x}}\]

Covariance:

\[\mathbf{P}_{\mathbf{x}} = \mathbb{E}[\tau \tau^\top]\]

Propagation:

\[\mathbf{P}_{\mathbf{y}} = \mathbf{J} \mathbf{P}_{\mathbf{x}} \mathbf{J}^\top\]

8. Lie Algebras

Every Lie group has an associated Lie algebra, which is its tangent space at the identity.

Intuitively:

Formally, a Lie algebra $(\mathfrak{g}, [\cdot,\cdot])$ is:

These are used in optimization and SLAM residuals.

8.1 so(3): The Lie Algebra of SO(3)

\[so(3) = \{ \phi^\wedge \in \mathbb{R}^{3\times 3} \;|\; \phi \in \mathbb{R}^3 \}\]

Here:

\[\phi^\wedge = \begin{bmatrix} 0 & -\phi_3 & \phi_2 \\ \phi_3 & 0 & -\phi_1 \\ -\phi_2 & \phi_1 & 0 \end{bmatrix}\]

The Lie bracket is the matrix commutator:

\[[\Phi_1, \Phi_2] = \Phi_1\Phi_2 - \Phi_2\Phi_1\]

This corresponds to the cross product in $\mathbb{R}^3$: \([\phi_1^\wedge, \phi_2^\wedge] = (\phi_1 \times \phi_2)^\wedge\)

So $so(3)$ encodes angular velocities.


8.2 se(3): The Lie Algebra of SE(3)

\[se(3) = \left\{ \xi^\wedge = \begin{bmatrix} \phi^\wedge & \rho \\ 0^T & 0 \end{bmatrix} \;\middle|\; \rho,\phi \in \mathbb{R}^3 \right\}\]

Here:

The operator $\wedge$ maps a twist into its matrix form.
The operator $\vee$ (vee) maps it back to vector form.

Extended operator for adjoint:

\[\xi^\curlywedge = \begin{bmatrix} \phi^\wedge & \rho^\wedge \\ 0 & \phi^\wedge \end{bmatrix} \in \mathbb{R}^{6\times 6}\]

9. Exponential and Logarithm Maps

Lie algebras describe local motions, but we often need to move between local and global descriptions.
This is done with the exponential map and its inverse, the logarithm map.

These allow switching between Lie algebra (linear tangent space) and Lie group (nonlinear manifold).

9.1 Rotation (so(3) → SO(3))

Given $\phi = \theta a$, with $a$ a unit axis and $\theta$ an angle:

\[\exp(\phi^\wedge) = \cos\theta I + (1-\cos\theta)aa^T + \sin\theta a^\wedge\]

This is Rodrigues’ formula.
It maps an axis-angle vector to a rotation matrix.

Inverse (log map):

\[\theta = \arccos\left(\frac{\mathrm{tr}(C)-1}{2}\right), \quad a = \frac{1}{2\sin\theta}\begin{bmatrix} C_{32}-C_{23}\\ C_{13}-C_{31}\\ C_{21}-C_{12}\end{bmatrix}\]

9.2 Pose (se(3) → SE(3))

For $\xi = [\rho,\phi]$:

\[\exp(\xi^\wedge) = \begin{bmatrix} R & J\rho \\ 0^T & 1 \end{bmatrix}\]

where $R = \exp(\phi^\wedge)$ and $J$ is the left Jacobian of SO(3):

\[J = \frac{\sin\theta}{\theta}I + \left(1-\frac{\sin\theta}{\theta}\right)aa^T + \frac{1-\cos\theta}{\theta} a^\wedge\]

$J$ accounts for the coupling between translation and rotation.
If $\theta\to 0$, $J \to I$.

Inverse mapping (log): extract $\rho, \phi$ from $T \in SE(3)$.


9.3 Jacobian

The Jacobian and its inverse are important in optimization:

\[J^{-1} = \frac{\theta}{2}\cot\frac{\theta}{2} I + \left(1-\frac{\theta}{2}\cot\frac{\theta}{2}\right)aa^T - \frac{\theta}{2} a^\wedge\]

If $\theta = 2k\pi$, $J$ is singular.


9.4 Direct Series Expansion

Using matrix identities, we can expand:

\[T = \exp(\xi^\wedge) = I + \xi^\wedge + \frac{1-\cos\phi}{\phi^2}(\xi^\wedge)^2 + \frac{\phi-\sin\phi}{\phi^3}(\xi^\wedge)^3\]

This avoids computing infinite series explicitly.


10. Adjoint Representation

The adjoint describes how a transformation in $SE(3)$ maps twists between coordinate frames.

For $T = \begin{bmatrix} C & r \ 0 & 1 \end{bmatrix} \in SE(3)$:

\[Ad(T) = \begin{bmatrix} C & r^\wedge C \\ 0 & C \end{bmatrix}\]

This means:

For the algebra:

\[ad(\xi) = \xi^\curlywedge = \begin{bmatrix} \phi^\wedge & \rho^\wedge \\ 0 & \phi^\wedge \end{bmatrix}\]

Relationship between group and algebra adjoints:

\[Ad(\exp(\xi^\wedge)) = \exp(ad(\xi))\]

Robotics meaning:

This is central in deriving manipulator Jacobians, rigid body dynamics, and state estimation on manifolds.