Visual SLAM的BA问题:构建最小二乘问题

BA问题归结为一个LS(Least Square)问题:
min ⁡ g ( t ) = 1 2 ∑ < i , j > ∈ G f i j ⊤ f i j \min g(\mathbf{t}) = \frac{1}{2} \displaystyle \sum_{<i,j> \in G} \mathbf{f}_{ij}^\top \mathbf{f}_{ij} ming(t)=21<i,j>∈Gfijfij


g = Δ [ ⋮ f i j ⋮ ] \mathbf{g} \stackrel{\Delta}{=} \begin{bmatrix} \vdots \\ \mathbf{f}_{ij} \\ \vdots \end{bmatrix} g=Δ fij

g \mathbf{g} g的雅可比矩阵:
J = Δ ∂ g ∂ t = [ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ 0 ⋯ 0 ∂ f i j ∂ x i 0 ⋯ 0 ∂ f i j ∂ y j 0 ⋯ 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ⋯ ] \mathbf{J} \stackrel{\Delta}{=} \frac{\partial \mathbf{g}}{\partial \mathbf{t}} = \begin{bmatrix} \cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots \\ \vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots \\ \mathbf{0} &\cdots &\mathbf{0} &\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{x}_i} &\mathbf{0} &\cdots &\mathbf{0} &\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{y}_j} &\mathbf{0} &\cdots &\mathbf{0} \\ \vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots &\vdots \\ \cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots &\cdots \end{bmatrix} J=Δtg= 00xifij00yjfij00

H = Δ J ⊤ J \mathbf{H} \stackrel{\Delta}{=}\mathbf{J}^\top \mathbf{J} H=ΔJJ
J i j = Δ [ 0 ⋯ 0 ∂ f i j ∂ x i 0 ⋯ 0 ∂ f i j ∂ y j 0 ⋯ 0 ] \mathbf{J}_{ij} \stackrel{\Delta}{=} \begin{bmatrix} \mathbf{0} &\cdots &\mathbf{0} &\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{x}_i} &\mathbf{0} &\cdots &\mathbf{0} &\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{y}_j} &\mathbf{0} &\cdots &\mathbf{0} \\ \end{bmatrix} Jij=Δ[00xifij00yjfij00]

H = J ⊤ J = ∑ < i , j > ∈ G J i j ⊤ J i j \mathbf{H} = \mathbf{J}^\top \mathbf{J} = \sum_{<i,j> \in G} \mathbf{J}_{ij}^\top \mathbf{J}_{ij} H=JJ=<i,j>∈GJijJij

J i j ⊤ J i j = [ ⋯ 0 ⋯ 0 ⋯ ⋮ ⋮ ⋮ ⋮ ⋮ ⋯ 0 ⋯ 0 ⋯ ⋯ ( ∂ f i j ∂ x i ) ⊤ ∂ f i j ∂ x i ⋯ ( ∂ f i j ∂ x i ) ⊤ ∂ f i j ∂ y j ⋯ ⋯ 0 ⋯ 0 ⋯ ⋮ ⋮ ⋮ ⋮ ⋮ ⋯ 0 ⋯ 0 ⋯ ⋯ ( ∂ f i j ∂ y j ) ⊤ ∂ f i j ∂ x i ⋯ ( ∂ f i j ∂ y j ) ⊤ ∂ f i j ∂ y j ⋯ ⋯ 0 ⋯ 0 ⋯ ⋮ ⋮ ⋮ ⋮ ⋮ ⋯ 0 ⋯ 0 ⋯ ] \mathbf{J}_{ij}^\top \mathbf{J}_{ij} = \begin{bmatrix} \cdots &\mathbf{0} &\cdots &\mathbf{0} &\cdots \\ \vdots &\vdots &\vdots &\vdots &\vdots \\ \cdots &\mathbf{0} &\cdots &\mathbf{0} &\cdots \\ \cdots &(\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{x}_i})^\top \frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{x}_i} &\cdots &(\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{x}_i})^\top \frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{y}_j} &\cdots \\ \cdots &\mathbf{0} &\cdots &\mathbf{0} &\cdots \\ \vdots &\vdots &\vdots &\vdots &\vdots \\ \cdots &\mathbf{0} &\cdots &\mathbf{0} &\cdots \\ \cdots &(\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{y}_j})^\top \frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{x}_i} &\cdots &(\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{y}_j})^\top \frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{y}_j} &\cdots \\ \cdots &\mathbf{0} &\cdots &\mathbf{0} &\cdots \\ \vdots &\vdots &\vdots &\vdots &\vdots \\ \cdots &\mathbf{0} &\cdots &\mathbf{0} &\cdots \\ \end{bmatrix} JijJij= 00(xifij)xifij00(yjfij)xifij0000(xifij)yjfij00(yjfij)yjfij00

遍历observation edges, 根据edge连接的pose vertex id和landmark vertex id去确定在 H \mathbf{H} H里的位置,然后朝里累加数据. 所以看着很简单就能得到 H \mathbf{H} H

b = J ⊤ g \mathbf{b} = \mathbf{J}^\top \mathbf{g} b=Jg:
b = ∑ < i , j > ∈ G J i j ⊤ f i j \mathbf{b} = \sum_{<i,j> \in G} \mathbf{J}_{ij}^\top \mathbf{f}_{ij} b=<i,j>∈GJijfij

J i j ⊤ f i j = [ 0 ⋮ 0 ( ∂ f i j ∂ x i ) ⊤ f i j 0 ⋮ 0 ( ∂ f i j ∂ y i ) ⊤ f i j 0 ⋮ 0 ] \mathbf{J}_{ij}^\top \mathbf{f}_{ij} = \begin{bmatrix} \mathbf{0} \\ \vdots \\ \mathbf{0} \\ (\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{x}_i})^\top \mathbf{f}_{ij} \\ \mathbf{0} \\ \vdots \\ \mathbf{0} \\ (\frac{\partial \mathbf{f}_{ij}}{\partial \mathbf{y}_i})^\top \mathbf{f}_{ij} \\ \mathbf{0} \\ \vdots \\ \mathbf{0} \\ \end{bmatrix} Jijfij= 00(xifij)fij00(yifij)fij00

这样,同样也是遍历observation edges,到edge连接的pose vertex id和landmark vertex id所标识的 b \mathbf{b} b里的位置上去累加数据,即可,也是很easy。

LS问题的核心是求解如下的线性方程组:
H Δ t = b \mathbf{H} \Delta \mathbf{t}= \mathbf{b} HΔt=b

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值