传感器融合:基于ESKF的IMU+GPS数据融合

Overview

欢迎访问 持续更新https://spatial-ai.net/sensorfusion-imu-gnss.html

System State Vector

the nominal-state x \mathbf{x} x and the error-state δ x \delta \mathbf{x} δx

x = [ p v q b a b g ] ∈ R 16 × 1 δ x = [ δ p δ v δ θ δ b a δ b g ] ∈ R 15 × 1 \mathbf{x} = \begin{bmatrix} \mathbf{p} \\ \mathbf{v} \\ \mathbf{q} \\ \mathbf{b}_a \\ \mathbf{b}_g \end{bmatrix} \in \mathbb{R}^{16 \times 1} \quad \delta \mathbf{x} = \begin{bmatrix} \delta \mathbf{p} \\ \delta \mathbf{v} \\ \delta \boldsymbol{\theta} \\ \delta \mathbf{b}_a \\ \delta \mathbf{b}_g \end{bmatrix} \in \mathbb{R}^{15 \times 1} x=pvqbabgR16×1δx=δpδvδθδbaδbgR15×1

the true-state

x ^ t = x ⊕ δ ^ x \hat{\mathbf{x}}_{t}=\mathbf{x} \oplus \hat{\delta} \mathbf{x} x^t=xδ^x

ENU Coordinate

  • using ENU coordinate
  • in ENU coordinate, g = [ 0 0 − 9.81007 ] T \mathbf{g} = \begin{bmatrix} 0 & 0 & -9.81007 \end{bmatrix}^T g=[009.81007]T
  • extrinsic between IMU and GPS: I p G p s {{}^{I} \mathbf{p}}_{G p s} IpGps

State Prediction (IMU-driven system kinematics in discrete time)

The nominal state kinematics

p ← p + v Δ t + 1 2 ( R ( a m − a b ) + g ) Δ t 2 v ← v + ( R ( a m − a b ) + g ) Δ t q ← q ⊗ q { ( ω m − ω b ) Δ t } a b ← a b ω b ← ω b \begin{array}{l} \mathbf{p} \leftarrow \mathbf{p}+\mathbf{v} \Delta t+\frac{1}{2}\left(\mathbf{R}\left(\mathbf{a}_{m}-\mathbf{a}_{b}\right)+\mathbf{g}\right) \Delta t^{2} \\ \mathbf{v} \leftarrow \mathbf{v}+\left(\mathbf{R}\left(\mathbf{a}_{m}-\mathbf{a}_{b}\right)+\mathbf{g}\right) \Delta t \\ \mathbf{q} \leftarrow \mathbf{q} \otimes \mathbf{q}\left\{\left(\boldsymbol{\omega}_{m}-\boldsymbol{\omega}_{b}\right) \Delta t\right\} \\ \mathbf{a}_{b} \leftarrow \mathbf{a}_{b} \\ \boldsymbol{\omega}_{b} \leftarrow \boldsymbol{\omega}_{b} \end{array} pp+vΔt+21(R(amab)+g)Δt2vv+(R(amab)+g)Δtqqq{(ωmωb)Δt}ababωbωb

The error-state kinematics

δ p ← δ p + δ v Δ t δ v ← δ v + ( − R [ a m − a b ] × δ θ − R δ a b + δ g ) Δ t + v i δ θ ← R ⊤ { ( ω m − ω b ) Δ t } δ θ − δ ω b Δ t + θ i δ a b ← δ a b + a i δ ω b ← δ ω b + ω i δ g ← δ g \begin{aligned} \delta \mathbf{p} & \leftarrow \delta \mathbf{p}+\delta \mathbf{v} \Delta t \\ \delta \mathbf{v} & \leftarrow \delta \mathbf{v}+\left(-\mathbf{R}\left[\mathbf{a}_{m}-\mathbf{a}_{b}\right]_{\times} \delta \boldsymbol{\theta}-\mathbf{R} \delta \mathbf{a}_{b}+\delta \mathbf{g}\right) \Delta t+\mathbf{v}_{\mathbf{i}} \\ \delta \boldsymbol{\theta} & \leftarrow \mathbf{R}^{\top}\left\{\left(\boldsymbol{\omega}_{m}-\boldsymbol{\omega}_{b}\right) \Delta t\right\} \delta \boldsymbol{\theta}-\delta \boldsymbol{\omega}_{b} \Delta t+\boldsymbol{\theta}_{\mathbf{i}} \\ \delta \mathbf{a}_{b} & \leftarrow \delta \mathbf{a}_{b}+\mathbf{a}_{\mathbf{i}} \\ \delta \boldsymbol{\omega}_{b} & \leftarrow \delta \boldsymbol{\omega}_{b}+\boldsymbol{\omega}_{\mathbf{i}} \\ \delta \mathbf{g} & \leftarrow \delta \mathbf{g} \end{aligned} δpδvδθδabδωbδgδp+δvΔtδv+(R[amab]×δθRδab+δg)Δt+viR{(ωmωb)Δt}δθδωbΔt+θiδab+aiδωb+ωiδg

where

V i = σ a ~ n 2 Δ t 2 I [ m 2 / s 2 ] Θ i = σ ω ~ n 2 Δ t 2 I [ r a d 2 ] A i = σ a w 2 Δ t I [ m 2 / s 4 ] Ω i = σ ω w 2 Δ t I [ r a d 2 / s 2 ] \begin{array}{ll} \mathbf{V}_{\mathbf{i}}=\sigma_{\tilde{\mathbf{a}}_{n}}^{2} \Delta t^{2} \mathbf{I} & {\left[m^{2} / s^{2}\right]} \\ \Theta_{\mathbf{i}}=\sigma_{\tilde{\boldsymbol{\omega}}_{n}}^{2} \Delta t^{2} \mathbf{I} & {\left[r a d^{2}\right]} \\ \mathbf{A}_{\mathbf{i}}=\sigma_{\mathbf{a}_{w}}^{2} \Delta t \mathbf{I} & {\left[m^{2} / s^{4}\right]} \\ \boldsymbol{\Omega}_{\mathbf{i}}=\sigma_{\boldsymbol{\omega}_{w}}^{2} \Delta t \mathbf{I} & {\left[r a d^{2} / s^{2}\right]} \end{array} Vi=σa~n2Δt2IΘi=σω~n2Δt2IAi=σaw2ΔtIΩi=σωw2ΔtI[m2/s2][rad2][m2/s4][rad2/s2]

The error-state Jacobian and perturbation matrices

The error-state system is now

δ x ← f ( x , δ x , u m , i ) = F x ( x , u m ) ⋅ δ x + F i ⋅ i \delta \mathbf{x} \leftarrow f\left(\mathbf{x}, \delta \mathbf{x}, \mathbf{u}_{m}, \mathbf{i}\right)=\mathbf{F}_{\mathbf{x}}\left(\mathbf{x}, \mathbf{u}_{m}\right) \cdot \delta \mathbf{x}+\mathbf{F}_{\mathbf{i}} \cdot \mathbf{i} δxf(x,δx,um,i)=Fx(x,um)δx+Fii

The ESKF prediction equations are written:

δ x ^ ← F x ( x , u m ) ⋅ δ x ^ P ← F x P F x ⊤ + F i Q i F i ⊤ \begin{array}{l} \hat{\delta \mathbf{x}} \leftarrow \mathbf{F}_{\mathbf{x}}\left(\mathbf{x}, \mathbf{u}_{m}\right) \cdot \hat{\delta \mathbf{x}} \\ \mathbf{P} \leftarrow \mathbf{F}_{\mathbf{x}} \mathbf{P} \mathbf{F}_{\mathbf{x}}^{\top}+\mathbf{F}_{\mathbf{i}} \mathbf{Q}_{\mathbf{i}} \mathbf{F}_{\mathbf{i}}^{\top} \end{array} δx^Fx(x,um)δx^PFxPFx+FiQiFi

δ x ∼ N { δ ^ x , P } \delta \mathbf{x} \sim \mathcal{N}\{\hat{\delta} \mathbf{x}, \mathbf{P}\} δxN{δ^x,P}

where

F x = ∂ f ∂ δ x ∣ x , u m = [ I I Δ t 0 0 0 0 I − R [ a m − a b ] × Δ t − R Δ t 0 0 0 R ⊤ { ( ω m − ω b ) Δ t } 0 I Δ t 0 0 0 I 0 0 0 0 0 I ] \mathbf{F}_{\mathbf{x}} = \left.\frac{\partial f}{\partial \delta \mathbf{x}}\right|_{\mathbf{x}, \mathbf{u}_{m}} = \left[\begin{array}{ccccc} \mathbf{I} & \mathbf{I} \Delta t & 0 & 0 & 0 \\ 0 & \mathbf{I} & -\mathbf{R}\left[\mathbf{a}_{m}-\mathbf{a}_{b}\right]_{\times} \Delta t & -\mathbf{R} \Delta t & 0 \\ 0 & 0 & \mathbf{R}^{\top}\left\{\left(\boldsymbol{\omega}_{m}-\boldsymbol{\omega}_{b}\right) \Delta t\right\} & 0 & \mathbf{I} \Delta t \\ 0 & 0 & 0 & \mathbf{I} & 0 \\ 0 & 0 & 0 & 0 & \mathbf{I} \end{array}\right] Fx=δxfx,um=I0000IΔtI0000R[amab]×ΔtR{(ωmωb)Δt}000RΔt0I000IΔt0I

F i = ∂ f ∂ i ∣ x , u m = [ 0 0 0 0 I 0 0 0 0 I 0 0 0 0 I 0 0 0 0 I ] \mathbf{F}_{\mathbf{i}}= \left.\frac{\partial f}{\partial \mathbf{i}}\right|_{\mathbf{x}, \mathbf{u}_{m}}= \left[\begin{array}{llll} 0 & 0 & 0 & 0 \\ \mathbf{I} & 0 & 0 & 0 \\ 0 & \mathbf{I} & 0 & 0 \\ 0 & 0 & \mathbf{I} & 0 \\ 0 & 0 & 0 & \mathbf{I} \end{array}\right] Fi=ifx,um=0I00000I00000I00000I

Q i = [ V i 0 0 0 0 Θ i 0 0 0 0 A i 0 0 0 0 Ω i ] \mathbf{Q}_{\mathbf{i}}= \left[\begin{array}{cccc} \mathbf{V}_{\mathbf{i}} & 0 & 0 & 0 \\ 0 & \boldsymbol{\Theta}_{\mathbf{i}} & 0 & 0 \\ 0 & 0 & \mathbf{A}_{\mathbf{i}} & 0 \\ 0 & 0 & 0 & \Omega_{\mathbf{i}} \end{array}\right] Qi=Vi0000Θi0000Ai0000Ωi

ESKF Measurement Update (Fusing IMU with GPS data)

GPS measurement

y = h ( x t ) + v , v ∼ N { 0 , V } \mathbf{y}=h\left(\mathbf{x}_{t}\right)+v , \quad v \sim \mathcal{N}\{0, \mathbf{V}\} y=h(xt)+v,vN{0,V}

convert the GPS raw data which is in WGS84 coordinate to ENU by GeographicLib

h ( x ^ t ) = G p G p s = G p I + I G R ⋅ I p G p s h\left(\hat{\mathbf{x}}_{t}\right) = {}^{G} \mathbf{p}_{G p s} = {}^{G} \mathbf{p}_{I} + {}_{I}^{G} \mathbf{R} \cdot {}^{I} \mathbf{p}_{G p s} h(x^t)=GpGps=GpI+IGRIpGps

the filter correction equations

K = P H ⊤ ( H P H ⊤ + V ) − 1 δ ^ x ← K ( y − h ( x ^ t ) ) P ← ( I − K H ) P \begin{array}{l} \mathbf{K}=\mathbf{P} \mathbf{H}^{\top}\left(\mathbf{H} \mathbf{P} \mathbf{H}^{\top}+\mathbf{V}\right)^{-1} \\ \hat{\delta} \mathbf{x} \leftarrow \mathbf{K}\left(\mathbf{y}-h\left(\hat{\mathbf{x}}_{t}\right)\right) \\ \mathbf{P} \leftarrow(\mathbf{I}-\mathbf{K} \mathbf{H}) \mathbf{P} \end{array} K=PH(HPH+V)1δ^xK(yh(x^t))P(IKH)P

where

H ≜ ∂ h ∂ δ x ∣ x = [ I 0 − I G R ⌊ I p G p s ⌋ × 0 0 ] \mathbf{H} \left.\triangleq \frac{\partial h}{\partial \delta \mathbf{x}}\right|_{\mathbf{x}} = \left[\begin{array}{lll} \mathbf{I} & \mathbf{0} & -{}_{I}^{G} \mathbf{R} \lfloor {{}^{I} \mathbf{p}}_{G p s} \rfloor _{\times} & \mathbf{0} & \mathbf{0} \end{array}\right] Hδxhx=[I0IGRIpGps×00]

the best true-state estimate

x ^ t = x ⊕ δ ^ x \hat{\mathbf{x}}_{t}=\mathbf{x} \oplus \hat{\delta} \mathbf{x} x^t=xδ^x

Results

path on ROS rviz and plot the result path(fusion_gps.csv & fusion_state.csv) on google map:

Reference

  • Quaternion kinematics for the error-state Kalman filter
评论 20
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

晨光ABC

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值