BCH公式和李代数求导
本文记录BCH公式、李代数求导、伴随矩阵等知识点
BCH公式
两个李代数指数映射乘积,由BCH公式给出:
ln
(
exp
(
A
)
exp
(
B
)
)
=
A
+
B
+
1
2
[
A
,
B
]
+
1
12
[
A
,
[
A
,
B
]
]
−
1
12
[
B
,
[
A
,
B
]
]
+
.
.
.
\ln\left( \exp\left( \mathbf{A} \right) \exp\left( \mathbf{B} \right) \right) = \mathbf{A} + \mathbf{B} + \frac{1}{2}\left\lbrack \mathbf{A},\mathbf{B} \right\rbrack + \frac{1}{12}\left\lbrack \mathbf{A},\left\lbrack \mathbf{A},\mathbf{B} \right\rbrack \right\rbrack - \frac{1}{12}\left\lbrack \mathbf{B},\left\lbrack \mathbf{A},\mathbf{B} \right\rbrack \right\rbrack + ...
ln(exp(A)exp(B))=A+B+21[A,B]+121[A,[A,B]]−121[B,[A,B]]+...
其中 [] 为李括号。
考虑 SO(3) 上的李代数
ln
(
exp
(
ϕ
1
∧
)
exp
(
ϕ
2
∧
)
)
∨
{\ln\left( \exp\left( \boldsymbol{\phi}_{1}^{\land} \right) \exp\left( \boldsymbol{\phi}_{2}^{\land} \right) \right)}^{\vee}
ln(exp(ϕ1∧)exp(ϕ2∧))∨,当
ϕ
1
\boldsymbol{\phi}_{1}
ϕ1 或
ϕ
2
\boldsymbol{\phi}_{2}
ϕ2 为小量时,小量二次以上的项都可以被忽略掉。此时,BCH 拥有线性近似表达:
ln
(
exp
(
ϕ
1
∧
)
exp
(
ϕ
2
∧
)
)
∨
≈
{
J
l
(
ϕ
2
)
−
1
ϕ
1
+
ϕ
2
当
ϕ
1
为小量
J
l
(
ϕ
1
)
−
1
ϕ
2
+
ϕ
1
当
ϕ
2
为小量
{\ln\left( \exp\left( \boldsymbol{\phi}_{1}^{\land} \right) \exp\left( \boldsymbol{\phi}_{2}^{\land} \right) \right)}^{\vee} \approx \left\{ \begin{matrix} {\mathbf{J}_{l}\left( \boldsymbol{\phi}_{2}^{~} \right)^{- 1}\boldsymbol{\phi}_{1}^{~} + \boldsymbol{\phi}_{2}^{~}} & {当\boldsymbol{\phi}_{1}^{~}为小量} \\ {\mathbf{J}_{l}\left( \boldsymbol{\phi}_{1}^{~} \right)^{- 1}\boldsymbol{\phi}_{2}^{~} + \boldsymbol{\phi}_{1}^{~}} & {当\boldsymbol{\phi}_{2}^{~}为小量} \\ \end{matrix} \right.
ln(exp(ϕ1∧)exp(ϕ2∧))∨≈{Jl(ϕ2 )−1ϕ1 +ϕ2 Jl(ϕ1 )−1ϕ2 +ϕ1 当ϕ1 为小量当ϕ2 为小量
左乘 BCH 近似雅可比
J
l
\boldsymbol{J}_l
Jl
J
l
=
J
=
sin
θ
θ
I
+
(
1
−
sin
θ
θ
)
a
a
T
+
1
−
cos
θ
θ
a
∧
\mathbf{J}_{l} = \mathbf{J} = \frac{\sin\theta}{\theta}\mathbf{I} + \left( {1 - \frac{\sin\theta}{\theta}} \right)\mathbf{a}\mathbf{a}^{T} + \frac{1 - {\cos\theta}}{\theta}\mathbf{a}^{\land}
Jl=J=θsinθI+(1−θsinθ)aaT+θ1−cosθa∧
逆为:
J
l
−
1
=
θ
2
cot
θ
2
I
+
(
1
−
θ
2
cot
θ
2
)
a
a
T
−
θ
2
a
∧
{\mathbf{J}_{l}}^{- 1} = \frac{\theta}{2}{\cot\frac{\theta}{2}}\mathbf{I} + \left( {1 - \frac{\theta}{2}{\cot\frac{\theta}{2}}} \right)\mathbf{a}\mathbf{a}^{T} - \frac{\theta}{2}\mathbf{a}^{\land}
Jl−1=2θcot2θI+(1−2θcot2θ)aaT−2θa∧
而右乘雅可比仅需要对自变量取负号即可:
J
r
(
ϕ
)
=
J
l
(
−
ϕ
)
\boldsymbol{J}_{r} ({\boldsymbol{\phi}}) = \boldsymbol{J}_{l} (\boldsymbol{-\phi})
Jr(ϕ)=Jl(−ϕ)
BCH近似的意义:
扰动李代数求导
左扰动雅可比
∂ ( R p ) ∂ φ = lim φ → 0 exp ( φ ∧ ) exp ( ϕ ∧ ) p − exp ( ϕ ∧ ) p φ = lim φ → 0 ( I + φ ∧ ) exp ( ϕ ∧ ) p − exp ( ϕ ∧ ) p φ = lim φ → 0 φ ∧ R p φ = lim φ → 0 − ( R p ) ∧ φ φ = − ( R p ) ∧ \frac{\partial\left( \mathbf{R}\mathbf{p} \right)}{\partial\boldsymbol{\varphi}} = {\lim\limits_{\boldsymbol{\varphi}\rightarrow 0}\frac{\exp\left( \boldsymbol{\varphi}^{\land} \right)\exp\left( \boldsymbol{\phi}^{\land} \right)\mathbf{p} - \exp\left( \boldsymbol{\phi}^{\land} \right)\mathbf{p}}{\boldsymbol{\varphi}}} \\ = {\lim\limits_{\boldsymbol{\varphi}\rightarrow 0}\frac{\left( \mathbf{I} + \boldsymbol{\varphi}^{\land} \right)\exp\left( \boldsymbol{\phi}^{\land} \right)\mathbf{p} - \exp\left( \boldsymbol{\phi}^{\land} \right)\mathbf{p}}{\boldsymbol{\varphi}}} \\ = {\lim\limits_{\boldsymbol{\varphi}\rightarrow 0}\frac{\boldsymbol{\varphi}^{\land}\mathbf{R}\mathbf{p}}{\boldsymbol{\varphi}}} \\ = {\lim\limits_{\boldsymbol{\varphi}\rightarrow 0}\frac{- \left( \mathbf{R}\mathbf{p} \right)^{\land}\boldsymbol{\varphi}}{\boldsymbol{\varphi}}} \\ = - \left( \mathbf{R}\mathbf{p} \right)^{\land} ∂φ∂(Rp)=φ→0limφexp(φ∧)exp(ϕ∧)p−exp(ϕ∧)p=φ→0limφ(I+φ∧)exp(ϕ∧)p−exp(ϕ∧)p=φ→0limφφ∧Rp=φ→0limφ−(Rp)∧φ=−(Rp)∧
右扰动雅可比
∂ ( R p ) ∂ φ = lim φ → 0 exp ( ϕ ∧ ) exp ( φ ∧ ) p − exp ( ϕ ∧ ) p φ = lim φ → 0 exp ( ϕ ∧ ) ( I + φ ∧ ) p − exp ( ϕ ∧ ) p φ = lim φ → 0 R φ ∧ p φ = lim φ → 0 − R p ∧ φ φ = − R p ∧ \frac{\partial\left( {\mathbf{R}\mathbf{p}} \right)}{\partial\boldsymbol{\varphi}} = {\lim\limits_{\boldsymbol{\varphi}\rightarrow 0}\frac{\exp\left( \boldsymbol{\phi}^{\land} \right)\exp\left( \boldsymbol{\varphi}^{\land} \right)\mathbf{p} - \exp\left( \boldsymbol{\phi}^{\land} \right)\mathbf{p}}{\boldsymbol{\varphi}}} \\ = {\lim\limits_{\boldsymbol{\varphi}\rightarrow 0}\frac{\exp\left( \boldsymbol{\phi}^{\land} \right)\left( {\mathbf{I} + \boldsymbol{\varphi}^{\land}} \right)\mathbf{p} - \exp\left( \boldsymbol{\phi}^{\land} \right)\mathbf{p}}{\boldsymbol{\varphi}}} \\ = {\lim\limits_{\boldsymbol{\varphi}\rightarrow 0}\frac{\mathbf{R}\boldsymbol{\varphi}^{\land}\mathbf{p}}{\boldsymbol{\varphi}}} \\ = {\lim\limits_{\boldsymbol{\varphi}\rightarrow 0}\frac{- \mathbf{R}\mathbf{p}^{\land}\boldsymbol{\varphi}}{\boldsymbol{\varphi}}} \\ = - \mathbf{R}\mathbf{p}^{\land} ∂φ∂(Rp)=φ→0limφexp(ϕ∧)exp(φ∧)p−exp(ϕ∧)p=φ→0limφexp(ϕ∧)(I+φ∧)p−exp(ϕ∧)p=φ→0limφRφ∧p=φ→0limφ−Rp∧φ=−Rp∧
旋转连乘的雅可比
d ln ( R 1 R 2 ) ∨ d R 2 = lim ϕ → 0 ln ( R 1 R 2 exp ( ϕ ∧ ) ) ∨ − ln ( R 1 R 2 ) ∨ ϕ = lim ϕ → 0 ln ( R 1 R 2 ) ∨ + J r − 1 ϕ − ln ( R 1 R 2 ) ∨ ϕ = J r − 1 ( ln ( R 1 R 2 ) ∨ ) \frac{d \ln (\bold{R}_1 \bold{R}_2)^{\vee} }{d \bold{R}_2} = \lim_{\boldsymbol{\phi} \to 0} { \frac{ \ln{(\bold{R}_1 \bold{R}_2 \exp( \boldsymbol{\phi}^{ \land } ) )^{\vee}} - \ln{(\bold{R}_1 \bold{R}_2)^{\vee}} }{\boldsymbol{\phi}} } \\ = \lim_{\boldsymbol{\phi} \to 0} { \frac{\ln{(\bold{R}_1 \bold{R}_2 )^{\vee}} + \boldsymbol{J}_r^{-1} \boldsymbol{\phi} - \ln{(\bold{R}_1 \bold{R}_2)^{\vee}}}{\boldsymbol{\phi}} } \\ =\boldsymbol{J}_r^{-1} ( \ln{(\bold{R}_1 \bold{R}_2)^{\vee}} ) dR2dln(R1R2)∨=ϕ→0limϕln(R1R2exp(ϕ∧))∨−ln(R1R2)∨=ϕ→0limϕln(R1R2)∨+Jr−1ϕ−ln(R1R2)∨=Jr−1(ln(R1R2)∨)
注: J r − 1 ( ln ( R 1 R 2 ) ∨ ) \boldsymbol{J}_r^{-1} ( \ln{(\bold{R}_1 \bold{R}_2)^{\vee}}) Jr−1(ln(R1R2)∨) 的意思是计算 φ = ln ( R 1 R 2 ) ∨ \boldsymbol{\varphi}=\ln{(\bold{R}_1 \bold{R}_2)^{\vee}} φ=ln(R1R2)∨,根据 φ \boldsymbol{\varphi} φ 来计算 J r − 1 \boldsymbol{J}_r^{-1} Jr−1 。
其中用到了对
∀
R
\forall \bold{R}
∀R :
ln
(
R
exp
(
ϕ
∧
)
)
∨
=
ln
(
R
)
∨
+
J
r
−
1
ϕ
\ln{(\bold{R} \exp( \boldsymbol{\phi}^{ \land } ) )^{\vee}} = \ln{(\bold{R})^{\vee}} + \boldsymbol{J}_r^{-1} \boldsymbol{\phi}
ln(Rexp(ϕ∧))∨=ln(R)∨+Jr−1ϕ
和
J
r
−
1
\bold{J}^{-1}_{r}
Jr−1 为 SO(3) 上的右雅可比:
J
r
−
1
(
θ
ω
)
=
θ
2
cot
θ
2
I
+
(
1
−
θ
2
cot
θ
2
)
ω
ω
T
+
θ
2
ω
∧
\boldsymbol{J}_r^{-1} (\theta \boldsymbol{\omega}) = \frac{\theta}{2} \cot \frac{\theta}{2} \bold{I} + ( 1 - \frac{\theta}{2} \cot \frac{\theta}{2}) \boldsymbol{\omega} \boldsymbol{\omega} ^{T} + \frac{\theta}{2} \boldsymbol{\omega}^{\land}
Jr−1(θω)=2θcot2θI+(1−2θcot2θ)ωωT+2θω∧
旋转连乘的雅可比
d ln ( R 1 R 2 ) ∨ d R 1 = lim ϕ → 0 ln ( R 1 exp ( ϕ ∧ ) R 2 ) ∨ − ln ( R 1 R 2 ) ∨ ϕ = lim ϕ → 0 ln ( R 1 R 2 exp ( ( R 2 T ϕ ) ∧ ) ) ∨ − ln ( R 1 R 2 ) ∨ ϕ = J r − 1 ( ln ( R 1 R 2 ) ∨ ) R 2 T \frac{d \ln (\bold{R}_1 \bold{R}_2)^{\vee} }{d \bold{R}_1} = \lim_{ \boldsymbol{\phi} \to 0} { \frac{ \ln{(\bold{R}_1 \exp( \boldsymbol{\phi}^{ \land } ) \bold{R}_2 )^{\vee}} - \ln{(\bold{R}_1 \bold{R}_2)^{\vee}} }{\boldsymbol{\phi}} } \\ = \lim_{ \boldsymbol{\phi} \to 0} { \frac{ \ln{ \Big (\bold{R}_1 \bold{R}_2 \exp \big ( ( \bold{R}_2^{T} \boldsymbol{\phi})^{ \land } \big ) \Big )^{\vee}} - \ln{(\bold{R}_1 \bold{R}_2)^{\vee}} }{\boldsymbol{\phi}} } \\ =\boldsymbol{J}_r^{-1} \big ( \ln(\bold{R}_1 \bold{R}_2)^{\vee} \big ) \bold{R}_2^{T} dR1dln(R1R2)∨=ϕ→0limϕln(R1exp(ϕ∧)R2)∨−ln(R1R2)∨=ϕ→0limϕln(R1R2exp((R2Tϕ)∧))∨−ln(R1R2)∨=Jr−1(ln(R1R2)∨)R2T
这里用到了 SO(3) 的伴随性质:
R
T
exp
(
ϕ
∧
)
R
=
exp
(
(
R
T
ϕ
)
∧
)
\bold{R}^T \exp(\boldsymbol{\phi} ^{\land}) \bold{R} = \exp \big( (\bold{R}^T \boldsymbol{\phi}) ^{\land} \big)
RTexp(ϕ∧)R=exp((RTϕ)∧)
有关 SE(3):由于 SE(3) 李代数性质复杂,在 VIO 中,我们通常使用SO(3)和
t
\bold{t}
t 的形式表达旋转和平移。对平移部分使用矢量更新而非SE(3)上的更新。
SO(3)和SE(3)上伴随矩阵的性质
证明:TODO。
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)