NOTE / 8/25/2018

[SLAM 14 Lectures] Chapter 4 Summary

SLAMTechnical NotesSLAMVIOsensor fusion

I have been reading 14 Lectures on Visual SLAM and use this note to record key points.

This chapter introduces Lie groups and Lie algebras.

Why use Lie groups and Lie algebras? They simplify optimization problems involving pose variables. Using rotation and transformation matrices makes optimization constrained because a rotation matrix must remain orthogonal. Expressing rigid-body motion with Lie groups and Lie algebras turns it into an unconstrained optimization problem. This is their main use in visual SLAM.

Definition of a group

A group is an algebraic structure consisting of a set and an operation. Let the set be AA and the operation be ⋅\cdot. It satisfies:

  1. Closure: ∀a1,a2∈A, a1⋅a2∈A\forall a_1,a_2\in A,\ a_1\cdot a_2\in A.
  2. Associativity: ∀a1,a2,a3∈A, (a1⋅a2)⋅a3=a1⋅(a2⋅a3)\forall a_1,a_2,a_3\in A,\ (a_1\cdot a_2)\cdot a_3=a_1\cdot(a_2\cdot a_3).
  3. Identity: ∃a0∈A\exists a_0\in A such that ∀a∈A, a0⋅a=a⋅a0=a\forall a\in A,\ a_0\cdot a=a\cdot a_0=a.
  4. Inverse: ∀a∈A, ∃a−1∈A\forall a\in A,\ \exists a^{-1}\in A such that a⋅a−1=a0a\cdot a^{-1}=a_0.

Common groups:

  1. General linear group GL(n)\mathrm{GL}(n): invertible n×nn\times n matrices under multiplication.
  2. Special orthogonal group SO(n)\mathrm{SO}(n): rotation matrices; SO(2)\mathrm{SO}(2) and SO(3)\mathrm{SO}(3) are common.
  3. Special Euclidean group SE(n)\mathrm{SE}(n): nn-dimensional Euclidean transformations, including SE(2)\mathrm{SE}(2) and SE(3)\mathrm{SE}(3).

A Lie group is a group with continuous, smooth structure.

Definition of a Lie algebra

Every Lie group has a corresponding Lie algebra that describes its local properties.

A Lie algebra consists of vector space V\mathbb V, scalar field F\mathbb F, and a binary operation (the Lie bracket) [,][,]. The triple (V,F,[,])(\mathbb V,\mathbb F,[,]) is a Lie algebra if it satisfies:

  1. Closure: ∀X,Y∈V, [X,Y]∈V\forall X,Y\in\mathbb V,\ [X,Y]\in\mathbb V.
  2. Bilinearity: for ∀X,Y,Z∈V\forall X,Y,Z\in\mathbb V and a,b∈Fa,b\in\mathbb F, [aX+bY,Z]=a[X,Z]+b[Y,Z][aX+bY,Z]=a[X,Z]+b[Y,Z] and [Z,aX+bY]=a[Z,X]+b[Z,Y][Z,aX+bY]=a[Z,X]+b[Z,Y].
  3. Alternating property: ∀X∈V, [X,X]=0\forall X\in\mathbb V,\ [X,X]=0.
  4. Jacobi identity: ∀X,Y,Z∈V\forall X,Y,Z\in\mathbb V, [X,[Y,Z]]+[Z,[X,Y]]+[Y,[Z,X]]=0[X,[Y,Z]]+[Z,[X,Y]]+[Y,[Z,X]]=0.

Lie algebra so(3)\mathfrak{so}(3)

so(3)={ϕ∈R3, Φ=ϕ∧∈R3×3}.\mathfrak{so}(3)= \left\{\phi\in\mathbb R^3,\ \Phi=\phi^\wedge\in\mathbb R^{3\times3}\right\}.
  1. Its elements are 3D vectors or 3×33\times3 skew-symmetric matrices.
  2. Its Lie bracket is [ϕ1,ϕ2]=(Φ1Φ2−Φ2Φ1)∨[\phi_1,\phi_2]=(\Phi_1\Phi_2-\Phi_2\Phi_1)^\vee.
  3. Its relation to SO(3)\mathrm{SO}(3) is R=exp⁡(ϕ∧)\mathbf R=\exp(\phi^\wedge).

Lie algebra se(3)\mathfrak{se}(3)

se(3)={ξ=[ρϕ]∈R6,ρ∈R3,ϕ∈so(3),ξ∧=[ϕ∧ρ0T0]∈R4×4}.\mathfrak{se}(3)= \left\{ \xi=\begin{bmatrix}\rho\\\phi\end{bmatrix}\in\mathbb R^6, \rho\in\mathbb R^3,\phi\in\mathfrak{so}(3), \xi^\wedge= \begin{bmatrix}\phi^\wedge&\rho\\\mathbf0^\mathsf T&0\end{bmatrix} \in\mathbb R^{4\times4} \right\}.
  1. Its elements are six-dimensional vectors: the first three components relate to translation and the last three to rotation.
  2. Its Lie bracket is [ξ1,ξ2]=(ξ1∧ξ2∧−ξ2∧ξ1∧)∨[\xi_1,\xi_2]=(\xi_1^\wedge\xi_2^\wedge-\xi_2^\wedge\xi_1^\wedge)^\vee.
  3. Its relation to SE(3)\mathrm{SE}(3) is T=exp⁡(ξ∧)\mathbf T=\exp(\xi^\wedge).

Exponential and logarithmic maps

Article illustration

Lie-algebra derivatives and perturbation models

For general matrix exponentials, the following is not true:

ln⁡(exp⁡(A)exp⁡(B))=A+B.\ln(\exp(\mathbf A)\exp(\mathbf B))=\mathbf A+\mathbf B.

The Baker–Campbell–Hausdorff (BCH) formula gives the approximation

ln⁡(exp⁡(ϕ1∧)exp⁡(ϕ2∧))∨≈{Jl(ϕ2)−1ϕ1+ϕ2,when ϕ1 is small,Jr(ϕ1)−1ϕ2+ϕ1,when ϕ2 is small.\ln(\exp(\phi_1^\wedge)\exp(\phi_2^\wedge))^\vee \approx \begin{cases} \mathbf J_l(\phi_2)^{-1}\phi_1+\phi_2,&\text{when }\phi_1\text{ is small},\\ \mathbf J_r(\phi_1)^{-1}\phi_2+\phi_1,&\text{when }\phi_2\text{ is small}. \end{cases}

This supports differentiation of rigid-body motion from the definition of a derivative:

∂Rp∂φ=lim⁡φ→0exp⁡(φ∧)exp⁡(ϕ∧)p−exp⁡(ϕ∧)pφ=−(Rp)∧.\frac{\partial\mathbf R\mathbf p}{\partial\varphi} =\lim_{\varphi\to0} \frac{\exp(\varphi^\wedge)\exp(\phi^\wedge)\mathbf p-\exp(\phi^\wedge)\mathbf p}{\varphi} =-(\mathbf R\mathbf p)^\wedge. ∂Tp∂δξ=[I−(Rp+t)∧0T0T]=(Tp)⊙.\frac{\partial\mathbf T\mathbf p}{\partial\delta\xi} = \begin{bmatrix} \mathbf I&-(\mathbf R\mathbf p+\mathbf t)^\wedge\\ \mathbf0^\mathsf T&\mathbf0^\mathsf T \end{bmatrix} =(\mathbf T\mathbf p)^\odot.

Visual-SLAM application

Suppose we solve a motion-only bundle-adjustment problem:

ξ∗=arg min⁡ξ12∥e∥2,e=ui−1siKexp⁡(ξ∧)pi,T=exp⁡(ξ∧).\begin{aligned} \xi^*&=\operatorname*{arg\,min}_{\xi}\frac{1}{2}\lVert\mathbf e\rVert^2,\\ \mathbf e&=\mathbf u_i-\frac{1}{s_i}\mathbf K\exp(\xi^\wedge)\mathbf p_i,\\ \mathbf T&=\exp(\xi^\wedge). \end{aligned}

With Gauss–Newton, take the linear term of the Taylor expansion of the residual:

e(ξ⊕δξ)=e(ξ)+Jδξ,J=∂e∂δξ.\mathbf e(\xi\oplus\delta\xi)=\mathbf e(\xi)+\mathbf J\delta\xi, \qquad \mathbf J=\frac{\partial\mathbf e}{\partial\delta\xi}.

The key is computing Jacobian J\mathbf J. Since ui\mathbf u_i is a 2×12\times1 vector independent of the derivative, introduce the map point in camera coordinates, P′\mathbf P':

e=ui−1siKP′,P′=exp⁡(ξ∧)pi=Tpi.\mathbf e=\mathbf u_i-\frac{1}{s_i}\mathbf K\mathbf P', \qquad \mathbf P'=\exp(\xi^\wedge)\mathbf p_i=\mathbf T\mathbf p_i.

By the chain rule,

J=∂e∂δξ=∂e∂P′∂P′∂δξ.\mathbf J= \frac{\partial\mathbf e}{\partial\delta\xi} = \frac{\partial\mathbf e}{\partial\mathbf P'} \frac{\partial\mathbf P'}{\partial\delta\xi}.

The first factor is the derivative of the projection model:

∂e∂P′=−[fxZ′0−fxX′Z′20fyZ′−fyY′Z′2].\frac{\partial\mathbf e}{\partial\mathbf P'} = -\begin{bmatrix} \frac{f_x}{Z'}&0&-\frac{f_xX'}{Z'^2}\\ 0&\frac{f_y}{Z'}&-\frac{f_yY'}{Z'^2} \end{bmatrix}.

The second factor comes from the Lie-algebra perturbation model:

∂P′∂δξ=∂Tpi∂δξ=[I−P′∧]=(Tpi)⊙.\frac{\partial\mathbf P'}{\partial\delta\xi} = \frac{\partial\mathbf T\mathbf p_i}{\partial\delta\xi} = \begin{bmatrix}\mathbf I&-\mathbf P'^\wedge\end{bmatrix} =(\mathbf T\mathbf p_i)^\odot.

This is the practical use of Lie algebra: it enables unconstrained optimization.