前言
最近阅读了高翔老师的视觉SLAM十四讲, 也算是了解了当下机器人领域最炙热的机器人领域前沿研究问题大概是怎么样的数学问题. 不得不说视频与书籍真的是深入浅出.
所有第三库无痛安装教程: 知乎链接
SLAM 主要解决的偏颇地说就是在求解一个非线性系统状态方程, 相应的后端, 回环检测等等技术则为了在某个方面比如长期环境下该方程的求解正确而提出.
因为本人与李群李代的关联更深, 因此本文主要记录从SLAM中学习到的李群李代知识. 最大的收获应该是BCH公式及其带来的相关泰勒展开公式.
Modern Robotics中关于部分关于李群李代数的内容
正文
机器人学中运动描述的两类群: 特殊正交群(SO(3)) 与 特殊欧氏群 (SE(3))
S
O
(
3
)
=
{
R
∈
R
3
×
3
∣
R
R
⊤
=
I
,
d
e
t
(
R
)
=
1
}
.
SO(3) =\{ {\mathbf{R}\in \mathbb{R}^{3\times3} | \mathbf{R}\mathbf{R}^{\top}=\mathbf{I}, det({\mathbf{R}}) =1}\}.
SO(3)={R∈R3×3∣RR⊤=I,det(R)=1}.
S
E
(
3
)
=
{
T
=
[
R
t
0
⊤
1
]
∈
R
4
×
4
∣
R
∈
S
O
(
3
)
,
t
∈
R
3
}
SE(3) = \{\mathbf{T} = \begin{bmatrix}\mathbf{R} && \mathbf{t} \\ \mathbf{0}^{\top} && 1\end{bmatrix} \in \mathbb{R}^{4\times 4}| \mathbf{R} \in SO(3), \mathbf{t}\in \mathbb{R}^3\}
SE(3)={T=[R0⊤t1]∈R4×4∣R∈SO(3),t∈R3}
作为群而言, 很大的一个特征是加法不封闭: 即
R
1
+
R
2
∉
S
O
(
3
)
\mathbf{R}_1 + \mathbf{R}_2 \notin SO(3)
R1+R2∈/SO(3); 仅有乘法成立:
R
1
R
2
∈
S
O
(
3
)
;
T
1
T
2
∈
S
E
(
3
)
\mathbf{R}_1\mathbf{R}_2 \in SO(3); \mathbf{T}_1\mathbf{T}_2\in SE(3)
R1R2∈SO(3);T1T2∈SE(3)
SLAM十四讲中写有: 对于这种只有一种运算的集合,称之为群.
群是一种集合加上一种运算的代数结构 G ( A , ⋅ ) G(A,\cdot) G(A,⋅), A为集合. 这一种运算需要满足:
- 封闭性: ∀ a 1 , a 2 ∈ A , a 1 a 2 ∈ A \forall{a}_1,a_2\in A, a_1a_2\in A ∀a1,a2∈A,a1a2∈A;
- 结合律: ∀ a 1 , a 2 , a 3 ∈ A , ( a 1 a 2 ) a 3 = a 1 ( a 2 a 3 ) \forall{a}_1,a_2,a_3 \in A, (a_1a_2)a_3 = a_1(a_2a_3) ∀a1,a2,a3∈A,(a1a2)a3=a1(a2a3)
- 单位元: ∃ a 0 ∈ A , s . t . ∀ a ∈ A , a 0 ⋅ a = a ⋅ a 0 = a \exists a_0 \in A, s.t. \forall{a} \in A, a_0\cdot a= a\cdot a_0 = a ∃a0∈A,s.t.∀a∈A,a0⋅a=a⋅a0=a
- 逆: ∀ a ∈ A , ∃ a − 1 ∈ A , s . t . a ⋅ a − 1 = a 0 \forall{a}\in A, \exists a^{-1}\in A, s.t.\ a\cdot a^{-1}=a_0 ∀a∈A,∃a−1∈A,s.t. a⋅a−1=a0
一个对于群的补充例子: 一般线性群 G L ( n ) GL(n) GL(n), 指 n × n n\times n n×n的可逆矩阵, 对矩阵乘法成群.
李代数的引出:
KaTeX parse error: Expected '}', got 'EOF' at end of input: …p} \end{align}
即:
R
˙
(
t
)
R
(
t
)
⊤
\dot{\mathbf{R}}(t)\mathbf{R}(t)^{\top}
R˙(t)R(t)⊤是反对称矩阵.
a
×
b
=
∣
i
j
k
a
1
a
2
a
3
b
1
b
2
b
3
∣
=
[
a
2
b
3
−
a
3
b
2
a
3
b
1
−
a
1
b
3
a
1
b
2
−
a
2
b
1
]
=
[
0
−
a
3
a
2
a
3
0
−
a
1
−
a
2
a
1
0
]
b
=
a
∧
b
\mathbf{a}\times \mathbf{b}= \left | \begin{matrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \end{matrix} \right | = \begin{bmatrix} a_2b_3-a_3b_2\\ a_3b_1-a_1b_3\\ a_1b_2-a_2b_1 \end{bmatrix} = \begin{bmatrix} 0 & -a_3 & a_2\\ a_3 & 0 & -a_1\\ -a_2 & a_1 & 0 \end{bmatrix}\mathbf{b} = \mathbf{a}^{\wedge}\mathbf{b}
a×b=
ia1b1ja2b2ka3b3
=
a2b3−a3b2a3b1−a1b3a1b2−a2b1
=
0a3−a2−a30a1a2−a10
b=a∧b
a
∧
\mathbf{a}^{\wedge}
a∧是反对称矩阵. 即
R
˙
(
t
)
R
(
t
)
⊤
\dot{\mathbf{R}}(t)\mathbf{R}(t)^{\top}
R˙(t)R(t)⊤可以看作是某一个三维向量
ϕ
(
t
)
∈
R
3
\boldsymbol{\phi}(t) \in \mathbb{R}^3
ϕ(t)∈R3的展开.
R
˙
(
t
)
R
(
t
)
⊤
=
ϕ
(
t
)
∧
\dot{\mathbf{R}}(t)\mathbf{R}(t)^{\top} = \boldsymbol{\phi}(t)^{\wedge}
R˙(t)R(t)⊤=ϕ(t)∧
由于
R
\mathbf{R}
R为正交矩阵:
R
⊤
=
R
−
1
\mathbf{R}^{\top}=\mathbf{R}^{-1}
R⊤=R−1
R
˙
(
t
)
=
ϕ
(
t
)
∧
R
(
t
)
=
[
0
−
ϕ
3
ϕ
2
ϕ
3
0
−
ϕ
1
−
ϕ
2
ϕ
1
0
]
R
(
t
)
\dot{\mathbf{R}}(t) = \boldsymbol{\phi}(t)^{\wedge}\mathbf{R}(t) = \begin{bmatrix} 0 & -\phi_3 & \phi_2\\ \phi_3 & 0 & -\phi_1\\ -\phi_2 & \phi_1 & 0\\ \end{bmatrix} \mathbf{R}(t)
R˙(t)=ϕ(t)∧R(t)=
0ϕ3−ϕ2−ϕ30ϕ1ϕ2−ϕ10
R(t)
上式的含义是: 每对旋转矩阵求一次导数, 只需左乘一个
ϕ
(
t
)
\boldsymbol{\phi}(t)
ϕ(t)矩阵即可, 设
t
0
=
0
t_0=0
t0=0, 并设此时旋转矩阵为
R
(
t
)
=
I
\mathbf{R}(t)= \mathbf{I}
R(t)=I. 我们可以把
R
(
t
)
\mathbf{R}(t)
R(t)在0附近进行一阶泰勒展开:
R
(
t
)
≈
R
(
t
0
)
+
R
˙
(
t
0
)
(
t
−
t
0
)
=
I
+
ϕ
(
t
0
)
∧
(
t
)
\begin{align} \mathbf{R}(t) &\approx \mathbf{R}(t_0) +\dot{\mathbf{R}}(t_0)(t-t_0)\\ &= \mathbf{I} + \boldsymbol{\phi}(t_0)^{\wedge}(t) \end{align}
R(t)≈R(t0)+R˙(t0)(t−t0)=I+ϕ(t0)∧(t)
ϕ
\boldsymbol{\phi}
ϕ 反映了
R
\mathbf{R}
R的导数性质, 故称它在
S
O
(
3
)
SO(3)
SO(3)原点附近的正切空间. 在
t
0
t_0
t0附近, SLAM十四讲中设
ϕ
\boldsymbol{\phi}
ϕ保持为常数
ϕ
(
t
0
)
=
ϕ
0
\boldsymbol{\phi}(t_0)=\boldsymbol{\phi}_0
ϕ(t0)=ϕ0. 而如果用流形的观点来看的话, 我认为应该是指切向基 (tangent base) 保持不变.
R
˙
(
t
)
=
ϕ
(
t
0
)
∧
R
(
t
)
=
ϕ
0
∧
R
(
t
)
\dot{\mathbf{R}}(t)=\boldsymbol{\phi}(t_0)^{\wedge}\mathbf{R}(t)={\boldsymbol{\phi}_0}^{\wedge} \mathbf{R}(t)
R˙(t)=ϕ(t0)∧R(t)=ϕ0∧R(t)
利用矩阵微分方程有:
R
(
t
)
=
e
x
p
(
ϕ
0
∧
t
)
\mathbf{R}(t) = \rm{exp}({\boldsymbol{\phi}_0}^{\wedge}t)
R(t)=exp(ϕ0∧t)
(此即为指数映射)
李代数的定义: 李代数由一个集合 V \mathbb{V} V, 一个数域 F \mathbb{F} F和一个二元运算符[,]组成. 它们需要满足以下性质, 则称( V , F , [ , ] \mathbb{V}, \mathbb{F}, [,] V,F,[,])为一个李代数, 记为 g \mathfrak{g} g.
- 封闭性: ∀ X , Y ∈ V , [ X , Y ] ∈ V \forall X,Y \in \mathbb{V}, [X,Y] \in \mathbb{V} ∀X,Y∈V,[X,Y]∈V;
- 双线性:
∀
X
,
Y
,
Z
∈
V
,
a
,
b
∈
F
\forall X,Y, Z \in \mathbb{V}, a,b \in \mathbb{F}
∀X,Y,Z∈V,a,b∈F;
[ a X + b Y , Z ] = a [ X , Z ] + b [ Y , Z ] , [ Z , a X + b Y ] = a [ Z , X ] + b [ Z , Y ] ; [aX+bY,Z] = a[X,Z] + b[Y,Z] , [Z, aX+bY] = a[Z,X] + b[Z,Y]; [aX+bY,Z]=a[X,Z]+b[Y,Z],[Z,aX+bY]=a[Z,X]+b[Z,Y]; - 自反性: ∀ X ∈ V , [ X , X ] = 0 \forall X \in \mathbb{V}, [X,X] = 0 ∀X∈V,[X,X]=0;
- 雅可比等价:
∀
X
,
Y
,
Z
∈
V
,
[
X
,
[
Y
,
Z
]
]
+
[
Z
,
[
X
,
Y
]
]
+
[
Y
,
[
Z
,
X
]
]
=
0
\forall X, Y, Z \in \mathbb{V}, [X,[Y,Z]]+[Z,[X,Y]]+[Y,[Z,X]]=0
∀X,Y,Z∈V,[X,[Y,Z]]+[Z,[X,Y]]+[Y,[Z,X]]=0.
此处的二元运算符为李括号 (Lie bracket).
李括号:
[
w
1
×
w
2
]
=
[
w
1
]
[
w
2
]
−
[
w
2
]
[
w
1
]
[w_1\times w_2] = [w_1][w_2] - [w_2][w_1]
[w1×w2]=[w1][w2]−[w2][w1]
[
V
1
]
[
V
2
]
−
[
V
2
]
[
V
1
]
=
[
[
w
1
]
v
1
0
0
]
[
[
w
2
]
v
2
0
0
]
−
[
[
w
2
]
v
2
0
0
]
[
[
w
1
]
v
1
0
0
]
=
[
[
w
1
]
[
w
2
]
−
[
w
2
]
[
w
1
]
[
w
1
]
v
2
−
[
w
2
]
v
1
0
0
]
=
[
[
w
′
]
v
′
0
0
]
\begin{align} [\mathcal{V}_1][\mathcal{V}_2] - [\mathcal{V}_2][\mathcal{V}_1] &= \begin{bmatrix}[w_1]& v_1\\ 0 & 0\end{bmatrix} \begin{bmatrix}[w_2] & v_2 \\ 0 & 0\end{bmatrix} - \begin{bmatrix}[w_2] &v_2 \\ 0 & 0\end{bmatrix}\begin{bmatrix}[w_1] & v_1 \\ 0 & 0\end{bmatrix}\\ &= \begin{bmatrix}[w_1][w_2]-[w_2][w_1] & [w_1]v_2-[w_2]v_1 \\ 0 & 0\end{bmatrix}\\ &= \begin{bmatrix} [w'] & v'\\ 0 & 0 \end{bmatrix} \end{align}
[V1][V2]−[V2][V1]=[[w1]0v10][[w2]0v20]−[[w2]0v20][[w1]0v10]=[[w1][w2]−[w2][w1]0[w1]v2−[w2]v10]=[[w′]0v′0]
[
w
′
v
′
]
=
[
[
w
1
]
0
[
v
1
]
[
w
1
]
]
[
w
2
v
2
]
\begin{bmatrix} w' \\ v' \end{bmatrix} = \begin{bmatrix} [w_1] & 0 \\ [v_1] & [w_1] \end{bmatrix}\begin{bmatrix} w_2\\v_2 \end{bmatrix}
[w′v′]=[[w1][v1]0[w1]][w2v2]
需要注意的是: 这里摘抄自 Modern Robotics , 这份教材里对于角速度与线速度的放置与移动机器人领域中的设定是相反的.
Lie bracket的定义: 给定两个twist
V
1
=
(
w
1
,
v
1
)
\mathcal{V}_1 = (w_1,v_1)
V1=(w1,v1) 以及
V
2
=
(
w
2
,
v
2
)
\mathcal{V}_2 = (w_2, v_2)
V2=(w2,v2),
V
1
\mathcal{V}_1
V1以及
V
2
\mathcal{V}_2
V2的Lie bracket可以写作
[
a
d
V
1
]
V
2
[\rm{ad}_{\mathcal{V}_1}]\mathcal{V}_2
[adV1]V2 或者
a
d
V
1
(
V
2
)
\rm{ad}_{\mathcal{V}_1}(\mathcal{V}_2)
adV1(V2) 被定义为如下形式:
[
[
w
1
]
0
[
v
1
]
[
w
1
]
]
[
w
2
v
2
]
=
[
a
d
V
1
]
V
2
=
a
d
V
1
(
V
2
)
∈
R
6
\begin{bmatrix} [w_1] & 0 \\ [v_1] & [w_1]\\ \end{bmatrix}\begin{bmatrix} w_2\\ v_2 \end{bmatrix} = [\rm{ad}_{\mathcal{V}_1}]\mathcal{V}_2=\rm{ad}_{\mathcal{V}_1}(\mathcal{V}_2) \in \mathbb{R}^{6}
[[w1][v1]0[w1]][w2v2]=[adV1]V2=adV1(V2)∈R6
李代数
s
o
(
3
)
\mathfrak{so}(3)
so(3)
Φ
=
ϕ
∧
=
[
0
−
ϕ
3
ϕ
2
ϕ
3
0
−
ϕ
1
−
ϕ
2
ϕ
1
0
]
∈
R
3
×
3
\boldsymbol{\mathcal{\Phi}} = \phi^{\wedge} = \begin{bmatrix} 0 & - \phi_3 & \phi_2\\ \phi_3 & 0 & -\phi_1\\ -\phi_2 & \phi_1 & 0 \end{bmatrix} \in \mathbb{R}^{3\times 3}
Φ=ϕ∧=
0ϕ3−ϕ2−ϕ30ϕ1ϕ2−ϕ10
∈R3×3
两个向量
ϕ
1
\phi_1
ϕ1与
ϕ
2
\phi_2
ϕ2的李括号为:
[
ϕ
1
,
ϕ
2
]
=
(
ϕ
1
ϕ
2
−
ϕ
2
ϕ
1
)
∨
[\phi_1,\phi_2] = (\boldsymbol{\phi}_1\boldsymbol{\phi}_2-\boldsymbol{\phi}_2\boldsymbol{\phi}_1)^{\vee}
[ϕ1,ϕ2]=(ϕ1ϕ2−ϕ2ϕ1)∨
s o ( 3 ) = { ϕ ∈ R 3 × 3 , ϕ = ϕ ∧ ∈ R 3 × 3 } \mathfrak{so}(3)=\{\boldsymbol{\phi}\in\mathbb{R}^{3\times3},\boldsymbol{\phi}=\phi^{\wedge}\in\mathbb{R}^{3\times3}\} so(3)={ϕ∈R3×3,ϕ=ϕ∧∈R3×3}
s
o
(
3
)
\mathfrak{so}(3)
so(3)通过指数映射与
S
O
(
3
)
SO(3)
SO(3)进行联系:
R
=
e
x
p
(
ϕ
∧
)
.
\mathbf{R} = \rm{exp}(\phi^{\wedge}).
R=exp(ϕ∧).
李代数
s
e
(
3
)
\mathfrak{se}(3)
se(3)
s
e
(
3
)
=
{
ξ
=
[
ρ
ϕ
]
∈
R
6
,
ρ
∈
R
3
,
ϕ
∈
s
o
(
3
)
,
ξ
∧
=
[
ϕ
∧
ρ
0
⊤
0
]
∈
R
4
×
4
}
\mathfrak{se}(3) = \{\xi=\begin{bmatrix}\rho \\ \boldsymbol{\phi} \end{bmatrix} \in \mathbb{R}^{6}, \rho\in \mathbb{R}^3, \boldsymbol{\phi}\in \mathfrak{so}(3), \xi^{\wedge} = \begin{bmatrix} \phi^{\wedge} & \rho \\ 0^{\top} & 0\end{bmatrix}\in \mathbb{R}^{4\times4} \}
se(3)={ξ=[ρϕ]∈R6,ρ∈R3,ϕ∈so(3),ξ∧=[ϕ∧0⊤ρ0]∈R4×4}
s
e
(
3
)
\mathfrak{se}(3)
se(3)的李括号:
[
ξ
1
,
ξ
2
]
=
(
ξ
1
∧
ξ
2
∧
−
ξ
2
∧
ξ
1
∧
)
∨
[\xi_1,\xi_2] = (\xi_1^{\wedge}\xi_2^{\wedge}-\xi_2^{\wedge}\xi_1^{\wedge})^{\vee}
[ξ1,ξ2]=(ξ1∧ξ2∧−ξ2∧ξ1∧)∨
其验证过程可见上面从Modern Robotics中摘抄的部分, 只是角速度与线速度的位置上下需要颠倒.
指数与对数映射
任意矩阵的指数映射可以写成一个泰勒展开, 但是只有在收敛(矩阵中每个元素都收敛)的情况下才会有结果, 其结果仍是一个矩阵:
e
x
p
(
A
)
=
∑
n
=
0
∞
1
n
!
A
n
\rm{exp}(A) = \sum^{\infin}_{n=0}\frac{1}{n!}A^{n}
exp(A)=n=0∑∞n!1An
同样地,对
s
o
(
3
)
\mathfrak{so}(3)
so(3)中的任意元素
ϕ
\boldsymbol{\phi}
ϕ, 我们也可按此方式定义它的指数映射
e
x
p
(
ϕ
∧
)
=
∑
n
=
0
∞
1
n
!
(
ϕ
∧
)
n
\rm{exp}(\boldsymbol{\phi}^{\wedge})=\sum^{\infin}_{n=0}\frac{1}{n!}(\boldsymbol{\phi}^{\wedge})^n
exp(ϕ∧)=n=0∑∞n!1(ϕ∧)n
ϕ
\boldsymbol{\phi}
ϕ是一个三维向量,可以定义出它的长度
θ
\theta
θ 与方向向量
a
\mathbf{a}
a,
ϕ
=
θ
a
\boldsymbol{\phi}=\theta\mathbf{a}
ϕ=θa.
a
∧
a
∧
=
a
a
⊤
−
I
\mathbf{a}^{\wedge}\mathbf{a}^{\wedge} = \mathbf{a}\mathbf{a}^{\top}-\mathbf{I}
a∧a∧=aa⊤−I
a
∧
a
∧
a
∧
=
−
a
∧
\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}\mathbf{a}^{\wedge} = -\mathbf{a}^{\wedge}
a∧a∧a∧=−a∧
e
x
p
(
ϕ
∧
)
=
e
x
p
(
θ
a
∧
)
=
∑
n
=
0
∞
1
n
!
(
θ
a
∧
)
n
=
I
+
θ
a
∧
+
1
2
!
θ
2
a
∧
a
∧
+
1
3
!
θ
3
a
∧
a
∧
a
∧
+
1
4
!
θ
4
(
a
∧
)
4
+
.
.
.
=
a
a
⊤
−
a
∧
a
∧
+
θ
a
∧
+
1
2
!
θ
2
a
∧
a
∧
−
1
3
!
θ
3
a
∧
−
1
4
!
θ
4
(
a
∧
)
4
+
.
.
.
=
a
a
⊤
+
(
θ
−
1
3
!
θ
3
+
1
5
!
θ
5
−
.
.
.
)
a
∧
−
(
1
−
1
2
!
θ
2
+
1
4
!
θ
4
−
.
.
.
)
a
∧
a
∧
=
a
∧
a
∧
+
I
+
s
i
n
θ
a
∧
−
c
o
s
θ
a
∧
a
∧
=
(
1
−
c
o
s
θ
)
a
∧
a
∧
+
s
i
n
θ
a
∧
=
c
o
s
θ
I
+
(
1
−
c
o
s
θ
)
a
a
⊤
+
s
i
n
θ
a
∧
\begin{align} \rm{exp}(\phi^{\wedge})&= exp(\theta\mathbf{a}^{\wedge})= \sum^{\infin}_{n=0}\frac{1}{n!}(\theta\mathbf{a}^{\wedge})^{n}\\ &=I + \theta\mathbf{a}^{\wedge}+\frac{1}{2!}\theta^2\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}+\frac{1}{3!}\theta^3\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}+\frac{1}{4!}\theta^4(\mathbf{a}^{\wedge})^4+...\\ &=\mathbf{a}\mathbf{a}^{\top}-\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}+\theta\mathbf{a}^{\wedge}+\frac{1}{2!}\theta^2\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}-\frac{1}{3!}\theta^3\mathbf{a}^{\wedge}-\frac{1}{4!}\theta^4(\mathbf{a}^{\wedge})^4+...\\ &=\mathbf{a}\mathbf{a}^{\top}+(\theta-\frac{1}{3!}\theta^3+\frac{1}{5!}\theta^5-...)\mathbf{a}^{\wedge}-(1-\frac{1}{2!}\theta^2+\frac{1}{4!}\theta^4-...)\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}\\ &=\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}+I+sin\theta\mathbf{a}^{\wedge}-cos\theta\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}\\ &=(1-cos\theta)\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}+sin\theta\mathbf{a}^{\wedge}\\ &=cos\theta I+(1-cos\theta)\mathbf{a}\mathbf{a}^{\top}+sin\theta\mathbf{a}^{\wedge} \end{align}
exp(ϕ∧)=exp(θa∧)=n=0∑∞n!1(θa∧)n=I+θa∧+2!1θ2a∧a∧+3!1θ3a∧a∧a∧+4!1θ4(a∧)4+...=aa⊤−a∧a∧+θa∧+2!1θ2a∧a∧−3!1θ3a∧−4!1θ4(a∧)4+...=aa⊤+(θ−3!1θ3+5!1θ5−...)a∧−(1−2!1θ2+4!1θ4−...)a∧a∧=a∧a∧+I+sinθa∧−cosθa∧a∧=(1−cosθ)a∧a∧+sinθa∧=cosθI+(1−cosθ)aa⊤+sinθa∧
此即为罗德里格斯公式, 也称为指数映射
对数映射:
ϕ
=
l
n
(
R
)
∨
=
(
∑
n
=
0
∞
−
1
n
n
+
1
(
R
−
I
)
n
+
1
)
∨
.
\boldsymbol{\phi}=ln(R)^{\vee}=(\sum^{\infin}_{n=0}\frac{-1^{n}}{n+1}(R-I)^{n+1})^{\vee}.
ϕ=ln(R)∨=(n=0∑∞n+1−1n(R−I)n+1)∨.
然而实际上, 更多的情况下是采用下面的方式进行转换
R
=
c
o
s
θ
I
+
(
1
−
c
o
s
θ
)
a
a
⊤
+
s
i
n
θ
a
∧
R = cos\theta I+(1-cos\theta)\mathbf{a}\mathbf{a}^{\top}+sin\theta \mathbf{a}^{\wedge}
R=cosθI+(1−cosθ)aa⊤+sinθa∧
t
r
(
R
)
=
c
o
s
θ
t
r
(
I
)
+
(
1
−
c
o
s
θ
)
t
r
(
a
a
⊤
)
+
s
i
n
θ
t
r
(
a
∧
)
=
3
c
o
s
θ
+
(
1
−
c
o
s
θ
)
=
1
+
2
c
o
s
θ
\begin{align} tr(R) &= cos\theta\ tr(I)+ (1-cos\theta)tr(\mathbf{a}\mathbf{a}^{\top})+sin\theta\ tr(\mathbf{a}^{\wedge})\\ &=3cos\theta + (1-cos\theta)\\ &= 1+ 2cos\theta \end{align}
tr(R)=cosθ tr(I)+(1−cosθ)tr(aa⊤)+sinθ tr(a∧)=3cosθ+(1−cosθ)=1+2cosθ
即
θ
=
a
r
c
c
o
s
(
t
r
(
R
)
−
1
2
)
\theta = arccos(\frac{tr(R)-1}{2})
θ=arccos(2tr(R)−1)
SE(3)上的指数映射:
参考链接
e
x
p
(
ξ
∧
)
=
[
∑
n
=
0
∞
1
n
!
(
ϕ
∧
)
n
∑
n
=
0
∞
1
(
n
+
1
)
!
(
ϕ
∧
)
n
ρ
0
⊤
1
]
=
[
R
J
ρ
0
⊤
1
]
=
T
\rm{exp}(\xi^{\wedge})= \begin{bmatrix} \sum^{\infin}_{n=0}\frac{1}{n!}(\phi^{\wedge})^n& \sum^{\infin}_{n=0}\frac{1}{(n+1)!}(\phi^{\wedge})^n\rho\\ 0^{\top} & 1\\ \end{bmatrix} = \begin{bmatrix}R & J\rho \\ 0^{\top} & 1\\ \end{bmatrix} = T
exp(ξ∧)=[∑n=0∞n!1(ϕ∧)n0⊤∑n=0∞(n+1)!1(ϕ∧)nρ1]=[R0⊤Jρ1]=T
此处的J矩阵:
J
=
s
i
n
θ
θ
I
+
(
1
−
s
i
n
θ
θ
)
a
a
⊤
+
1
−
c
o
s
θ
θ
a
∧
J=\frac{sin\theta}{\theta}I+(1-\frac{sin\theta}{\theta})\mathbf{a}\mathbf{a}^{\top}+\frac{1-cos\theta}{\theta}\mathbf{a}^{\wedge}
J=θsinθI+(1−θsinθ)aa⊤+θ1−cosθa∧
起初这里的J矩阵我认为是Modern Robotics中的 G ( θ ) G(\theta) G(θ), 但这样却导不出SLAM十四讲中的相似结果, 主要是J比 G ( θ ) G(\theta) G(θ)多除了一项 θ \theta θ, 后来经过对比发现, MR中是旋量 S θ \mathcal{S}\theta Sθ转换为 S E ( 3 ) SE(3) SE(3)而此处是 s e ( 3 ) se(3) se(3)转换为 S E ( 3 ) SE(3) SE(3).
J矩阵的引出过程:
e
x
p
(
ξ
∧
)
=
∑
n
=
0
∞
1
n
!
[
ϕ
∧
ρ
0
⊤
0
]
n
=
I
+
∑
n
=
1
∞
1
n
!
[
θ
a
∧
ρ
0
⊤
0
]
n
=
[
∑
n
=
0
∞
1
n
!
(
θ
a
∧
)
n
∑
n
=
1
∞
1
n
!
(
θ
a
∧
)
n
−
1
ρ
0
⊤
1
]
\begin{split} \rm{exp}(\xi^{\wedge}) &= \sum^{\infin}_{n=0}\frac{1}{n!}\begin{bmatrix}\boldsymbol{\phi}^{\wedge} & \rho\\ 0^{\top} & 0\end{bmatrix}^n \\ &=I + \sum^{\infin}_{n=1}\frac{1}{n!} \begin{bmatrix}\theta\mathbf{a}^{\wedge} & \rho \\ 0^{\top} & 0\end{bmatrix}^n\\ &= \begin{bmatrix} \sum^{\infin}_{n=0}\frac{1}{n!}(\theta\mathbf{a}^{\wedge})^n & \sum^{\infin}_{n=1}\frac{1}{n!}(\theta\mathbf{a}^{\wedge})^{n-1}\rho\\ 0^{\top} & 1 \end{bmatrix} \end{split}
exp(ξ∧)=n=0∑∞n!1[ϕ∧0⊤ρ0]n=I+n=1∑∞n!1[θa∧0⊤ρ0]n=[∑n=0∞n!1(θa∧)n0⊤∑n=1∞n!1(θa∧)n−1ρ1]
令
n
=
n
−
1
n=n-1
n=n−1, 从而
n
=
n
+
1
n= n+ 1
n=n+1, 带入上式右上角的一项有:
e
x
p
(
ξ
∧
)
=
[
∑
n
=
0
∞
1
n
!
(
θ
a
∧
)
n
∑
n
=
0
∞
1
(
n
+
1
)
!
(
θ
a
∧
)
n
ρ
0
⊤
1
]
\rm{exp}(\xi^{\wedge} ) = \begin{bmatrix}\sum^{\infin}_{n=0}\frac{1}{n!}(\theta\mathbf{a}^{\wedge})^n & \sum^{\infin}_{n=0}\frac{1}{(n+1)!}(\theta\mathbf{a}^{\wedge})^{n}\rho \\ 0^{\top} & 1\\ \end{bmatrix}
exp(ξ∧)=[∑n=0∞n!1(θa∧)n0⊤∑n=0∞(n+1)!1(θa∧)nρ1]
J
=
∑
n
=
0
∞
1
(
n
+
1
)
!
(
θ
a
∧
)
n
=
I
+
1
2
!
(
θ
a
∧
)
+
1
3
!
(
θ
a
∧
)
2
+
⋯
+
1
(
n
+
1
)
!
(
θ
a
∧
)
n
=
I
+
1
2
!
(
θ
a
∧
)
+
1
3
!
(
θ
a
∧
)
2
−
1
4
!
θ
3
a
∧
−
1
5
!
θ
4
(
a
∧
)
2
+
1
6
!
θ
5
(
a
∧
)
+
1
7
!
θ
7
(
a
∧
)
2
+
⋯
=
1
θ
(
1
2
!
θ
2
−
1
4
!
θ
4
+
⋯
)
a
∧
+
1
θ
(
1
3
!
θ
3
−
1
5
!
θ
5
+
⋯
)
(
a
∧
)
2
+
I
\begin{split} J &= \sum^{\infin}_{n=0}\frac{1}{(n+1)!}(\theta\mathbf{a}^{\wedge})^n\\ &= I + \frac{1}{2!}(\theta\mathbf{a}^{\wedge})+ \frac{1}{3!}(\theta\mathbf{a}^{\wedge})^2+\cdots+ \frac{1}{(n+1)!}(\theta\mathbf{a}^{\wedge})^{n}\\ &=I + \frac{1}{2!}(\theta\mathbf{a}^{\wedge})+ \frac{1}{3!}(\theta\mathbf{a}^{\wedge})^2 - \frac{1}{4!}\theta^3\mathbf{a}^{\wedge}-\frac{1}{5!}\theta^4(\mathbf{a}^{\wedge})^2+\frac{1}{6!}\theta^5(\mathbf{a}^{\wedge})+\frac{1}{7!}\theta^7(\mathbf{a}^{\wedge})^2+\cdots\\ &=\frac{1}{\theta}(\frac{1}{2!}\theta^2-\frac{1}{4!}\theta^4+\cdots)\mathbf{a}^{\wedge}+\frac{1}{\theta}(\frac{1}{3!}\theta^3-\frac{1}{5!}\theta^5+\cdots)(\mathbf{a}^{\wedge})^2+I \end{split}
J=n=0∑∞(n+1)!1(θa∧)n=I+2!1(θa∧)+3!1(θa∧)2+⋯+(n+1)!1(θa∧)n=I+2!1(θa∧)+3!1(θa∧)2−4!1θ3a∧−5!1θ4(a∧)2+6!1θ5(a∧)+7!1θ7(a∧)2+⋯=θ1(2!1θ2−4!1θ4+⋯)a∧+θ1(3!1θ3−5!1θ5+⋯)(a∧)2+I
借由
s
i
n
θ
sin\theta
sinθ与
c
o
s
θ
cos\theta
cosθ的展开以及
a
∧
a
∧
=
a
a
⊤
−
I
\mathbf{a}^{\wedge}\mathbf{a}^{\wedge} =\mathbf{a}\mathbf{a}^{\top}-I
a∧a∧=aa⊤−I可以有:
s
i
n
θ
=
θ
−
1
3
!
θ
3
+
1
5
!
θ
5
−
1
7
!
θ
7
+
⋯
c
o
s
θ
=
1
−
1
2
!
θ
2
+
1
4
!
θ
4
−
1
6
!
θ
6
+
⋯
\begin{split} sin\theta & = \theta - \frac{1}{3!}\theta^3+\frac{1}{5!}\theta^5-\frac{1}{7!}\theta^7+\cdots\\ cos\theta &= 1 - \frac{1}{2!}\theta^2 + \frac{1}{4!}\theta^4 -\frac{1}{6!}\theta^6+\cdots\\ \end{split}
sinθcosθ=θ−3!1θ3+5!1θ5−7!1θ7+⋯=1−2!1θ2+4!1θ4−6!1θ6+⋯
J
=
1
θ
(
1
−
c
o
s
θ
)
(
a
∧
)
+
θ
−
s
i
n
θ
θ
(
a
a
⊤
−
I
)
+
I
=
s
i
n
θ
θ
I
+
(
1
−
s
i
n
θ
θ
)
a
a
⊤
+
1
−
c
o
s
θ
θ
a
∧
\begin{split} J &= \frac{1}{\theta}(1-cos\theta)(\mathbf{a}^{\wedge})+ \frac{\theta-sin\theta}{\theta}(\mathbf{a}{\mathbf{a}^{\top}}-I)+I\\ &= \frac{sin{\theta}}{\theta}I+(1-\frac{sin\theta}{\theta})\mathbf{a}\mathbf{a}^{\top}+\frac{1-cos\theta}{\theta}\mathbf{a}^{\wedge} \end{split}
J=θ1(1−cosθ)(a∧)+θθ−sinθ(aa⊤−I)+I=θsinθI+(1−θsinθ)aa⊤+θ1−cosθa∧
Baker-Campbell-Hausdoff公式: BCH公式的引入是为了指出 e x p ( ϕ 1 ∧ ) e x p ( ϕ 2 ∧ ) ≠ e x p ( ( ϕ 1 + ϕ 2 ) ∧ ) . exp(\phi^{\wedge}_1)exp(\phi^{\wedge}_2) \neq exp((\phi_1+\phi_2)^{\wedge}). exp(ϕ1∧)exp(ϕ2∧)=exp((ϕ1+ϕ2)∧). 即 l n ( e x p ( ϕ 1 ∧ ) e x p ( ϕ 2 ∧ ) ) ≠ ϕ 1 ∧ + ϕ 2 ∧ ln(exp(\phi^{\wedge}_1)exp(\phi^{\wedge}_2))\neq\phi^{\wedge}_1+\phi^{\wedge}_2 ln(exp(ϕ1∧)exp(ϕ2∧))=ϕ1∧+ϕ2∧ 同时给出可以用于描述增量的截断公式: l n ( e x p ( A ) e x p ( B ) ) = A + B + 1 2 [ A , B ] + 1 12 [ A , [ A , B ] ] − 1 12 [ B , [ A , B ] ] + ⋯ ln(exp(A)exp(B))= A+B+\frac{1}{2}[A,B]+\frac{1}{12}[A,[A,B]]-\frac{1}{12}[B,[A,B]]+\cdots ln(exp(A)exp(B))=A+B+21[A,B]+121[A,[A,B]]−121[B,[A,B]]+⋯
BCH公式告诉我们, 当处理两个矩阵指数之积时, 它们会产生一些由李括号组成的余项. 特别地, 考虑
S
O
(
3
)
SO(3)
SO(3)上的李代数
l
n
(
e
x
p
(
ϕ
1
∧
)
e
x
p
(
ϕ
2
∧
)
)
∨
ln(exp(\phi^{\wedge}_1)exp(\phi^{\wedge}_2))^{\vee}
ln(exp(ϕ1∧)exp(ϕ2∧))∨, 当
ϕ
1
\phi_1
ϕ1或
ϕ
2
\phi_2
ϕ2为小量, 小量二次以上的项都可以被忽略掉, 此时BCH公式:
l
n
(
e
x
p
(
ϕ
1
∧
)
e
x
p
(
ϕ
2
∧
)
)
∨
≈
{
J
l
(
ϕ
2
)
−
1
ϕ
1
+
ϕ
2
当
ϕ
1
为小量
J
r
(
ϕ
1
)
−
1
ϕ
2
+
ϕ
1
当
ϕ
2
为小量
ln(exp(\phi^{\wedge}_1)exp(\phi^{\wedge}_2))^{\vee} \approx \left\{\begin{matrix} J_l(\phi_2)^{-1}\phi_1+\phi_2 & 当\phi_1为小量 \\ J_r(\phi_1)^{-1}\phi_2+\phi_1 & 当\phi_2为小量 \end{matrix}\right.
ln(exp(ϕ1∧)exp(ϕ2∧))∨≈{Jl(ϕ2)−1ϕ1+ϕ2Jr(ϕ1)−1ϕ2+ϕ1当ϕ1为小量当ϕ2为小量
BCH公式的含义是: 当对一个旋转矩阵
R
2
\mathbf{R}_2
R2(李代数为
ϕ
2
\boldsymbol{\phi}_2
ϕ2)左乘一个微小旋转矩阵
R
1
\mathbf{R}_1
R1(李代数为
ϕ
1
)
\boldsymbol{\phi}_1)
ϕ1)时,可以近似地看作,在原有的李代数
ϕ
2
\boldsymbol{\phi}_2
ϕ2上加上一项
J
l
(
ϕ
2
)
−
1
ϕ
1
J_l(\phi_2)^{-1}\phi_1
Jl(ϕ2)−1ϕ1, 同理, 第二个近似描述了右乘一个微小位移的情况. 于是, 李代数在BCH近似下,分为了左乘近似与右乘近似两种. 在使用时, 我们必须注意是使用的是左乘模型还是右乘模型.
J
l
J_l
Jl实际上就是前面提到的
J
J
J
J
l
=
J
=
s
i
n
θ
θ
I
+
(
1
−
s
i
n
θ
θ
)
a
a
⊤
+
1
−
c
o
s
θ
θ
a
∧
J_l = J = \frac{sin\theta}{\theta}I +(1-\frac{sin\theta}{\theta})\mathbf{a}\mathbf{a}^{\top}+\frac{1-cos\theta}{\theta}\mathbf{a}^{\wedge}
Jl=J=θsinθI+(1−θsinθ)aa⊤+θ1−cosθa∧
它的逆为:
J
l
−
1
=
θ
2
c
o
t
θ
2
I
+
(
1
−
θ
2
c
o
t
θ
2
)
a
a
⊤
−
θ
2
a
∧
\mathbf{J}^{-1}_l = \frac{\theta}{2}cot\frac{\theta}{2}I+(1-\frac{\theta}{2}cot\frac{\theta}{2})\mathbf{a}\mathbf{a}^{\top}-\frac{\theta}{2}\mathbf{a}^{\wedge}
Jl−1=2θcot2θI+(1−2θcot2θ)aa⊤−2θa∧
右乘Jacobian仅需要对自变量取负号即可:
J
r
(
ϕ
)
=
J
l
(
−
ϕ
)
\mathbf{J}_r(\boldsymbol{\phi})=\mathbf{J}_l(-\boldsymbol{\phi})
Jr(ϕ)=Jl(−ϕ)
假定对某个旋转 R \mathbf{R} R, 对应的李代数为 ϕ \boldsymbol{\phi} ϕ, 左乘一个微小旋转, 记作 △ R \bigtriangleup\mathbf{R} △R, 对应的李代数为 △ ϕ \bigtriangleup\mathbf{\phi} △ϕ. 在李群上,得到的结果是 △ R ⋅ R \bigtriangleup\mathbf{R}\cdot\mathbf{R} △R⋅R, 而在李代数上, 根据BCH近似, 为 J l − 1 ( ϕ ) △ ϕ + ϕ \mathbf{J}^{-1}_l(\phi)\bigtriangleup\phi+\phi Jl−1(ϕ)△ϕ+ϕ
e x p ( △ ϕ ∧ ) e x p ( ϕ ∧ ) = e x p ( ( ϕ + J l − 1 ( ϕ ) △ ϕ ) ∧ ) exp(\bigtriangleup\phi^{\wedge})exp(\phi^{\wedge}) = exp((\phi+\mathbf{J}^{-1}_l(\phi)\bigtriangleup\phi)^{\wedge}) exp(△ϕ∧)exp(ϕ∧)=exp((ϕ+Jl−1(ϕ)△ϕ)∧)
反之, 如果在李代数上进行加法, 让一个
ϕ
\phi
ϕ加上
△
ϕ
\bigtriangleup\phi
△ϕ, 可以近似为李群上带左右雅可比的乘法:
e
x
p
(
(
ϕ
+
△
ϕ
)
∧
)
=
e
x
p
(
(
J
l
△
ϕ
)
∧
)
e
x
p
(
ϕ
∧
)
=
e
x
p
(
ϕ
∧
)
e
x
p
(
(
J
r
△
ϕ
∧
)
exp((\phi+\bigtriangleup\phi)^{\wedge}) = exp((\mathbf{J}_l\bigtriangleup\phi)^{\wedge})exp(\phi^{\wedge})=exp(\phi^{\wedge})exp((\mathbf{J}_r\bigtriangleup \phi^{\wedge})
exp((ϕ+△ϕ)∧)=exp((Jl△ϕ)∧)exp(ϕ∧)=exp(ϕ∧)exp((Jr△ϕ∧)
对于SE(3)亦有类似的BCH近似公式:
e
x
p
(
△
ξ
∧
)
e
x
p
(
ξ
∧
)
≈
e
x
p
(
(
J
l
−
1
△
ξ
+
ξ
)
∧
)
e
x
p
(
ξ
∧
)
e
x
p
(
△
ξ
∧
)
≈
e
x
p
(
(
J
r
−
1
△
ξ
+
ξ
)
∧
)
\begin{split} exp(\bigtriangleup\xi^{\wedge})exp(\xi^{\wedge}) &\approx exp((\mathcal{J}^{-1}_{l}\bigtriangleup\xi+\xi)^{\wedge})\\ exp(\xi^{\wedge})exp(\bigtriangleup\xi^{\wedge}) &\approx exp((\mathcal{J}^{-1}_{r}\bigtriangleup\xi+\xi)^{\wedge})\\ \end{split}
exp(△ξ∧)exp(ξ∧)exp(ξ∧)exp(△ξ∧)≈exp((Jl−1△ξ+ξ)∧)≈exp((Jr−1△ξ+ξ)∧)
误差与扰动模型
在SLAM问题中, 相机的位置与姿态是需要去估计的量, 位姿由SO(3)上的旋转矩阵或SE(3)上的变换矩阵进行描述. 设相机的位姿为
T
T
T, 它观察到一个世界坐标位于
p
p
p的点, 产生一个观测数据
z
z
z,
z
=
T
p
+
w
z=Tp+w
z=Tp+w, 由于观测噪声w的存在, z往往不可能精确地满足z=Tp的关系,所以, 计算理想的观测与实际数据的误差:
e
=
z
−
T
p
e = z- Tp
e=z−Tp
假设一共有N个这样的路标点与观测, 于是就有N个上式. 对相机的位姿进行估计, 相当于寻找一个最优的T, 使得整体误差最小化:
m
i
n
T
J
(
T
)
=
∑
i
=
1
N
∣
∣
z
i
−
T
p
i
∣
∣
2
2
\underset{T}{min}J(T) = \sum^{N}_{i=1}||z_i-Tp_i||^2_2
TminJ(T)=i=1∑N∣∣zi−Tpi∣∣22
构建与位姿相关的函数, 然后讨论该函数关于位姿的导数, 以调整当前的估计值.
SLAM十四讲中提到了两种解决方法:
- 用李代数表示姿态, 然后根据李代数加法来对李代数进行求导 ( A Micro Lie Theory论文里的那一套)
- 对李群左乘或右乘微小扰动, 然后对该扰动求导, 称为左/右扰动模型
李代数求导:
对一个空间点p进行旋转, 得到
R
p
Rp
Rp, 要计算旋转之后的坐标相对于旋转的导数, 不严谨地记为:
∂
(
R
p
)
∂
R
\frac{\partial (Rp)}{\partial R}
∂R∂(Rp)
由于
S
O
(
3
)
SO(3)
SO(3)没有加法,所以该导数无法按照导数的定义进行计算.设R对应的李代数为
ϕ
\phi
ϕ, 转而计算:
∂
(
e
x
p
(
ϕ
∧
)
p
)
∂
ϕ
=
l
i
m
∂
ϕ
→
0
e
x
p
(
(
ϕ
+
δ
ϕ
)
∧
)
p
−
e
x
p
(
ϕ
∧
)
p
δ
ϕ
=
l
i
m
∂
ϕ
→
0
e
x
p
(
(
J
l
δ
ϕ
)
∧
)
p
−
e
x
p
(
ϕ
∧
)
p
δ
ϕ
≈
l
i
m
∂
ϕ
→
0
(
I
+
(
J
l
δ
ϕ
)
∧
)
e
x
p
(
ϕ
∧
)
p
−
e
x
p
(
ϕ
∧
)
p
δ
ϕ
=
l
i
m
∂
ϕ
→
0
(
J
l
δ
ϕ
)
∧
e
x
p
(
ϕ
∧
)
p
δ
ϕ
=
l
i
m
∂
ϕ
→
0
−
(
e
x
p
(
ϕ
∧
)
p
)
∧
J
l
δ
ϕ
δ
ϕ
=
−
(
R
p
)
∧
J
l
\begin{split} \frac{\partial (exp(\phi^{\wedge})p)}{\partial \phi} &= \underset{\partial\phi \rightarrow0}{lim} \frac{exp((\phi+\delta\phi)^{\wedge})p-exp(\phi^{\wedge})p}{\delta \phi}\\ &=\underset{\partial\phi \rightarrow0}{lim} \frac{exp((J_l\delta\phi)^{\wedge})p-exp(\phi^{\wedge})p}{\delta \phi}\\ &\approx \underset{\partial\phi \rightarrow0}{lim} \frac{(I+(J_l\delta \phi)^{\wedge})exp(\phi^{\wedge})p-exp(\phi^{\wedge})p}{\delta \phi}\\ &= \underset{\partial\phi \rightarrow0}{lim} \frac{(J_l\delta \phi)^{\wedge}exp(\phi^{\wedge})p}{\delta \phi}\\ &= \underset{\partial\phi \rightarrow0}{lim} \frac{-(exp(\phi^{\wedge})p)^{\wedge}J_l\delta\phi}{\delta \phi}\\ &= -(Rp)^{\wedge}J_l \end{split}
∂ϕ∂(exp(ϕ∧)p)=∂ϕ→0limδϕexp((ϕ+δϕ)∧)p−exp(ϕ∧)p=∂ϕ→0limδϕexp((Jlδϕ)∧)p−exp(ϕ∧)p≈∂ϕ→0limδϕ(I+(Jlδϕ)∧)exp(ϕ∧)p−exp(ϕ∧)p=∂ϕ→0limδϕ(Jlδϕ)∧exp(ϕ∧)p=∂ϕ→0limδϕ−(exp(ϕ∧)p)∧Jlδϕ=−(Rp)∧Jl
第二行为BCH线性近似, 第三行为泰勒展开, 第五行为向量叉乘前后掉转后添加负号. 故
∂ ( R p ) ∂ ϕ = − ( R p ) ∧ J l \frac{\partial (Rp)}{\partial \phi} = -(Rp)^{\wedge}J_l ∂ϕ∂(Rp)=−(Rp)∧Jl
扰动模型:
对R进行一次
△
R
\bigtriangleup R
△R, 这个扰动可以乘在左边也可以乘在右边. 以左扰动为例, 左扰动
△
R
\bigtriangleup R
△R对应的李代数为
φ
\varphi
φ.
∂
(
R
p
)
∂
φ
=
l
i
m
φ
→
0
e
x
p
(
φ
∧
)
e
x
p
(
ϕ
∧
)
p
−
e
x
p
(
ϕ
∧
)
p
φ
\frac{\partial (Rp)}{\partial \varphi} = \underset{\varphi\rightarrow 0}{lim} \frac{exp(\varphi^{\wedge})exp(\phi^{\wedge})p-exp(\phi^{\wedge})p}{\varphi}
∂φ∂(Rp)=φ→0limφexp(φ∧)exp(ϕ∧)p−exp(ϕ∧)p
∂ ( R p ) ∂ φ = l i m φ → 0 e x p ( φ ∧ ) e x p ( ϕ ∧ ) p − e x p ( ϕ ∧ ) p φ ≈ l i m φ → 0 ( I + φ ∧ ) e x p ( ϕ ∧ ) p − e x p ( ϕ ∧ ) p φ = l i m φ → 0 φ ∧ R p φ = l i m φ → 0 − ( R p ) ∧ φ φ = − ( R p ) ∧ \begin{split} \frac{\partial (Rp)}{\partial \varphi} &= \underset{\varphi\rightarrow 0}{lim} \frac{exp(\varphi^{\wedge})exp(\phi^{\wedge})p-exp(\phi^{\wedge})p}{\varphi}\\ &\approx \underset{\varphi\rightarrow 0}{lim} \frac{(I+\varphi^{\wedge})exp(\phi^{\wedge})p-exp(\phi^{\wedge})p}{\varphi}\\ &= \underset{\varphi\rightarrow 0}{lim} \frac{\varphi^{\wedge}Rp}{\varphi}\\ &= \underset{\varphi\rightarrow 0}{lim} \frac{-(Rp)^{\wedge}\varphi}{\varphi} = -(Rp)^{\wedge} \end{split} ∂φ∂(Rp)=φ→0limφexp(φ∧)exp(ϕ∧)p−exp(ϕ∧)p≈φ→0limφ(I+φ∧)exp(ϕ∧)p−exp(ϕ∧)p=φ→0limφφ∧Rp=φ→0limφ−(Rp)∧φ=−(Rp)∧
S E ( 3 ) SE(3) SE(3)上的李代数求导
假设某空间点p经过一次变换T(对应的李代数为 ξ \xi ξ), 得到 T p Tp Tp. 现在,给T左乘一个扰动 △ T = e x p ( δ ξ ∧ ) \bigtriangleup T= exp(\delta \xi^{\wedge}) △T=exp(δξ∧). 扰动项的李代数为 δ ξ = [ δ ρ , δ ϕ ] ⊤ \delta \xi=[\delta \rho,\delta\phi]^{\top} δξ=[δρ,δϕ]⊤.
∂ ( T p ) ∂ δ ξ = l i m δ ξ → 0 e x p ( δ ξ ) ∧ e x p ( ξ ∧ ) p − e x p ( ξ ∧ ) p δ ξ = l i m δ ξ → 0 ( I + δ ξ ∧ ) e x p ( ξ ∧ ) p − e x p ( ξ ∧ ) p δ ξ = l i m δ ξ → 0 δ ξ ∧ e x p ( ξ ∧ ) p δ ξ = l i m δ ξ → 0 [ δ ϕ ∧ δ ρ 0 ⊤ 0 ] [ R p + t 1 ] δ ξ = l i m δ ξ → 0 [ δ ϕ ∧ ( R p + t ) + δ ρ 0 ] δ ξ = [ I − ( R p + t ) ∧ 0 ⊤ 0 ⊤ ] △ = ( T p ) ⊙ \begin{split} \frac{\partial (Tp)}{\partial \delta\xi} &= \underset{\delta\xi\rightarrow 0}{lim} \frac{exp(\delta\xi)^{\wedge}exp(\xi^{\wedge})p-exp(\xi^{\wedge})p}{\delta \xi}\\ &=\underset{\delta\xi\rightarrow 0}{lim} \frac{(I+\delta \xi^{\wedge})exp(\xi^{\wedge})p-exp(\xi^{\wedge})p}{\delta \xi}\\ &=\underset{\delta\xi\rightarrow 0}{lim} \frac{\delta\xi^{\wedge}exp(\xi^{\wedge})p}{\delta \xi}\\ &=\underset{\delta\xi\rightarrow 0}{lim} \frac{\begin{bmatrix}\delta \phi^{\wedge} & \delta\rho\\ 0^{\top}& 0\end{bmatrix}\begin{bmatrix}Rp+t\\1\end{bmatrix}}{\delta \xi}\\ &=\underset{\delta\xi\rightarrow 0}{lim} \frac{\begin{bmatrix}\delta\phi^{\wedge}(Rp+t)+\delta\rho\\0\end{bmatrix}}{\delta \xi}\\ &= \begin{bmatrix}I& -(Rp+t)^{\wedge}\\0^{\top} & 0 ^{\top}\end{bmatrix} \underset{\boldsymbol{=}}{\triangle}(Tp)^{\odot} \end{split} ∂δξ∂(Tp)=δξ→0limδξexp(δξ)∧exp(ξ∧)p−exp(ξ∧)p=δξ→0limδξ(I+δξ∧)exp(ξ∧)p−exp(ξ∧)p=δξ→0limδξδξ∧exp(ξ∧)p=δξ→0limδξ[δϕ∧0⊤δρ0][Rp+t1]=δξ→0limδξ[δϕ∧(Rp+t)+δρ0]=[I0⊤−(Rp+t)∧0⊤]=△(Tp)⊙
SO(3)与SE(3)的伴随性质可见于链接
相似变换群与相应李代数
单目相机具有尺度不确定性.
p
′
=
[
s
R
t
0
⊤
1
]
=
s
R
p
+
t
p'=\begin{bmatrix}sR& t\\ 0^{\top} & 1\end{bmatrix} = sRp+t
p′=[sR0⊤t1]=sRp+t
同时作用于p的3个坐标上, 对p进行了一次放缩. 与SO(3),SE(3)相似, 相似变换亦对矩阵乘法构成群, 称为相似变换群Sim(3):
S
i
m
(
3
)
=
{
S
=
[
s
R
t
0
⊤
1
]
∈
R
4
×
4
}
Sim(3) = \left\{S=\begin{bmatrix}sR& t\\ 0^{\top} & 1\end{bmatrix}\in \mathbb{R}^{4\times 4} \right\}
Sim(3)={S=[sR0⊤t1]∈R4×4}
李代数
s
i
m
(
3
)
\mathfrak{sim}(3)
sim(3)元素为7维向量. 前6维与
s
e
(
3
)
\mathfrak{se}(3)
se(3)相同, 最后多了一项
σ
\sigma
σ.
s
i
m
(
3
)
=
{
ζ
∣
ζ
=
[
ρ
ϕ
σ
]
∈
R
7
,
ζ
∧
=
[
σ
I
+
ϕ
∧
ρ
0
⊤
0
]
∈
R
4
×
4
}
\mathfrak{sim}(3) = \left\{ \zeta | \zeta= \begin{bmatrix}\rho\\ \phi\\ \sigma \end{bmatrix} \in \mathbb{R}^7, \zeta^{\wedge} = \begin{bmatrix}\sigma I+\phi^{\wedge} & \rho \\ 0^{\top} & 0\end{bmatrix}\in \mathbb{R}^{4\times 4} \right\}
sim(3)=⎩
⎨
⎧ζ∣ζ=
ρϕσ
∈R7,ζ∧=[σI+ϕ∧0⊤ρ0]∈R4×4⎭
⎬
⎫
ζ
\zeta
ζ的指数映射为
e
x
p
(
ζ
∧
)
=
[
e
σ
e
x
p
(
ϕ
∧
)
J
s
ρ
0
⊤
1
]
exp(\zeta^{\wedge}) = \begin{bmatrix}e^{\sigma}exp(\phi^{\wedge})& J_s\rho\\ 0^{\top} & 1\\ \end{bmatrix}
exp(ζ∧)=[eσexp(ϕ∧)0⊤Jsρ1]
其中
J
s
J_s
Js的形式为:
J
s
=
e
σ
−
1
σ
I
+
σ
e
σ
s
i
n
θ
+
(
1
−
e
σ
c
o
s
θ
)
θ
a
∧
σ
2
+
θ
2
+
(
e
σ
−
1
σ
−
(
e
σ
c
o
s
θ
−
1
)
σ
+
(
e
σ
s
i
n
θ
)
θ
σ
2
+
θ
2
)
a
∧
a
∧
J_s = \frac{e^{\sigma}-1}{\sigma}I+ \frac{\sigma e^{\sigma}sin\theta+(1-e^{\sigma}cos\theta)\theta \mathbf{a}^{\wedge}}{\sigma^2+\theta^2}+(\frac{e^{\sigma}-1}{\sigma}-\frac{(e^{\sigma}cos\theta-1)\sigma+(e^{\sigma}sin\theta)\theta}{\sigma^2+\theta^2})\mathbf{a}^{\wedge}\mathbf{a}^{\wedge}
Js=σeσ−1I+σ2+θ2σeσsinθ+(1−eσcosθ)θa∧+(σeσ−1−σ2+θ2(eσcosθ−1)σ+(eσsinθ)θ)a∧a∧
旋转部分与SO(3)一致, 平移部分在 s e ( 3 ) \mathfrak{se}(3) se(3)中需要乘以一个雅可比 J \mathcal{J} J, 而相似变换的雅可比更加复杂一些. 对于尺度因子, 可以看到李群中的s即为李代数中的 σ \sigma σ的指数函数.
S
i
m
(
3
)
Sim(3)
Sim(3)的扰动模型:
给予Sp左侧一个小扰动
e
x
p
(
ζ
∧
)
exp(\zeta^{\wedge})
exp(ζ∧),并求Sp对于扰动的导数, 因为Sp是4维的齐次坐标,
ζ
\zeta
ζ是7维向量.该导数可以为
4
×
7
4\times7
4×7的Jacobian.
∂ S p ∂ ζ = [ I − q ∧ q 0 ⊤ 0 ⊤ 0 ] \frac{\partial Sp}{\partial \zeta} = \begin{bmatrix}I & -q^{\wedge} & q\\ 0^{\top} & 0 ^{\top} & 0\\ \end{bmatrix} ∂ζ∂Sp=[I0⊤−q∧0⊤q0]