我是靠谱客的博主 清新大叔,最近开发中收集的这篇文章主要介绍《视觉slam十四讲》第4讲课后习题_(∠ゝз:)_,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

_(:зゝ∠)_觉得有用点个赞谢谢

1.验证SO(3)、SE(3)和Sim(3)关于乘法成群:

首先看特殊正交群SO(3)的定义:soleft ( 3 right )=left { rin mathbb{r}^{3times 3}|rr^{t}=i, detleft ( r right )=1 right }

定义两个李群r_{1},r_{2}in so(3),要证明这两个李群的积也还是李群,需要满足李群的两个条件:1.自反性:rr^{t} = i,2.行列式为1。实际上我们知道这就是在说正交矩阵中的旋转矩阵。但是这里还是再做一下证明。

证明第一个:

r_{1}*r_{2}*left ( r_{1}*r_{2} right )^{t}=r_{1}*r_{2}*r_{2}^{t}*r_{1}^{t}=r_{1}*left ( r_{2}*r_{2}^{t} right )*r_{1}^{t}\=r_{1}*i*r_{1}^{t}=i

然后证明第二个:

detleft ( r_{1}*r_{2} right )=detleft ( r_{1} right )*detleft ( r_{2} right )=1times 1=1

所以SO(3)关于乘法成群。

然后再看特殊欧氏群SE(3)的定义:se(3)=left { t=left [ begin{matrix} r & t\ 0^{t} & 1 end{matrix} right ]inmathbb{r}^{4times 4}|rin so(3), tin mathbb{r}^{3} right };

同样假设t_{1},t_{2}in se(3),则同样:

t_{1}*t_{2}=left [ begin{matrix} r_{1} &vec{t_{1}} \ 0 & 1 end{matrix} right ]*left [ begin{matrix} r_{2} &vec{t_{2}} \ 0 & 1 end{matrix} right ]=left [ begin{matrix} r_{1}r_{2}+vec{t_{1}}*0 &r_{1}vec{t_{2}}+ vec{t_{1}}*1 \ 0*r_{2}+1*0 & 0*vec{t_{2}}+1*1 end{matrix} right ]\ =left [ begin{matrix} r_{1}r_{2} &r_{1} vec{t_{2}}+vec{t_{1}} \ 0 & 1 end{matrix} right ]

从第一个证明中我们知道r_{1}r_{2} in so(3),从矩阵乘法维度我们知道r_{1} vec{t_{2}}+ vec{t_{1}} inmathbb{r}^{3times 3},所以SE(3)乘法成群。

最后证明相似变换群Sim(3)的定义:sim(3)=left { s=left [ begin{matrix} sr & t\ 0 & 1 end{matrix} right ]inmathbb{r}^{4times 4} right };

跟SE(3)的证明类似,同样假设s_{1},s_{2} in sim(3)

s_{1}*s_{1}=left [ begin{matrix} sr_{1} & vec{t_{1}}\ 0 & 1 end{matrix} right ]left [ begin{matrix} sr_{2} & vec{t_{2}}\ 0 & 1 end{matrix} right ]=left [ begin{matrix} s^{2} r_{1}r_{2}& sr_{1} vec{t_{2}}+vec{t_{1}} \ 0 & 1 end{matrix} right ]

易证得Sim(3)也乘法成群。

 

2.验证left ( mathbb{r}^{3},mathbb{r},times right )构成李代数

在这里times表示外积。我们可以假设任意vec{a}=left ( a_{1},a_{2},a_{3} right ),vec{b}=left ( b_{1},b_{2},b_{3} right ) in mathbb{r}^{3},则要证明李代数需要证明其封闭性、双线性、自反性以及雅克比等价性。以下将会一一证明:

封闭性:

vec{a}times vec{b}=left [ begin{matrix} i & j &k \ a_{1} & a_{2} & a_{3}\ b_{1} & b_{2} & b_{3} end{matrix} right ]=left [ begin{matrix} 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{matrix} right ] in mathbb{r}^{3}

双线性:

再假设vec{c}=left ( c_{1},c_{2},c_{2} right ) in mathbb{r}^{3}alpha , beta in mathbb{r}。则:

left ( alpha vec{a}+beta vec{b} right )times vec{c}=left [ begin{matrix} i & j & k\ alpha a_{1}+beta b_{1} & alpha a_{2}+beta b_{2} & alpha a_{3}+beta b_{3}\ c_{1} & c_{2} & c_{3} end{matrix} right ]\ =left ( alpha a_{2}c_{3}-alpha a_{3}c_{2} right )i+left ( beta b_{2}c_{3}-beta b_{3}c_{2} right )i+(alpha a_{3}c_{1}-alpha a_{1}c_{3})j+left ( beta b_{3}c_{1}-beta b_{1}c_{3} right )j\ +left ( alpha a_{1}c_{2}-alpha a_{2}c_{1} right )k+left ( beta b_{1}c_{2}-beta b_{2}c_{1} right )k\ =alphaleft [ begin{matrix} i & j &k \ a_{1} & a_{2} & a_{3}\ c_{1} & c_{2} & c_{3} end{matrix} right ]+beta left [ begin{matrix} i & j & k\ b_{1} & b_{2} &b_{3} \ c_{1} & c_{2} & c_{3} end{matrix} right ]=alpha vec{a}timesvec{c}+beta vec{b} times vec{c}

同样能证得vec{c} times left ( alpha vec{a}+beta vec{b} right )=alphaleft ( vec{c} times vec{a} right ) + betaleft ( vec{c} times vec{b} right )

自反性:

vec{a} times vec{a} = 0

雅克比等价性

vec{a} times left(vec{b} times vec{c} right ) +vec{c} times left(vec{a} times vec{b} right ) +vec{b} times left(vec{c} times vec{a} right ) =0

 

3.验证so(3)se(3)满足李代数要求的性质。

由定义知so(3)=left { phi in mathbb{r}^{3}, phi =hat{phi } in mathbb{r}^{3times 3} right },根据这个定义对其李代数性质进行验证。

封闭性:

假设phi _{1}, phi_{2} in mathbb{r}^{3 times 3},按李括号运算为:

left [ phi_{1}, phi_{2} right ]=left [ phi_{1}phi_{2}-phi_{2}phi_{1} right ]^{vee }=left [ left [ begin{matrix} 0 & -phi _{1c} & phi_{1b}\ phi_{1c} & 0 & phi_{1a}\ -phi_{1b} & phi_{1a} & 0 end{matrix} right ]left [ begin{matrix} 0 & -phi_{2c} & phi_{2b}\ phi_{2c} & 0 & -phi_{2a}\ -phi_{2b} & phi_{2a} & 0 end{matrix} right ] -left [ begin{matrix} 0 & -phi_{2c} & phi_{2b}\ phi_{2c} & 0 & -phi_{2a}\ -phi_{2b} & phi_{2a} & 0 end{matrix} right ]left [ begin{matrix} 0 & -phi_{1c} & phi_{1b}\ phi_{1c} & 0 & -phi_{1a}\ -phi_{1b} & phi_{1a} & 0 end{matrix} right ]right ]^{vee }\ =left [ begin{matrix} 0 & phi_{1b}phi_{2a}-phi_{1a}phi_{2b} & phi_{1c}phi_{2a}-phi_{1a}phi_{2c}\ phi_{1a}phi_{2b}-phi_{1b}phi_{2a} & 0 & phi_{1c}phi_{2b}-phi_{1b}phi_{2c}\ phi_{1a}phi_{2c}-phi_{1c}phi_{2a} & phi_{1b}phi_{2c}-phi_{1c}phi_{2b} & 0 end{matrix} right ]^{vee } in mathbb{r}^{3 times 3}

观察矩阵各元素,不难发现其为反对称矩阵形式,而且可以记phi_{x}=phi_{1a}phi_{2c}-phi_{1c}phi_{2b},phi_{y}=phi_{1c}phi_{2a}-phi_{1a}phi_{2c}

,phi_{z}=phi_{1a}phi_{2b}-phi_{1b}phi_{2a},则,原式变为begin{bmatrix} 0 & -phi_{z} & phi_{y}\ phi_{z} & 0 & -phi_{a}\ -phi_{y} & phi_{a} & 0 end{bmatrix},这说明so(3)具有封闭性。

双线性:

假设phi_{1},phi_{2},phi_{3}in mathbb{r}^{3 times 3}a,b in mathbb{r}则根据双线性公式定义:

left [ aphi_{1}+bphi_{2}, phi_{3} right ]=left ( aphi_{1}phi_{3}+bphi_{2}phi_{3}-aphi_{3}phi_{1}-bphi_{3}phi_{2}right )^{vee }\ =left [ aleft ( phi_{1}phi_{3}-phi_{3}phi_{1} + bleft ( phi_{2}phi_{3}-phi_{3}phi_{2} right )right ) right ]^{vee }\ =aleft [ phi_{1},phi_{3} right ]+bleft [ phi_2,phi_{3} right ]

同样的方法证明:left [ phi_{3}, aphi_{1}+bphi_{2} right ]=aleft [ phi_{3},phi_{1} right ]+bleft [ phi_{3},phi_{2} right ]

自反性:

left [ phi_{1},phi_{1} right ]=left[ phi_{1}phi_{1}-phi_{1}phi_{1}right]^{vee }=left [ 0 right ]

雅克比等价性

将式子展开计算不难发现:left [ phi_{1},left [ phi_{2},phi_{3} right ] right ]+left [ phi_{3},left [ phi_{1},phi_{2} right ] right ]+left [ phi_{2},left [ phi_{3},phi_{1} right ] right ]=0

se(3)的证明也是类似的,由定义知se(3)=left { xi =left [ begin{matrix} rho \ phi end{matrix} right ] in mathbb{r}^{6},rho in mathbb{r} ^{3}, phi in so(3),hat{xi }=left [ begin{matrix} hat{phi } & rho \ 0 & 0 end{matrix} right ] in mathbb{r}^{4 times 4} right }

首先是封闭性:

left [ xi _{1},xi _{2} right ]=left ( hat{xi _1}hat{xi_{2}}-hat{xi_{2}}hat_{xi_{1}} right )^{vee }=left [ left [ begin{matrix} hat{phi _1} & rho _{1}\ 0 & 0 end{matrix} right ]left [ begin{matrix} hat{phi _{2}} & rho_{2}\ 0 & 0 end{matrix} right ]-left [ begin{matrix} hat{phi _{2}} & rho_{2}\ 0 & 0 end{matrix} right ]left [ begin{matrix} hat{phi_{1}} &rho_{1} \ 0 & 0 end{matrix} right ] right ]^{vee }\ =left [ left [ begin{matrix} hat{phi_{1}}hat_{phi_{2}} & hat{phi_{1}rho_{2}}\ 0 & 0 end{matrix} right ]-left [ begin{matrix} hat{phi_2}hat{phi_1} & hat_{phi_{1}} rho_{1}\ 0 & 0 end{matrix} right ] right ]=left [ begin{matrix} hat{phi_1}hat{phi_{2}}-hat{phi_{2}}hat{phi_{1}} & hat{phi_1}rho_2-hat{phi_2}rho_{1}\ 0 & 0 end{matrix} right ]^{vee } in mathbb{r}^{4 times 4}

(hat{phi_1}hat{phi_2}-hat{phi_2}hat{phi_1})^{vee } in mathbb{r}^{3 times 3}hat{phi_{1}}rho_{2}-hat{phi_2}rho_1 in mathbb{r}^{3}

双线性:

假设hat{xi _1},hat{xi_{2}},hat{xi_{3}} in mathbb{r}^{4 times 4},a,bin mathbb{r},则:

left [ ahat{xi_{1}}+bhat{xi_{2}},hat{xi_{3}} right ]=left ( ahat{xi_{1}}hat{xi_{3}}+bhat{xi_{2}}hat{xi_{3}}-ahat{xi_{3}}hat{xi_{1}}-bhat{xi_{3}}hat{xi_{2}} right )^{vee }=aleft [ hat{xi_{1}},hat{xi_{3}} right ]+bleft [ hat{xi_{2}}, hat{xi_{3}} right ]left [ hat{xi_3} , ahat{xi_{1}}+bhat{xi_{2}}right ]=aleft [ hat{xi_{3}} ,hat{xi_{1}}right ]+bleft [ hat{xi_{3}},hat{xi_{2}} right ]

自反性:

[hat{xi_{1}},hat{xi_{1}}]=(hat{xi_{1}}hat{xi_{1}}-hat{xi_{1}}hat{xi_{1}})^{vee }=0

雅克比等价性自己展开证明。

 

4.验证性质4.20和性质4.21

对于性质4.20,设:

hat{vec{a}}=left [begin{matrix} 0 & -a_{3} & a_{2}\ a_{3} & 0 & -a_{1}\ -a_{2} & a_{1} & 0 end{matrix} right ],则:

hat{vec{a}}hat{vec{a}}=left [ begin{matrix} 0 & -a_{3} & a_{2}\ a_{3} & 0 & -a_{1}\ -a_{2} & a_{1} & 0 end{matrix} right ]left [begin{matrix} 0 & -a_{3} & a_{2}\ a_{3} & 0 & -a_{1}\ -a_{2} & a_{1} & 0 end{matrix} right ]=left [ begin{matrix} -a_{2}^{2}-a_{3}^{2} & a_{1}a_{2} & a_{1}a_{3}\ a_{1}a_{2} & -a_{1}^{2}-a_{3}^{2} & a_{2}a_{3}\ a_{1}a_{3} & a_{2}a_{3} & -a_{1}^{2}-a_{2}^{2} end{matrix} right ],而

aa^{t}=left [ begin{matrix} a_{1}\ a_{2}\ a_{3} end{matrix} right ]left [ begin{matrix} a_{1} & a_{2} &a_{3} end{matrix} right ]=left [ begin{matrix} a_{1}^{2} & a_{1}a_{2} & a_{1}a_{3}\ a_{1}a_{2} & a_{2}^{2} & a_{2}a_{3}\ a_{1}a_{3} & a_{2}a_{3} & a_{3}^{2} end{matrix} right ]aa_{t}-hat{vec{a}}hat{vec{a}}=left [ begin{matrix} a_{1}^{2}+a_{2}^{2}+a_{3}^{2} & 0 & 0\ 0 & a_{1}^{2}+a_{2}^{2}+a_{3}^{2}& 0\ 0 & 0 & a_{1}^{2}+a_{2}^{2}+a_{3}^{2} end{matrix} right ]

由于vec{a}是一个单位向量,所以a_{1}^{2}+a_{2}^{2}+a_{3}^{2}=1,即aa^{t}-i=hat{vec{a}}hat{vec{a}}

同样,对于性质4.21,将hat{vec{a}}hat{vec{a}}hat{vec{a}}展开:

hat{vec{a}}hat{vec{a}}hat{vec{a}}=left [ begin{matrix} 0 & a_{1}^{2}a_{3}+a_{3}(a_{2}^{2}+a_{3}^{2}) & -a_{1}^{2}a_{2}-a_{2}(a_{2}^{2}+a_{3}^{2})\ -a_{2}^{2}a_{3}-a_{3}(a_{1}^{2}+a_{3}^{2}) & 0 & a_{1}a_{2}^{2}+a_{1}(a_{1}^{2}+a_{3}^{2})\ a_{2}a_{3}^{2}+a_{2}(a_{1}^{2}+a_{2}^{2}) & -a_{1}a_{3}^{2}-a_{1}(a_{1}^{2}+a_{2}^{2}) & 0 end{matrix} right ]\ = left [ begin{matrix} 0 & a_{3} & -a_{2}\ -a_{3} & 0 & a_{1}\ a_{2}& -a_{1} & 0 end{matrix} right ]=-hat{vec{a}}

性质4.21得证。

 

5.证明:rhat{p}r^{t}=hat{(rp)}

首先观察等式两边,左边是一个李代数的反对称矩阵hat{p}左乘一个旋转矩阵又右乘这个旋转矩阵的逆(旋转矩阵的逆等于矩阵的转置),右边是这个旋转矩阵乘以这个李代数,然后得到的三维向量取反对称矩阵。我们意识到,这两边最后的运算值是个矩阵。比较两个矩阵恒等有多中办法,比如比较矩阵中各个元素相等等等。矩阵表达的是一种投影关系,

对于本式的证明,网上有些例子是等式两边同乘一个向量/矩阵来证明两边全等,但这推导不出矩阵全等,这只能得到矩阵相似。还有些证明利用结果推导结果,直接将旋转矩阵R从hat{(rp)}中提取出来,明显没这种运算而且这种运算也是明显错误的也当做已知条件进行了证明。目前本人也没有特别好的证明方法,就用一种朴素(硬推)的方法验证我们之前的观察。

首先假设:

r=left [ begin{matrix} vec{r1} & vec{r2} & vec{r3} end{matrix} right ] in mathbb{r}^{3times3},p=left [ begin{matrix} p_{1}\ p_{2}\ p_{3} end{matrix} right ]in mathbb{r}^{3}

我们希望利用旋转矩阵的性质将原等式化简,在等式两边同乘以r^{-1}square r,则等式变为证明:

hat{p}=r^{t}hat{(rp)}r

对于等式右边:

r^{t}hat{(rp)}r=r^{t}hat{(vec{r_{1}} p_{1}+vec{r_{2}} p_{2}+vec{r_{3}} p_{3})}r=r^{t}(p_{1}hat{vec{r_{1}}}+p_{2}hat{vec{r_{2}}}+p_{3}hat{vec{r_{3}}})r\ =r^{t}p_{1}hat{vec{r_{1}}}r+r^{t}p_{2}hat{vec{r_{2}}}r+r^{t}p_{3}hat{vec{r_{3}}}r

我们发现矩阵变成了三块,但是将旋转矩阵的列向量vec{r}提取出来,接下来的化简中我们将会用到旋转矩阵三向量正交的性质将式子再进一步化简。

r^{t}p_{1}hat{vec{r_{1}}}r=p_{1}r^{t}hat{vec{r_{1}}}r=p_{1}left [ begin{matrix} vec{r_{1}}\ vec{r_{2}}\ vec{r_{3}} end{matrix} right ]hat{vec{r_{1}}}left [ begin{matrix} vec{r_{1}} & vec{r_{2}} & vec{r_{3}} end{matrix} right ]\=p_{1}left [ begin{matrix} vec{r_{1}} hat{vec{r_{1}}}vec{r_{1}} & vec{r_{1}} hat{vec{r_{1}}}vec{r_{2}} & vec{r_{1}} hat{vec{r_{1}}}vec{r_{3}}\ vec{r_{2}} hat{vec{r_{1}}}vec{r_{1}} & vec{r_{2}} hat{vec{r_{1}}}vec{r_{2}} & vec{r_{2}} hat{vec{r_{1}}}vec{r_{3}}\ vec{r_{3}} hat{vec{r_{1}}}vec{r_{1}} & vec{r_{3}} hat{vec{r_{1}}}vec{r_{2}} & vec{r_{3}} hat{vec{r_{1}}}vec{r_{3}} end{matrix} right ] =p_{1}left [ begin{matrix} 0 & 0 & 0\ 0 & 0 & -1\ 0 & 1 & 0 end{matrix} right ]=left [ begin{matrix} 0 & 0 & 0\ 0 & 0 & -p_{1}\ 0 & p_{1} & 0 end{matrix} right ]

r^{t}p_{2}hat{vec{r_{2}}}r=left [ begin{matrix} 0 & 0 & p_{2}\ 0 & 0 &0 \ -p_{2} & 0 & 0 end{matrix} right ],r^{t}p_{3}hat{vec{r_{3}}}r=left [ begin{matrix} 0 & -p_{3} & 0\ p_{3} & 0 & 0\ 0 & 0 & 0 end{matrix} right ]

所以:

r^{t}hat{rp}}r=left [ begin{matrix} 0 & 0 & 0\ 0 & 0 & -p_{1}\ 0 & p_{1} & 0 end{matrix} right ]+left [ begin{matrix} 0 & 0 & p_{2}\ 0 & 0 & 0\ -p_{2} & 0 & 0 end{matrix} right ]+left [ begin{matrix} 0 & -p_{3} & 0\ p_{3} & 0 & 0\ 0 & 0 & 0 end{matrix} right ]=left [ begin{matrix} 0 & -p_{3} & p_{2}\ p_{3} & 0 & p_{1}\ -p_{2} & p_{1} & 0 end{matrix} right ] \= hat{p}

 

6.证明SO(3)的伴随性质   rexp(hat{p})r^{t}=exp(hat{(rp)})

这个证明跟上一个证明比较类似,我们可以在上一步的基础上利用泰勒展开指数继续证明。

rexp(hat{p})r^{t}=rsum_{n=0}^{infty }frac{hat{p}^{n}}{n!}r^{t}=sum _{n=0}^{infty }frac{(r hat{p} r^{t}) ^{n}}{n!}=exp(rhat{p}r^{t})=exp(hat{(rp)})

 

7.仿照左扰动的推导,推导SO(3)和SE(3)在右扰动下的导数。

SO(3)的右扰动推导(用到了第5题的结论):

frac{partial (rp)}{partial varphi }=lim_{varphi rightarrow 0}frac{exp(hat{phi})exp(hat{varphi}) p-exp(hat{phi})p } {varphi }approx lim_{varphi rightarrow 0} frac{exp(hat{phi })(i+hat{varphi})p-exp(hat{phi})p}{varphi}\ =lim_{varphi rightarrow 0}frac{rhat{varphi }p}{varphi }=lim_{varphi rightarrow 0}frac{hat{(r varphi )}rp}{varphi }=lim_{varphi rightarrow 0}frac{-hat{(rp)}rvarphi }{varphi }=-hat{(rp)}r

SE(3)的右扰动求导:

frac{partial(tp)}{partial delta xi }=lim_{delta xi rightarrow 0}frac{exp(hat{xi})exp(delta hat{xi})p-exp(hat{xi})p}{delta xi }approx lim_{delta xi rightarrow 0}frac{exp(hat{xi})(i+delta hat{xi})p-exp(hat{xi}) p}{delta xi}\ =lim_{delta xi rightarrow 0}frac{exp(hat{xi}) delta hat{xi}p}{delta xi}=lim_{delta xi rightarrow 0}frac{begin{bmatrix} r & t\ 0 & 1 end{bmatrix}begin{bmatrix} delta hat{phi} &delta rho \ 0 & 1 end{bmatrix} p}{delta xi}=lim_{delta xi rightarrow 0}frac{begin{bmatrix} r delta hat{phi}p + r delta rho\ 0 end{bmatrix}}{delta xi}\ =lim_{delta xi rightarrow 0}frac{begin{bmatrix} -hat{rp} r delta xi + r delta rho\ 0 end{bmatrix}}{delta xi}\ =begin{bmatrix} r & -hat{rp}r\ 0 & 0 end{bmatrix}

 

8.cmake的find_package指令是如何运作的?它有哪些可选参数?为了让cmake找到某个库,需要哪些先决条件?

find_package共有两种模式:模型模式和配置模式。模型模式就是一般见到的一个cmake_models文件夹中包含了各种各样的FindXXX.cmake文件,CMAKE_MODLUES_PATH指定路径执行文件以找到库。而Config模式则是搜索XXX_DIR路径下的XXXConfig.cmake模块进行找库操作。可选参数是解决OpenCV的版本问题?首先得装了然后路径得能访问吧,这个可以参考博客:https://blog.csdn.net/haluoluo211/article/details/80559341

最后

以上就是清新大叔为你收集整理的《视觉slam十四讲》第4讲课后习题_(∠ゝз:)_的全部内容,希望文章能够帮你解决《视觉slam十四讲》第4讲课后习题_(∠ゝз:)_所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部