a ^ b = q b w ( a w + g w ) + b a + n a ω ^ b = ω b + b ω + n ω \begin{array}{c} \hat{a}_{b}=q_{b w}\left(a^{w}+g^{w}\right)+b_{a}+n_{a} \\ \hat{\omega}_{b}=\omega_{b}+b_{\omega}+n_{\omega} \end{array} a^b=qbw(aw+gw)+ba+naω^b=ωb+bω+nω
其中:
将第 k k k帧和第 k + 1 k+1 k+1帧之间的所有IMU进行积分,可以得到第k+1
帧的位置、速度以及旋转
{ q ˙ = q ⊗ [ 0 , 1 2 w ] T = 1 2 Ω ( w ) q V ˙ = a P ˙ = V ⟹ i n t e g r a t i o n { q ( t + Δ t ) = q ( t ) ⊗ ∫ [ t , t + Δ t ] 1 2 Ω ( w ) q d t V ( t + Δ t ) = V ( t ) + ∫ [ t , t + Δ t ] a d t p ( t + Δ t ) = p ( t ) + ∫ [ t , t + Δ t ] ( V ( t ) + ∫ [ t , t + Δ t ] a d t ) d t \left\{\begin{matrix} \dot{q} & = & q \otimes\left[0, \frac{1}{2} w\right]^{T} & = & \frac{1}{2}\Omega \left (w\right )q \\ \dot{V} & = & a \\ \dot{P} & = & V \end{matrix}\right.\overset{integration}{\Longrightarrow }\left\{\begin{matrix} q\left(t+\Delta t\right ) & = & q\left(t\right )\otimes\int_{\left[t, t+\Delta t\right] }{\frac{1}{2}\Omega \left (w\right )q}dt \\ V\left(t+\Delta t\right ) & = & V\left(t\right ) + \int_{\left[t, t+\Delta t\right]}{a}dt \\ p\left(t+\Delta t\right ) & = & p\left(t\right ) + \int_{\left[t, t+\Delta t\right]}{\left (V\left(t\right ) + \int_{\left[t, t+\Delta t\right]}{a}dt\right)}dt \end{matrix}\right. ⎩ ⎨ ⎧q˙V˙P˙===q⊗[0,21w]TaV=21Ω(w)q⟹integration⎩ ⎨ ⎧q(t+Δt)V(t+Δt)p(t+Δt)===q(t)⊗∫[t,t+Δt]21Ω(w)qdtV(t)+∫[t,t+Δt]adtp(t)+∫[t,t+Δt](V(t)+∫[t,t+Δt]adt)dt
将IMU的测量模型代入,得到连续形式:
p b k + 1 w = p b k w + v b k w Δ t k + ∬ t ∈ [ t k , t k + 1 ] ( R t w ( a ^ t − b a t − n a ) − g w ) d t 2 v b k + 1 w = v b k w + ∫ t ∈ [ t k , t k + 1 ] ( R t w ( a ^ t − b a t − n a ) − g w ) d t q b k + 1 w = q b k w ⊗ ∫ t ∈ [ t k , t k + 1 ] 1 2 Ω ( w ^ t − b w t − n w ) q t b k d t \begin{array}{l} \mathbf{p}_{b_{k+1}}^{w}=\mathbf{p}_{b_{k}}^{w}+\mathbf{v}_{b_{k}}^{w} \Delta t_{k}+\iint_{t \in\left[t_{k}, t_{k+1}\right]}\left(\mathbf{R}_{t}^{w}\left(\hat{a}_{t}-b_{a_{t}}-n_{a}\right)-g^{w}\right) d t^{2} \\ \mathbf{v}_{b_{k+1}}^{w}=\mathbf{v}_{b_{k}}^{w}+\int_{t \in\left[t_{k}, t_{k+1}\right]}\left(\mathbf{R}_{t}^{w}\left(\hat{a}_{t}-b_{a_{t}}-n_{a}\right)-g^{w}\right) d t \\ \mathbf{q}_{b_{k+1}}^{w}=\mathbf{q}_{b_{k}}^{w} \otimes \int_{t \in\left[t_{k}, t_{k+1}\right]} \frac{1}{2} \Omega\left(\hat{w}_{t}-b_{w_{t}}-n_{w}\right) \mathbf{q}_{t}^{b_{k}} d t \end{array} pbk+1w=pbkw+vbkwΔtk+∬t∈[tk,tk+1](Rtw(a^t−bat−na)−gw)dt2vbk+1w=vbkw+∫t∈[tk,tk+1](Rtw(a^t−bat−na)−gw)dtqbk+1w=qbkw⊗∫t∈[tk,tk+1]21Ω(w^t−bwt−nw)qtbkdt
其中:
Ω = [ − [ ω ] × ω − ω T 0 ] , [ ω ] × = [ 0 − ω z ω y ω z 0 ω x − ω y ω x 0 ] \Omega=\left[\begin{array}{cc} -[\omega]_{\times} & \omega \\ -\omega^{T} & 0 \end{array}\right],[\omega]_{\times}=\left[\begin{array}{ccc} 0 & -\omega_{z} & \omega_{y} \\ \omega_{z} & 0 & \omega_{x} \\ -\omega_{y} & \omega_{x} & 0 \end{array}\right] Ω=[−[ω]×−ωTω0],[ω]×= 0ωz−ωy−ωz0ωxωyωx0
其中, w = w ^ t − b w t − n w w=\hat{w}_t-b_{w_{t}}-n_{w} w=w^t−bwt−nw
进行中值积分,然后得到i+1
时刻的位置、速度以及旋转(PVQ)
中值积分:
a ^ ‾ i = 1 2 [ q i ( a ^ i − b a i ) − g w + q i + 1 ( a ^ i + 1 − b a i ) − g w ] . w ^ ‾ i = 1 2 ( w ^ i + w ^ i + 1 ) − b w i \begin{array}{l} \overline{\hat{a}}_{i}=\frac{1}{2}\left[\mathbf{q}_{i}\left(\hat{a}_{i}-b_{a_{i}}\right)-g^{w}+\mathbf{q}_{i+1}\left(\hat{a}_{i+1}-b_{a_{i}}\right)-g^{w}\right]. \\ \overline{\hat{w}}_{i}=\frac{1}{2}\left(\hat{w}_{i}+\hat{w}_{i+1}\right)-b_{w_{i}} \end{array} a^i=21[qi(a^i−bai)−gw+qi+1(a^i+1−bai)−gw].w^i=21(w^i+w^i+1)−bwi
离散形式:
p b i + 1 w = p b i w + v b i w δ t + 1 2 a ^ ‾ i δ t 2 v b i + 1 w = v b i w + a ^ ‾ i δ t q b i + 1 w = q b i w ⊗ [ 1 1 2 w ^ ‾ i δ t ] \begin{array}{l} \mathbf{p}_{b_{i+1}}^{w}=\mathbf{p}_{b_{i}}^{w}+\mathbf{v}_{b_{i}}^{w} \delta t+\frac{1}{2} \overline{\hat{a}}_{i} \delta t^{2} \\ \mathbf{v}_{b_{i+1}}^{w}=\mathbf{v}_{b_{i}}^{w}+\overline{\hat{a}}_{i} \delta t \\ \mathbf{q}_{b_{i+1}}^{w}=\mathbf{q}_{b_{i}}^{w} \otimes\left[\begin{array}{c} 1 \\ \frac{1}{2} \overline{\hat{w}}_{i} \delta t \end{array}\right] \end{array} pbi+1w=pbiw+vbiwδt+21a^iδt2vbi+1w=vbiw+a^iδtqbi+1w=qbiw⊗[121w^iδt]
优化的变量为:
x k = [ p b k w , v b k w , q b k w , b a , b g ] x_{k}=\left[p_{b_{k}}^{w}, v_{b_{k}}^{w}, q_{b_{k}}^{w}, b_{a}, b_{g}\right] xk=[pbkw,vbkw,qbkw,ba,bg]
IMU的积分构建为帧间约束,其次P和V与第 k k k时刻的状态有关,做优化时需要迭代更新第k时刻的状态,导致需要每次重新计算积分,为了不要使IMU积分量与优化变量有关,因此将积分从世界坐标系变换到第k帧的载体坐标系,公式两边左右各乘 R w b k R_{w}^{b_{k}} Rwbk,从而得到:
R w b k p b k + 1 w = R w b k ( p b k w + v b k w Δ t k − 1 2 g w Δ t k 2 ) + α b k + 1 b k R w b k v b k + 1 w = R w b k ( v b k w − g w Δ t k ) + β b k + 1 b k q w b k ⊗ q b k + 1 w = γ b k + 1 b k \begin{array}{c} \mathbf{R}_{w}^{b_{k}} \mathbf{p}_{b_{k+1}}^{w} = \mathbf{R}_{w}^{b_{k}}\left(\mathbf{p}_{b_{k}}^{w}+\mathbf{v}_{b_{k}}^{w} \Delta t_{k}-\frac{1}{2} g^{w} \Delta t_{k}^{2}\right)+\alpha_{b_{k+1}}^{b_{k}} \\ \mathbf{R}_{w}^{b_{k}} \mathbf{v}_{b_{k+1}}^{w} = \mathbf{R}_{w}^{b_{k}}\left(\mathbf{v}_{b_{k}}^{w}-g^{w} \Delta t_{k}\right)+\beta_{b_{k+1}}^{b_{k}} \\ \mathbf{q}_{w}^{b_{k}} \otimes \mathbf{q}_{b_{k+1}}^{w} = \gamma_{b_{k+1}}^{b_{k}} \end{array} Rwbkpbk+1w=Rwbk(pbkw+vbkwΔtk−21gwΔtk2)+αbk+1bkRwbkvbk+1w=Rwbk(vbkw−gwΔtk)+βbk+1bkqwbk⊗qbk+1w=γbk+1bk
其中:
α b k + 1 b k = ∬ t ∈ [ t k , t k + 1 ] R t b k ( a ^ t − b a t − n a ) d t 2 β b k + 1 b k = ∫ t ∈ [ t k , t k + 1 ] R t b k ( a ^ t − b a t − n a ) d t γ b k + 1 b k = ∫ t ∈ [ t k , , t k + 1 ] 1 2 Ω ( w ^ t − b w t − n w ) γ t b k d t \begin{aligned} \alpha_{b_{k+1}}^{b_{k}} & =\iint_{t \in\left[t_{k}, t_{k+1}\right]} \mathbf{R}_{t}^{b_{k}}\left(\hat{a}_{t}-b_{a_{t}}-n_{a}\right) d t^{2} \\ \beta_{b_{k+1}}^{b_{k}} & =\int_{t \in\left[t_{k}, t_{k+1}\right]} \mathbf{R}_{t}^{b_{k}}\left(\hat{a}_{t}-b_{a_{t}}-n_{a}\right) d t \\ \gamma_{b_{k+1}}^{b_{k}} & =\int_{t \in\left[t_{k,}, t_{k+1}\right]} \frac{1}{2} \Omega\left(\hat{w}_{t}-b_{w_{t}}-n_{w}\right) \gamma_{t}^{b_{k}} d t \end{aligned} αbk+1bkβbk+1bkγbk+1bk=∬t∈[tk,tk+1]Rtbk(a^t−bat−na)dt2=∫t∈[tk,tk+1]Rtbk(a^t−bat−na)dt=∫t∈[tk,,tk+1]21Ω(w^t−bwt−nw)γtbkdt
预积分项仅与IMU测量有关,而与被优化的状态量无关,此时的 α b k + 1 b k \alpha_{b_{k+1}}^{b_{k}} αbk+1bk, β b k + 1 b k \beta_{b_{k+1}}^{b_{k}} βbk+1bk, γ b k + 1 b k \gamma_{b_{k+1}}^{b_{k}} γbk+1bk可以视为 b k + 1 b_{k+1} bk+1与 b k b_{k} bk之间的相对运动, b k b_k bk的状态改变并不会对其产生影响,因此将其作为非线性优化变量,可以避免状态的重复传递
注意:
α b k + 1 b k \alpha_{b_{k+1}}^{b_{k}} αbk+1bk, β b k + 1 b k \beta_{b_{k+1}}^{b_{k}} βbk+1bk, γ b k + 1 b k \gamma_{b_{k+1}}^{b_{k}} γbk+1bk与IMU的bais有关,而bais也是需要优化的变量,这将导致的问题是:当每次迭代时,我们得到一个新的bais ,还需要根据预积分项重新对第k帧和第k+1帧之间的IMU预积分,非常耗时
解决方法:当bias变换很小时,对bias进行一阶近似调整 α b k + 1 b k \alpha_{b_{k+1}}^{b_{k}} αbk+1bk, β b k + 1 b k \beta_{b_{k+1}}^{b_{k}} βbk+1bk, γ b k + 1 b k \gamma_{b_{k+1}}^{b_{k}} γbk+1bk,避免重新计算,但是在预积分的过程中还要逐步计算其误差的雅可比矩阵
α b k + 1 b k ≈ α ^ b k + 1 b k + J b a α δ b a k + J b w α δ b w k β b k + 1 b k ≈ β ^ b k + 1 b k + J b a β δ b a k + J b w β δ b w k γ b k + 1 b k ≈ γ ^ b k + 1 b k ⊗ [ 1 1 2 J b w γ δ b w k ] \begin{array}{l} \alpha_{b_{k+1}}^{b_{k}} \approx \hat{\alpha}_{b_{k+1}}^{b_{k}}+\mathbf{J}_{b_{a}}^{\alpha} \delta b_{a_{k}}+\mathbf{J}_{b_{w}}^{\alpha} \delta b_{w_{k}} \\ \beta_{b_{k+1}}^{b_{k}} \approx \hat{\beta}_{b_{k+1}}^{b_{k}}+\mathbf{J}_{b_{a}}^{\beta} \delta b_{a_{k}}+\mathbf{J}_{b_{w}}^{\beta} \delta b_{w_{k}} \\ \gamma_{b_{k+1}}^{b_{k}} \approx \hat{\gamma}_{b_{k+1}}^{b_{k}} \otimes\left[\begin{array}{c} 1 \\ \frac{1}{2} \mathbf{J}_{b_{w}}^{\gamma} \delta b_{w_{k}} \end{array}\right] \end{array} αbk+1bk≈α^bk+1bk+Jbaαδbak+Jbwαδbwkβbk+1bk≈β^bk+1bk+Jbaβδbak+Jbwβδbwkγbk+1bk≈γ^bk+1bk⊗[121Jbwγδbwk]
其中:
J b u α = δ α b k b k + 1 δ b a k , J b ω α = δ α b k b k + 1 δ b ω k , J b α β = δ β b k b k + 1 δ b a k , J b ω β = δ β b k b k + 1 δ b ω k , J b ω γ = δ γ b k b k + 1 δ b ω k J_{b_{u}}^{\alpha}=\frac{\delta \alpha_{b_{k}}^{b_{k+1}}}{\delta b_{a_{k}}}, J_{b_{\omega}}^{\alpha}=\frac{\delta \alpha_{b_{k}}^{b_{k+1}}}{\delta b_{\omega_{k}}}, J_{b_{\alpha}}^{\beta}=\frac{\delta \beta_{b_{k}}^{b_{k+1}}}{\delta b_{a_{k}}}, J_{b_{\omega}}^{\beta}=\frac{\delta \beta_{b_{k}}^{b_{k+1}}}{\delta b_{\omega_{k}}}, J_{b_{\omega}}^{\gamma}=\frac{\delta \gamma_{b_{k}}^{b_{k+1}}}{\delta b_{\omega_{k}}} Jbuα=δbakδαbkbk+1,Jbωα=δbωkδαbkbk+1,Jbαβ=δbakδβbkbk+1,Jbωβ=δbωkδβbkbk+1,Jbωγ=δbωkδγbkbk+1