Fast-LIO理论学习

Fast-LIO学习记录

  • IMU离散状态传播
  • 滤波更新
    • 先验分布
    • 最大后验估计
  • 参考资料

IMU离散状态传播

Fast-LIO的离散方程(公式(7))考虑了旋转扰动时的雅可比,其推导如下:

  1. 旋转
    δ θ i + 1 = L o g ( I i + 1 G R ^ T I i + 1 G R ) = L o g ( ( I i G R ^ ⋅ E x p ( ω ^ i Δ t ) T ( I i G R ^ ⋅ E x p ( δ θ i ) ⋅ E x p ( ω i Δ t ) ) ) ≈ L o g ( E x p ( ω ^ i Δ t ) T E x p ( δ θ i ) E x p ( ω ^ i Δ t ) ⋅ E x p ( − J r ( ω ^ i Δ t ) ( δ b g i + n g i ) Δ t ) ) ≈ E x p ( − ω ^ i Δ t ) δ θ i − J r ( ω ^ i Δ t ) Δ t δ b g i − J r ( ω ^ i Δ t ) Δ t n g i \begin{align*} \delta \theta_{i+1} &=Log({}^G_{I_{i+1}}\mathbf{\hat R}^T{}^G_{I_{i+1}} \mathbf{R}) \\ &=Log(({}^G_{I_{i}}\mathbf{\hat R}\cdot Exp(\hat \omega_i\Delta t)^T({}^G_{I_{i}} \mathbf{\hat{R}}\cdot Exp(\delta \theta_i)\cdot Exp(\omega_i\Delta t))) \\ &\approx Log(Exp(\hat \omega_i\Delta t)^TExp(\delta \theta_i) Exp(\hat \omega_i\Delta t)\cdot Exp(-\mathbf{J}r(\hat \omega_i\Delta t)(\delta \mathbf{b}_{g_i}+\mathbf{n}_{g_i})\Delta t)) \\ &\approx Exp(-\hat \omega_i\Delta t)\delta \theta_i-\mathbf{J}r(\hat \omega_i\Delta t)\Delta t\delta \mathbf{b}_{g_i}-\mathbf{J}r(\hat \omega_i\Delta t)\Delta t\mathbf{n}_{g_i} \end{align*} δθi+1=Log(Ii+1GR^TIi+1GR)=Log((IiGR^Exp(ω^iΔt)T(IiGR^Exp(δθi)Exp(ωiΔt)))Log(Exp(ω^iΔt)TExp(δθi)Exp(ω^iΔt)Exp(Jr(ω^iΔt)(δbgi+ngi)Δt))Exp(ω^iΔt)δθiJr(ω^iΔt)ΔtδbgiJr(ω^iΔt)Δtngi
    这里使用了两个公式代换: R E x p ( u ) R T = E x p ( R u ) \mathbf{R}Exp(\mathbf{u})\mathbf{R}^T=Exp(\mathbf{Ru}) RExp(u)RT=Exp(Ru), ω = ω ^ − b g − n g \omega=\hat \omega-\mathbf{b}_g-\mathbf{n}_g ω=ω^bgng
  2. 速度
    δ G v I i + 1 = G v I i + 1 − G v ^ I i + 1 = δ G v I i + G R ^ I i E x p ( δ θ i ) a i Δ t − G R ^ I i a ^ i Δ t + δ G g Δ t ≈ δ G v I i + G R ^ I i ( I + ⌊ δ θ i × ⌋ ) ( a ^ i − δ b a i − n a i ) Δ t − G R ^ I i a ^ i Δ t ≈ − G R ^ I i ⌊ a ^ i × ⌋ Δ t δ θ i + δ G v I i − G R ^ I i Δ t δ b a i + Δ t δ G g − G R ^ I i Δ t δ n a i \begin{aligned} \delta {}^G\mathbf{v}_{I_{i+1}}&={}^G\mathbf{v}_{I_{i+1}}-{}^G\mathbf{\hat{v}}_{I_{i+1}}\\ &=\delta {}^G\mathbf{v}_{I_{i}}+{}^G\mathbf{\hat{R}}_{I_i}Exp(\delta \theta_{i})\mathbf{a}_i\Delta t-{}^G\mathbf{\hat{R}}_{I_i}\mathbf{\hat a}_i\Delta t +\delta {}^G\mathbf{g}\Delta t \\ &\approx \delta {}^G\mathbf{v}_{I_{i}}+{}^G\mathbf{\hat{R}}_{I_i}(\mathbf{I}+\lfloor \delta \theta_{i\times} \rfloor)(\mathbf{\mathbf{ \hat{a}}}_i-\delta \mathbf{b}_{a_i}-\mathbf{n}_{a_i})\Delta t-{}^G\mathbf{\hat{R}}_{I_i}\mathbf{\hat a}_i\Delta t \\ &\approx -{}^G\mathbf{\hat{R}}_{I_i}\lfloor \mathbf{\hat a}_{i\times} \rfloor\Delta t \delta \theta_{i}+\delta {}^G\mathbf{v}_{I_{i}}-{}^G\mathbf{\hat{R}}_{I_i}\Delta t\delta \mathbf{b}_{a_i}+\Delta t\delta {}^G\mathbf{g} -{}^G\mathbf{\hat{R}}_{I_i}\Delta t\delta \mathbf{n}_{a_i} \end{aligned} δGvIi+1=GvIi+1Gv^Ii+1=δGvIi+GR^IiExp(δθi)aiΔtGR^Iia^iΔt+δGgΔtδGvIi+GR^Ii(I+δθi×⌋)(a^iδbainai)ΔtGR^Iia^iΔtGR^Iia^i×Δtδθi+δGvIiGR^IiΔtδbai+ΔtδGgGR^IiΔtδnai
    此处 a = a ^ − b a − n a \mathbf{a}=\mathbf{\hat a}-\mathbf{b}_a-\mathbf{n}_a a=a^bana,与角速度类似。
  3. 平移
    δ G p I i + 1 = G p I i + 1 − G p ^ I i + 1 = δ G p I i + δ G v I i Δ t + 1 2 a i Δ t 2 − 1 2 a ^ i Δ t 2 = Δ t δ G v I i + δ G p I i − 1 2 Δ t 2 δ b a i − 1 2 Δ t 2 n a i \begin{aligned} \delta {}^G\mathbf{p}_{I_{i+1}}&={}^G\mathbf{p}_{I_{i+1}}-{}^G\mathbf{\hat{p}}_{I_{i+1}} \\ &=\delta {}^G\mathbf{p}_{I_{i}}+\delta {}^G\mathbf{{v}}_{I_i}\Delta t+\frac{1}{2}\mathbf{a}_i\Delta t^2-\frac{1}{2}\mathbf{\hat a}_i\Delta t^2 \\ &= \Delta t\delta {}^G\mathbf{{v}}_{I_i}+\delta {}^G\mathbf{p}_{I_{i}}-\frac{1}{2}\Delta t^2\delta \mathbf{b}_{a_i}-\frac{1}{2}\Delta t^2 \mathbf{n}_{a_i}\end{aligned} δGpIi+1=GpIi+1Gp^Ii+1=δGpIi+δGvIiΔt+21aiΔt221a^iΔt2=ΔtδGvIi+δGpIi21Δt2δbai21Δt2nai
    NOTE: R2Live论文在公式(6)中采用了上述的误差定义,但似乎在转移矩阵中忽略了二次项。
  4. 零偏
    δ b g i + 1 = δ b g i + n g i , δ b a i + 1 = δ b a i + n a i \delta \mathbf{b}_{g_{i+1}}=\delta \mathbf{b}_{g_i}+\mathbf{n}_{g_i},\delta \mathbf{b}_{a_{i+1}}=\delta \mathbf{b}_{a_i}+\mathbf{n}_{a_i} δbgi+1=δbgi+ngi,δbai+1=δbai+nai
    NOTE: 此处噪声参数 n \mathbf{n} n是离散值。
  5. 重力加速度
    δ G g i + 1 = δ G g i \delta {}^G\mathbf{g}_{i+1}=\delta {}^G\mathbf{g}_{i} δGgi+1=δGgi

滤波更新

Fast-LIO采用最大后验估计(MAP)构建优化方程,表示为公式(17):
min ⁡ x ~ k κ ( ∥ x k ⊟ x ^ k ∥ P ^ k − 1 2 + ∑ j = 1 m ∥ z j κ + H j κ x ~ k κ ∥ R j − 1 2 ) \min _{\widetilde{\mathbf{x}}_k^\kappa}\left(\left\|\mathbf{x}_k \boxminus \widehat{\mathbf{x}}_k\right\|_{\hat{\mathbf{P}}_k^{-1}}^2+\sum_{j=1}^m\left\|\mathbf{z}_j^\kappa+\mathbf{H}_j^\kappa \widetilde{\mathbf{x}}_k^\kappa\right\|_{\mathbf{R}_j^{-1}}^2\right) x kκmin(xkx kP^k12+j=1m zjκ+Hjκx kκ Rj12)
为了方便表示,Fast-LIO将第二项堆叠成了高维矩阵形式 ∣ ∣ z k κ + H x ~ k κ ∣ ∣ R − 1 2 ||\mathbf{z}_k^\kappa+\mathbf{H}\widetilde{\mathbf{x}}_k^\kappa||_{\mathbf{R}^{-1}}^2 ∣∣zkκ+Hx kκR12

先验分布

对Fast-LIO公式(16)推导如下:
J κ = ∂ ( x ^ k κ ⊞ x ~ k κ ) ⊟ x ^ k ) ∂ x ~ k \mathbf{J}^\kappa=\frac{\partial (\mathbf{\widehat x}_k^\kappa \boxplus \widetilde{\mathbf{x}}_k^\kappa)\boxminus \widehat{\mathbf{x}}_k)}{\partial \widetilde{\mathbf{x}}_k} Jκ=x k(x kκx kκ)x k)
对于旋转,具体表示为:
J θ κ = ∂ L o g ( I k G R ^ T I k G R κ ) ∂ δ θ κ = ∂ L o g ( I k G R ^ T I k G R ^ κ E x p ( δ θ κ ) ) ∂ δ θ κ ≈ ∂ { J r ( L o g ( I k G R ^ T I k G R ^ κ ) ) − 1 δ θ κ + L o g ( I k G R ^ T I k G R ^ κ ) } ∂ δ θ κ = J r ( L o g ( I k G R ^ T I k G R ^ κ ) ) − 1 = J r ( I k G R ^ κ ⊟ I k G R ^ ) − 1 \begin{aligned} \mathbf{J}^\kappa_\theta&=\frac{\partial Log({}^G_{I_k}\mathbf{\hat R}^{T}{}^G_{I_k}\mathbf{R}^\kappa)}{\partial \delta \theta^\kappa} \\ &=\frac{\partial Log({}^G_{I_k}\mathbf{\hat R}^{T}{}^G_{I_k}\mathbf{\hat R}^\kappa Exp(\delta \theta^\kappa))}{\partial \delta \theta^\kappa} \\ &\approx \frac{\partial \{ \mathbf{J}_r(Log({}^G_{I_k}\mathbf{\hat R}^{T}{}^G_{I_k}\mathbf{\hat R}^\kappa))^{-1}\delta \theta^\kappa+Log({}^G_{I_k}\mathbf{\hat R}^{T}{}^G_{I_k}\mathbf{\hat R}^\kappa)\}}{\partial \delta \theta^\kappa} \\ &=\mathbf{J}_r(Log({}^G_{I_k}\mathbf{\hat R}^{T}{}^G_{I_k}\mathbf{\hat R}^\kappa))^{-1} \\ &=\mathbf{J}_r({}^G_{I_k}\mathbf{\hat R}^\kappa \boxminus {}^G_{I_k}\mathbf{\hat R})^{-1} \end{aligned} Jθκ=δθκLog(IkGR^TIkGRκ)=δθκLog(IkGR^TIkGR^κExp(δθκ))δθκ{Jr(Log(IkGR^TIkGR^κ))1δθκ+Log(IkGR^TIkGR^κ)}=Jr(Log(IkGR^TIkGR^κ))1=Jr(IkGR^κIkGR^)1
此处利用了右乘BCH近似公式 L o g ( E x p ( ϕ ) E x p ( δ ϕ ) ) ≈ J r ( ϕ ) − 1 δ ϕ + ϕ Log(Exp(\phi)Exp(\delta \phi))\approx \mathbf{J}_r(\phi)^{-1}\delta \phi+\phi Log(Exp(ϕ)Exp(δϕ))Jr(ϕ)1δϕ+ϕ,其余的状态量雅可比都是单位阵。

最大后验估计

获得 J κ \mathbf{J}^\kappa Jκ之后,可以对第一项进行代换: x k ⊟ x ^ k ≈ x ^ k κ ⊟ x ^ k + J κ x ~ k κ \mathbf{x}_k \boxminus \widehat{\mathbf{x}}_k\approx \mathbf{\widehat x}_k^\kappa \boxminus \widehat{\mathbf{x}}_k+\mathbf{J}^\kappa \widetilde{\mathbf{x}}_k^\kappa xkx kx kκx k+Jκx kκ,如此分离待优化变量 x ~ k κ \widetilde{\mathbf{x}}_k^\kappa x kκ
展开优化方程,并对 x ~ k κ \widetilde{\mathbf{x}}_k^\kappa x kκ求导得到:
x ~ k κ = ( H T R − 1 H + P − 1 ) − 1 ( − H T R − 1 z k κ − ( J κ ) T P ^ k − 1 ( x ^ k κ ⊟ x ^ k ) ) \widetilde{\mathbf{x}}_k^\kappa = (\mathbf{H}^T\mathbf{R}^{-1}\mathbf{H}+\mathbf{P}^{-1})^{-1}(-\mathbf{H}^T\mathbf{R}^{-1}\mathbf{z}_k^\kappa-(\mathbf{J}^{\kappa })^T\mathbf{\hat P}_k^{-1}(\mathbf{\widehat x}_k^\kappa \boxminus \widehat{\mathbf{x}}_k)) x kκ=(HTR1H+P1)1(HTR1zkκ(Jκ)TP^k1(x kκx k))
其中 P = ( J κ ) − 1 P ^ k ( J κ ) − T \mathbf{P}=(\mathbf{J}^{\kappa})^{-1}\mathbf{\hat P}_k(\mathbf{J}^{\kappa})^{-T} P=(Jκ)1P^k(Jκ)T。利用SMW公式 ( A − 1 + B D − 1 C ) − 1 = A − A B ( D + C A B ) − 1 C A (A^{-1}+BD^{-1}C)^{-1}=A-AB(D+CAB)^{-1}CA (A1+BD1C)1=AAB(D+CAB)1CA,可转化为最终结果并以此迭代:
x ~ k κ = − K z k κ − ( I − K H ) ( J κ ) − 1 ( x ^ k κ ⊟ x ^ k ) x k κ + 1 = x k κ ⊞ x ~ k κ \begin{aligned} \widetilde{\mathbf{x}}_k^\kappa&=-\mathbf{K}\mathbf{z}^\kappa_k-(\mathbf{I}-\mathbf{K}\mathbf{H})(\mathbf{J}^\kappa)^{-1}(\mathbf{\widehat x}_k^\kappa \boxminus \widehat{\mathbf{x}}_k)\\ \mathbf{x}_k^{\kappa+1}&=\mathbf{x}_k^{\kappa}\boxplus \widetilde{\mathbf{x}}_k^\kappa \end{aligned} x kκxkκ+1=Kzkκ(IKH)(Jκ)1(x kκx k)=xkκx kκ
NOTE:IEKF与高斯牛顿法在相同的问题条件下是具有等价性的。

参考资料

  1. FAST-LIO: A Fast, Robust LiDAR-inertial Odometry Package by Tightly-Coupled Iterated Kalman Filter
  2. R2LIVE: A Robust, Real-time, LiDAR-Inertial-Visual tightly-coupled state Estimator and mapping
  3. FAST-LIO公式推导
  4. Fast-LIO优化方程推导

你可能感兴趣的:(学习,算法)