文章目录
基于图的SLAM1
使用因子图表示,节点表示状态,边表示约束,通常形式为:
z i j = h i j ( x i , x j ) + n i j (1) \mathbf{z}_{i j}=\mathbf{h}_{i j}\left(\mathbf{x}_{i}, \mathbf{x}_{j}\right)+\mathbf{n}_{i j} \tag1 zij=hij(xi,xj)+nij(1)
其中 h i j {\bf h}_{ij} hij是状态到测量的映射, n i j {\bf n}_{ij} nij是零均值白噪声
n i j ∼ N ( 0 , Λ i j − 1 ) (2) \mathbf{n}_{i j} \sim \mathcal{N}\left(\mathbf{0}, \mathbf{\Lambda}_{i j}^{-1}\right) \tag2 nij∼N(0,Λij−1)(2)
这就变成了MLE问题:
x ^ = arg min x ∑ ( i , j ) ∈ supp ( z ) ∥ z i j − h i j ( x i , x j ) ∥ Λ i j 2 (3) \hat{\mathbf{x}}=\arg \min _{\mathbf{x}} \sum_{(i, j) \in \operatorname{supp}(\mathbf{z})}\left\|\mathbf{z}_{i j}-\mathbf{h}_{i j}\left(\mathbf{x}_{i}, \mathbf{x}_{j}\right)\right\|_{\Lambda_{i j}}^{2} \tag3 x^=argxmin(i,j)∈supp(z)∑∥zij−hij(xi,xj)∥Λij2(3)
然后就是使用马氏距离,利用迭代的方式求解这个问题。但是由于地图的增长,节点和边增加,变得耗费计算资源。
马尔科夫毯上通过边缘化移除节点
- 最好的线性化点应该是 local state estimate
为了减少代价,使用马尔科夫毯的概念,将节点分为以下几个类别:
x = [ x m T x b T x r T ] T (4) \mathbf{x}=\left[ \begin{array}{lll}{\mathbf{x}_{m}^{T}} & {\mathbf{x}_{b}^{T}} & {\mathbf{x}_{r}^{T}}\end{array}\right]^{T} \tag{4} x=[xmTxbTxrT]T(4)
其中, x m {\bf x}_m xm表示要边缘化掉的节点, x b {\bf x}_b xb表示马尔科夫毯中与边缘化节点直接相连的节点, x r {\bf x}_r xr表示这个图中剩余的节点。
将观测划分为:
{ z b , z r } = { z m , z c , z r } (5) \left\{\mathbf{z}_{b}, \mathbf{z}_{r}\right\}=\left\{\mathbf{z}_{m}, \mathbf{z}_{c}, \mathbf{z}_{r}\right\} \tag5 {
zb,zr}={
zm,zc,zr}(5)
其中 z m {\bf z}_m zm是直接约束 x m {\bf x}_m xm的测量, z b {\bf z}_b zb表示马尔科夫毯中所有的约束, z c {\bf z}_c zc表示马尔科夫毯中除了 z m {\bf z}_m zm其他的约束, z r {\bf z}_r zr表示剩下的约束。
举例,Fig1:
x m = x 1 x b = [ x 0 T , x 2 T , x 3 T ] T x r = x 4 z m = { z 01 , z 12 , z 13 } z c = { z 0 , z 03 , z 23 } z r = { z 04 , z 34 } (6) \begin{aligned} \mathbf{x}_{m}&=\mathbf{x}_{1}\\ \mathbf{x}_{b}&=\left[\mathbf{x}_{0}^{T}, \mathbf{x}_{2}^{T}, \mathbf{x}_{3}^{T}\right]^{T}\\ \mathbf{x}_{r}&=\mathbf{x}_{4} \\ \mathbf{z}_{m}&=\left\{\mathbf{z}_{01}, \mathbf{z}_{12}, \mathbf{z}_{13}\right\}\\ \mathbf{z}_{c}&=\left\{\mathbf{z}_{0}, \mathbf{z}_{03}, \mathbf{z}_{23}\right\}\\ \mathbf{z}_{r}&=\left\{\mathbf{z}_{04}, \mathbf{z}_{34}\right\} \end{aligned} \tag{6} xmxbxrzmzczr=x1=[x0T,x2T,x3T]T=x4={
z01,z12,z13}={
z0,z03,z23}={
z04,z34}(6)
边缘化之后的节点会产生一个先验约束 x b {\bf x}_b xb
p ( x b ∣ z m ) = ∫ x m p ( x b , x m ∣ z m ) d x m = : N ( x ^ b , Λ t − 1 ) (7) p\left(\mathbf{x}_{b} | \mathbf{z}_{m}\right)=\int_{\mathbf{x}_{m}} p\left(\mathbf{x}_{b}, \mathbf{x}_{m} | \mathbf{z}_{m}\right) \mathrm{d} \mathbf{x}_{m}=: \mathcal{N}\left(\hat{\mathbf{x}}_{b}, \mathbf{\Lambda}_{t}^{-1}\right) \tag{7} p(xb∣zm)=∫xmp(xb,xm∣zm)dxm=:N(x^b,Λt−1)(7)
边缘化之后,除了由于线性化导致的误差外,所有的信息都在 z m {\bf z}_m zm中,没有损失。
边缘化后的先验分布
为了得到公式(7)的分布参数( mean and covariance),求解一个最大后验问题:
max p ( x b ∣ z m ) = ∫ x m max p ( x b , x m ∣ z m ) d x m (8) \max p\left(\mathbf{x}_{b} | \mathbf{z}_{m}\right)=\int_{\mathbf{x}_{m}}\max p\left(\mathbf{x}_{b}, \mathbf{x}_{m} | \mathbf{z}_{m}\right) \mathrm{d} \mathbf{x}_{m} \tag8 maxp(xb∣zm)=∫xmmaxp(xb,xm∣zm)dxm(8)
对于 x b , x m {\bf x}_b, {\bf x}_m xb,xm一般没有先验信息,在马尔科夫毯上求解下面的 local MLE 问题:
{ x ^ b , x ^ m } = arg max x b , x m p ( z m ∣ x b , x m ) = arg min x b , x m ∑ ( i , j ) ∈ supp ( z m ) ∥ z i j − h i j ( x i , x j ) ∥ Λ i j 2 (9) {\left\{\hat{\mathbf{x}}_{b}, \hat{\mathbf{x}}_{m}\right\}=\arg \max _{\mathbf{x}_{b}, \mathbf{x}_{m}} p\left(\mathbf{z}_{m} | \mathbf{x}_{b}, \mathbf{x}_{m}\right)=} \\ {\arg \min _{\mathbf{x}_{b}, \mathbf{x}_{m}} \sum_{(i, j) \in \operatorname{supp}\left(\mathbf{z}_{m}\right)}\left\|\mathbf{z}_{i j}-\mathbf{h}_{i j}\left(\mathbf{x}_{i}, \mathbf{x}_{j}\right)\right\|_{\Lambda_{i j}}^{2}} \tag{9} {
x^b,x^m}=argxb,xmmaxp(zm∣xb,xm)=argxb,xmmin(i,j)∈supp(zm)∑∥zij−hij(xi,xj)∥Λij2(9)
公式(9)最终得到的信息矩阵为
Λ = ∑ ( i , j ) ∈ supp ( z m ) H i j ⊤ Λ i j H i j = : [ Λ m m Λ m b Λ b m Λ b b ] (10) \Lambda=\sum_{(i, j) \in \operatorname{supp}\left(\mathbf{z}_{m}\right)} \mathbf{H}_{i j}^{\top} \mathbf{\Lambda}_{i j} \mathbf{H}_{i j}=: \left[ \begin{array}{cc}{\boldsymbol{\Lambda}_{m m}} & {\boldsymbol{\Lambda}_{m b}} \\ {\boldsymbol{\Lambda}_{b m}} & {\boldsymbol{\Lambda}_{b b}}\end{array}\right] \tag{10} Λ=(i,j)∈supp(zm)∑Hij⊤ΛijHij=:[ΛmmΛbmΛmbΛbb](10)
对其进行边缘化得到信息矩阵:
Λ t = Λ b b − Λ b m Λ m m − 1 Λ b m ⊤ (11) \mathbf{\Lambda}_{t}=\mathbf{\Lambda}_{b b}-\boldsymbol{\Lambda}_{b m} \mathbf{\Lambda}_{m m}^{-1} \mathbf{\Lambda}_{b m}^{\top} \tag{11} Λt=Λbb−Λbm