IMU预积分相关推导

IMU数学模型

ω ~ t b = ω t b + b t g + n t g a ~ t b = a t b + b t a + n t a = R w t ( a t w − g w ) + b t a + n t a \begin{split} \tilde {\pmb\omega}^b_t &= {\pmb\omega}^b_t + {\pmb b}^g_t + {\pmb n}^g_t \\ \tilde {\pmb a}^b_t &= \pmb a^b_t + {\pmb b}^a_t + {\pmb n}^a_t \\ &= {\pmb R}^t_w({\pmb a}^w_t - {\pmb g}^w) + {\pmb b}^a_t + {\pmb n}^a_t \\ \end{split} ω~tba~tb=ωtb+btg+ntg=atb+bta+nta=Rwt(atwgw)+bta+nta

  • ω ~ t b \tilde{\pmb \omega}_t^b ω~tb t t t时刻陀螺仪的读数,上标 b b b表示在Body系
  • ω t b \pmb \omega_t^b ωtb:角速度真值
  • b t g \pmb b_t^g btg:陀螺仪的随机游走
  • n t g \pmb n_t^g ntg:陀螺仪的噪声
  • a ~ t b \tilde{\pmb a}_t^b a~tb:加速计的度数
  • a t b \pmb a^b_t atb:Body系下加速度真值,其包含重力加速度 g w \pmb g^w gw
  • R w t \pmb R_w^t Rwt:世界系到 t t t时刻Body系的旋转
  • a t w \pmb a_t^w atw:世界系下加速度得真值,不包含重力加速度 g w \pmb g^w gw
  • g w \pmb g^w gw:世界系下重力加速度
  • b t a \pmb b_t^a bta:加速计的随机游走
  • n t a \pmb n_t^a nta:加速计的噪声

噪声性质
连续时间: n t g ∼ N ( 0 , σ g 2 ) n t a ∼ N ( 0 , σ a 2 ) n t b a = b ˙ t a ∼ N ( 0 , σ b a 2 ) n t b g = b ˙ t g ∼ N ( 0 , σ b g 2 ) 离散时间:采样间隔 Δ t n k g ∼ N ( 0 , 1 Δ t σ g 2 ) n k a ∼ N ( 0 , 1 Δ t σ a 2 ) n k b a = b ˙ k a ∼ N ( 0 , Δ t σ b a 2 ) n k b g = b ˙ k g ∼ N ( 0 , Δ t σ b g 2 ) \begin{split} 连续时间: \\ {\pmb n}_t^g &\sim \mathcal N(\pmb 0, \pmb \sigma^2_g) \\ {\pmb n}_t^a &\sim \mathcal N(\pmb0, \pmb \sigma^2_a) \\ \pmb n^{ba}_t = \dot{\pmb b}_t^a &\sim \mathcal N(\pmb0, \pmb \sigma^2_{ba}) \\ \pmb n^{bg}_t = \dot{\pmb b}_t^g &\sim \mathcal N(\pmb0, \pmb \sigma^2_{bg}) \\ 离散时间:采样间隔\Delta t\\ {\pmb n}_k^g &\sim \mathcal N(\pmb0, \frac{1}{\Delta t} \pmb \sigma^2_g) \\ {\pmb n}_k^a &\sim \mathcal N(\pmb0, \frac{1}{\Delta t} \pmb \sigma^2_a) \\ \pmb n^{ba}_k = \dot{\pmb b}_k^a &\sim \mathcal N(\pmb0,\Delta t \pmb \sigma^2_{ba}) \\ \pmb n^{bg}_k = \dot{\pmb b}_k^g &\sim \mathcal N(\pmb0, \Delta t \pmb \sigma^2_{bg}) \\ \end{split} 连续时间:ntgntantba=b˙tantbg=b˙tg离散时间:采样间隔Δtnkgnkankba=b˙kankbg=b˙kgN(0,σg2)N(0,σa2)N(0,σba2)N(0,σbg2)N(0,Δt1σg2)N(0,Δt1σa2)N(0,Δtσba2)N(0,Δtσbg2)

连续时间积分

状态变量: [ p t w , v t w , q t w , b t a , b t g ] T [\pmb p_t^w,\pmb v_t^w,\pmb q_t^w,\pmb b_t^a,\pmb b_t^g]^T [ptw,vtw,qtw,bta,btg]T

  • p t w \pmb p_t^w ptw t t t时刻imu在世界系下的位置
  • v t w \pmb v_t^w vtw t t t时刻imu在世界系下的速度
  • q t w \pmb q_t^w qtw t t t时刻imu相对世界系的旋转

运动模型:
p ˙ t w = v t w v ˙ t w = a t w q ˙ t w = q t w ⊗ [ 0 1 2 ω t b ] or R ˙ t w = R t w ⋅ [ ω t b ] × b ˙ t a = n t b a b ˙ t g = n t b g \begin{split} \dot{\pmb p}_t^w &= \pmb v_t^w \\ \dot{\pmb v}_t^w &= \pmb a_t^w \\ \dot{\pmb q}^w_t &= \pmb q^w_t \otimes \begin{bmatrix} 0 \\ \frac12 \pmb \omega^b_t \end{bmatrix} \\ \text{or} \quad\dot{\pmb R}^w_t &= \pmb R^w_t \cdot [\pmb \omega^b_t]_{\times}\\ \dot{\pmb b}^a_t &= \pmb n^{ba}_t \\ \dot{\pmb b}_t^g &= \pmb n^{bg}_t \\ \end{split} p˙twv˙twq˙tworR˙twb˙tab˙tg=vtw=atw=qtw[021ωtb]=Rtw[ωtb]×=ntba=ntbg
t t t时刻到 t + Δ t t+\Delta t t+Δt时刻状态积分
p t + Δ t w = p t w + ∫ t t + Δ t v τ w d τ + ∬ t t + Δ t a τ w d τ 2 = p t w + ∫ t t + Δ t v τ w d τ + ∬ t t + Δ t ( R τ w a τ b + g w ) d τ 2 = p t w + 1 2 g w Δ t 2 + ∫ t t + Δ t v τ w d τ + ∬ t t + Δ t R τ w a τ b d τ 2 v t + Δ t w = v t w + ∫ t t + Δ t a τ w d τ = v t w + ∫ t t + Δ t ( R τ w a τ b + g w ) d τ = v t w + g w Δ t + ∫ t t + Δ t R τ w a τ b d τ q t + Δ t w = q t w ⊗ ∫ t t + Δ t q τ i ⊗ [ 0 1 2 ω τ b ] d τ R t + Δ t w = R t w E x p ( ∫ t t + Δ t ω τ b d τ ) \begin{split} \pmb p^w_{t+ \Delta t} &= \pmb p^w_t + \int_{t}^{t+\Delta t} \pmb v^w_\tau d \tau + \iint_{t}^{t+\Delta t} \pmb a^w_\tau d \tau^2 \\ &= \pmb p^w_t + \int_{t}^{t+\Delta t} \pmb v^w_\tau d \tau + \iint_{t}^{t+\Delta t} (\pmb R^w_\tau \pmb a^b_\tau + \pmb g^w) d \tau^2 \\ &= \pmb p^w_t + \frac12 \pmb g^w \Delta t^2 + \int_{t}^{t+\Delta t} \pmb v^w_\tau d \tau + \iint_{t}^{t+\Delta t} \pmb R^w_\tau \pmb a^b_\tau d \tau^2 \\ \pmb v^w_{t+\Delta t} &= \pmb v^w_t + \int_{t}^{t+\Delta t} \pmb a^w_\tau d \tau \\ &= \pmb v^w_t + \int_{t}^{t+\Delta t} (\pmb R^w_\tau \pmb a^b_\tau + \pmb g^w) d \tau \\ &= \pmb v^w_t + \pmb g^w \Delta t + \int_{t}^{t+\Delta t} \pmb R^w_\tau \pmb a^b_\tau d \tau \\ \pmb q^w_{t+\Delta t} &= \pmb q^w_t \otimes \int_{t}^{t+\Delta t} \pmb q^i_\tau \otimes \begin{bmatrix} 0 \\ \frac12 \pmb \omega^b_\tau \end{bmatrix} d \tau \\ \pmb R^w_{t+\Delta t} &= \pmb R^w_t Exp \left( \int_{t}^{t+\Delta t} \pmb \omega^b_\tau d \tau \right) \\ \end{split} pt+Δtwvt+Δtwqt+ΔtwRt+Δtw=ptw+tt+Δtvτwdτ+tt+Δtaτwdτ2=ptw+tt+Δtvτwdτ+tt+Δt(Rτwaτb+gw)dτ2=ptw+21gwΔt2+tt+Δtvτwdτ+tt+ΔtRτwaτbdτ2=vtw+tt+Δtaτwdτ=vtw+tt+Δt(Rτwaτb+gw)dτ=vtw+gwΔt+tt+ΔtRτwaτbdτ=qtwtt+Δtqτi[021ωτb]dτ=RtwExp(tt+Δtωτbdτ)

离散时间积分

Imu的采样间隔为 Δ t \Delta t Δt,假设在 Δ t \Delta t Δt时间内 a t w \pmb a^w_t atw ω t b \pmb \omega^b_t ωtb恒定
p t + Δ t w = p t w + v t w Δ t + 1 2 g w Δ t 2 + 1 2 R t w a t b Δ t 2 v t + Δ t w = v t w + g w Δ t + R t w a t b Δ t R t + Δ t w = R t w E x p ( ω t b Δ t ) \begin{split} \pmb p^w_{t+ \Delta t} &= \pmb p^w_t + \pmb v^w_t \Delta t + \frac12 \pmb g^w \Delta t^2 + \frac12 \pmb R^w_t \pmb a^b_t \Delta t^2 \\ \pmb v^w_{t+\Delta t} &= \pmb v^w_t + \pmb g^w \Delta t + \pmb R^w_t \pmb a^b_t \Delta t \\ \pmb R^w_{t+\Delta t} &= \pmb R^w_t Exp(\pmb \omega^b_t \Delta t) \end{split} pt+Δtwvt+ΔtwRt+Δtw=ptw+vtwΔt+21gwΔt2+21RtwatbΔt2=vtw+gwΔt+RtwatbΔt=RtwExp(ωtbΔt)
离散时间 [ i , j ] [i,j] [i,j]之间的Imu数据累积:
R j w = R i w ∏ k = i j − 1 E x p ( ω k b Δ t ) v j w = v i w + ∑ k = i j − 1 g w Δ t + ∑ k = i j − 1 R k w a k b Δ t p j w = p i w + ∑ k = i j − 1 v k w Δ t + 1 2 ∑ k = i j − 1 g w Δ t 2 + 1 2 ∑ k = i j − 1 R k w a k b Δ t 2 \begin{split} \pmb R^w_j &= \pmb R^w_i \prod_{k=i}^{j-1} Exp(\pmb \omega^b_k \Delta t) \\ \pmb v^w_j &= \pmb v^w_i + \sum_{k=i}^{j-1} \pmb g^w \Delta t + \sum_{k=i}^{j-1} \pmb R^w_k \pmb a^b_k \Delta t \\ \pmb p^w_j &= \pmb p^w_i + \sum_{k=i}^{j-1} \pmb v^w_k \Delta t + \frac12 \sum_{k=i}^{j-1} \pmb g^w \Delta t^2 + \frac12 \sum_{k=i}^{j-1} \pmb R^w_k \pmb a^b_k \Delta t^2 \end{split} Rjwvjwpjw=Riwk=ij1Exp(ωkbΔt)=viw+k=ij1gwΔt+k=ij1RkwakbΔt=piw+k=ij1vkwΔt+21k=ij1gwΔt2+21k=ij1RkwakbΔt2

离散时间预积分

写法1

上式两侧同时乘以 R w i \pmb R^i_w Rwi,整理得:
Δ R j i = R w i R j w = ∏ k = i j − 1 E x p ( ω k b Δ t ) Δ v j i = R w i ( v j w − v i w − g w Δ t i j ) = ∑ k = i j − 1 R k i a k b Δ t Δ p j i = R w i ( p j w − p i w − v i w Δ t i j − 1 2 g w Δ t i j 2 ) = ∑ k = i j − 1 [ Δ v k i Δ t + 1 2 R k i a k b Δ t 2 ] \begin{split} \Delta \pmb R^i_j &= \pmb R^i_w \pmb R^w_j = \prod_{k=i}^{j-1} Exp(\pmb \omega^b_k \Delta t) \\ \Delta \pmb v^i_j &= \pmb R^i_w(\pmb v^w_j- \pmb v^w_i - \pmb g^w \Delta t_{ij}) \\ &= \sum_{k=i}^{j-1} \pmb R^i_k \pmb a^b_k \Delta t \\ \Delta \pmb p^i_j &= \pmb R^i_w(\pmb p^w_j-\pmb p^w_i-\pmb v^w_i \Delta t_{ij} - \frac12 \pmb g^w \Delta t^2_{ij}) \\ &= \sum_{k=i}^{j-1} \left[\Delta \pmb v^i_k \Delta t + \frac12 \pmb R^i_k \pmb a^b_k \Delta t^2 \right] \end{split} ΔRjiΔvjiΔpji=RwiRjw=k=ij1Exp(ωkbΔt)=Rwi(vjwviwgwΔtij)=k=ij1RkiakbΔt=Rwi(pjwpiwviwΔtij21gwΔtij2)=k=ij1[ΔvkiΔt+21RkiakbΔt2]
其中 Δ p j i \Delta \pmb p^i_j Δpji项证明如下:
p j w − p i w − v i w Δ t i j − 1 2 g w Δ t i j 2 = ∑ k = i j − 1 v k w Δ t + 1 2 ∑ k = i j − 1 g w Δ t 2 + 1 2 ∑ k = i j − 1 R k w a k b Δ t 2 − v i w Δ t i j − 1 2 g w Δ t i j 2 = ∑ k = i j − 1 v k w Δ t − ∑ k = i j − 1 v i w Δ t + 1 2 ( j − i ) g w Δ t 2 − 1 2 ( j − i ) 2 g w Δ t 2 + 1 2 ∑ k = i j − 1 R k w a k b Δ t 2 = ∑ k = i j − 1 ( v k w − v i w ) Δ t − ∑ k = i j − 1 ( k − i ) g w Δ t 2 + 1 2 ∑ k = i j − 1 R k w a k b Δ t 2 = ∑ k = i j − 1 ( v k w − v i w − g w Δ t i k ) Δ t + 1 2 ∑ k = i j − 1 R k w a k b Δ t 2 = ∑ k = i j − 1 [ R i w Δ v k i Δ t ] + 1 2 ∑ k = i j − 1 R k w a k b Δ t 2 \begin{split} & \quad \pmb p^w_j-\pmb p^w_i-\pmb v^w_i \Delta t_{ij} - \frac12 \pmb g^w \Delta t^2_{ij} \\ &= \sum_{k=i}^{j-1} \pmb v^w_k \Delta t + \frac12 \sum_{k=i}^{j-1} \pmb g^w \Delta t^2 + \frac12 \sum_{k=i}^{j-1} \pmb R^w_k \pmb a^b_k \Delta t^2 -\pmb v^w_i \Delta t_{ij} - \frac12 \pmb g^w \Delta t^2_{ij} \\ &= \sum_{k=i}^{j-1} \pmb v^w_k \Delta t - \sum_{k=i}^{j-1} \pmb v^w_i \Delta t + \frac12 (j-i) \pmb g^w \Delta t^2 - \frac12(j-i)^2 \pmb g^w \Delta t^2 + \frac12 \sum_{k=i}^{j-1} \pmb R^w_k \pmb a^b_k \Delta t^2 \\ &= \sum_{k=i}^{j-1}(\pmb v^w_k-\pmb v^w_i)\Delta t - \sum_{k=i}^{j-1}(k-i) \pmb g^w \Delta t^2 + \frac12 \sum_{k=i}^{j-1} \pmb R^w_k \pmb a^b_k \Delta t^2 \\ &= \sum_{k=i}^{j-1} (\pmb v^w_k-\pmb v^w_i-\pmb g^w \Delta t_{ik})\Delta t + \frac12 \sum_{k=i}^{j-1} \pmb R^w_k \pmb a^b_k \Delta t^2 \\ &= \sum_{k=i}^{j-1} \left[ \pmb R^w_i \Delta v^i_k \Delta t \right] + \frac12 \sum_{k=i}^{j-1} \pmb R^w_k \pmb a^b_k \Delta t^2 \end{split} pjwpiwviwΔtij21gwΔtij2=k=ij1vkwΔt+21k=ij1gwΔt2+21k=ij1RkwakbΔt2viwΔtij21gwΔtij2=k=ij1vkwΔtk=ij1viwΔt+21(ji)gwΔt221(ji)2gwΔt2+21k=ij1RkwakbΔt2=k=ij1(vkwviw)Δtk=ij1(ki)gwΔt2+21k=ij1RkwakbΔt2=k=ij1(vkwviwgwΔtik)Δt+21k=ij1RkwakbΔt2=k=ij1[RiwΔvkiΔt]+21k=ij1RkwakbΔt2
递推写法:
Δ R k + 1 i = Δ R k i E x p ( ω k b Δ t ) Δ v k + 1 i = Δ v k i + R k i a k b Δ t Δ p k + 1 i = Δ p k i + Δ v k i Δ t + 1 2 R k i a k b Δ t 2 \begin{split} \Delta \pmb R^i_{k+1} &= \Delta \pmb R^i_k Exp(\pmb \omega^b_{k} \Delta t) \\ \Delta \pmb v^i_{k+1} &= \Delta \pmb v^i_k + \pmb R^i_k \pmb a^b_k \Delta t \\ \Delta \pmb p^i_{k+1} &= \Delta \pmb p^i_k + \Delta \pmb v^i_k \Delta t + \frac12 \pmb R^i_k \pmb a^b_k \Delta t^2 \\ \end{split} ΔRk+1iΔvk+1iΔpk+1i=ΔRkiExp(ωkbΔt)=Δvki+RkiakbΔt=Δpki+ΔvkiΔt+21RkiakbΔt2

写法2

另一种写法:
R o t a t i o n : γ k + 1 i = γ k i ∘ E x p ( ω k b Δ t ) V e l o c i t y : β k + 1 i = β k i + γ k i a k b Δ t P o s i t i o n : α k + 1 i = α k i + β k i Δ t + 1 2 γ k i a k b Δ t 2 \begin{split} Rotation:\pmb \gamma^i_{k+1} &= \pmb \gamma^i_k \circ Exp(\pmb \omega^b_k \Delta t) \\ Velocity:\pmb \beta^i_{k+1} &= \pmb \beta^i_k + \pmb \gamma^i_k \pmb a^b_k \Delta t \\ Position:\pmb \alpha^i_{k+1} &= \pmb \alpha^i_k + \pmb \beta^i_k \Delta t + \frac12 \pmb \gamma^i_k \pmb a^b_k \Delta t^2 \\ \end{split} Rotation:γk+1iVelocity:βk+1iPosition:αk+1i=γkiExp(ωkbΔt)=βki+γkiakbΔt=αki+βkiΔt+21γkiakbΔt2

  • 用四元数 S 3 S^3 S3表示 γ \pmb \gamma γ
    γ k + 1 i = γ k i ⊗ E x p ( ω k b Δ t ) = γ k i ⊗ exp ⁡ ( 1 2 ω k b Δ t ) ≈ γ k i ⊗ [ 1 1 2 ω k b Δ t ] \begin{split} \pmb \gamma^i_{k+1} &= \pmb \gamma^i_k \otimes Exp(\omega^b_k \Delta t) \\ &=\pmb \gamma^i_k \otimes \exp(\frac12 \omega^b_k \Delta t) \\ &\approx \pmb \gamma^i_k \otimes \begin{bmatrix} 1 \\ \frac12 \pmb \omega^b_k \Delta t \end{bmatrix} \end{split} γk+1i=γkiExp(ωkbΔt)=γkiexp(21ωkbΔt)γki[121ωkbΔt]

  • 用旋转矩阵 S O ( 3 ) SO(3) SO(3)表示 γ \pmb \gamma γ
    γ k + 1 i = γ k i E x p ( ω k b Δ t ) = γ k i exp ⁡ ( [ ω k b Δ t ] × ) \begin{split} \pmb \gamma^i_{k+1} &= \pmb \gamma^i_k Exp(\omega^b_k \Delta t) \\ &=\pmb \gamma^i_k \exp([\omega^b_k \Delta t]_{\times}) \end{split} γk+1i=γkiExp(ωkbΔt)=γkiexp([ωkbΔt]×)

这里的一系列的操作只为导出预积分量 [ α , β , γ ] [\pmb \alpha,\pmb \beta,\pmb \gamma] [α,β,γ],它们的计算与系统其他状态无关,只与Imu的输入相关。注意的是预积分量中包含重力加速度的积分量

欧拉法与中值法

离散时间 [ i , j ] [i,j] [i,j]之间,从第 k k k k + 1 k+1 k+1时刻的积分。

欧拉法

ω k b = ω ~ k b − b k g γ k + 1 i = γ k i E x p ( ω k b Δ t ) a k b = a ~ k b − b k a β k + 1 i = β k i + γ k i a k b Δ t α k + 1 i = α k i + β k i Δ t + 1 2 γ k i a k b Δ t 2 b k + 1 a = b k a + n k b a Δ t b k + 1 g = b k g + n k b g Δ t \begin{split} \pmb \omega^b_k &= \tilde{\pmb \omega}^b_k - \pmb b^g_k \\ \pmb \gamma^i_{k+1} &= \pmb \gamma^i_k Exp(\omega^b_k \Delta t) \\ \pmb a^b_k &= \tilde{\pmb a}^b_k - \pmb b^a_k \\ \pmb \beta^i_{k+1} &= \pmb \beta^i_k + \pmb \gamma^i_k \pmb a^b_k \Delta t \\ \pmb \alpha^i_{k+1} &= \pmb \alpha^i_k + \pmb \beta^i_k \Delta t + \frac12 \pmb \gamma^i_k \pmb a^b_k \Delta t^2 \\ \pmb b^a_{k+1} &= \pmb b^a_k + \pmb n^{ba}_k \Delta t \\ \pmb b^g_{k+1} &= \pmb b^g_k + \pmb n^{bg}_k \Delta t \\ \end{split} ωkbγk+1iakbβk+1iαk+1ibk+1abk+1g=ω~kbbkg=γkiExp(ωkbΔt)=a~kbbka=βki+γkiakbΔt=αki+βkiΔt+21γkiakbΔt2=bka+nkbaΔt=bkg+nkbgΔt

中值法

ω k b = 1 2 [ ( ω ~ k b − b k g ) + ( ω ~ k + 1 b − b k g ) ] γ k + 1 i = γ k i E x p ( ω k b Δ t ) a k b = 1 2 [ ( a ~ k b − b k a ) + E x p ( ω k b Δ t ) ( a ~ k + 1 b − b k a ) ] β k + 1 i = β k i + γ k i a k b Δ t α k + 1 i = α k i + β k i Δ t + 1 2 γ k i a k b Δ t 2 b k + 1 a = b k a + n k b a Δ t b k + 1 g = b k g + n k b g Δ t \begin{split} \pmb \omega^b_k &= \frac12 [(\tilde{\pmb \omega}^b_k - {\pmb b}_k^g) + ( \tilde{\pmb \omega}^b_{k+1} - {\pmb b}_k^g ) ] \\ \pmb \gamma^i_{k+1} &= \pmb \gamma^i_k Exp(\pmb \omega^b_k \Delta t) \\ \pmb a^b_k & =\frac12 \left[(\tilde{\pmb a}^b_k - \pmb b_k^a) + Exp(\pmb \omega^b_k \Delta t)( \tilde{\pmb a}^b_{k+1} - \pmb b^a_k) \right] \\ \pmb \beta^i_{k+1} &= \pmb \beta^i_k + \pmb \gamma^i_k \pmb a^b_k \Delta t \\ \pmb \alpha^i_{k+1} &= \pmb \alpha^i_k + \pmb \beta^i_k \Delta t + \frac12 \pmb \gamma^i_k \pmb a^b_k \Delta t^2 \\ \pmb b^a_{k+1} &= \pmb b^a_k + \pmb n^{ba}_k \Delta t \\ \pmb b^g_{k+1} &= \pmb b^g_k + \pmb n^{bg}_k \Delta t \\ \end{split} ωkbγk+1iakbβk+1iαk+1ibk+1abk+1g=21[(ω~kbbkg)+(ω~k+1bbkg)]=γkiExp(ωkbΔt)=21[(a~kbbka)+Exp(ωkbΔt)(a~k+1bbka)]=βki+γkiakbΔt=αki+βkiΔt+21γkiakbΔt2=bka+nkbaΔt=bkg+nkbgΔt

误差卡尔曼运动方程

将真值(true)状态变量写成名义(nominal)“加”误差(error)状态变量的形式,即: x = x ^ ⊕ δ x \pmb x = \hat{\pmb x} \oplus \delta \pmb x x=x^δx,需要推导误差项的迭代方程:
x k + 1 = x ^ k + 1 + δ x k + 1 = f ( x ^ k + δ x k , u ^ k + δ u k ) = f ( x ^ k , u ^ k ) + ∂ f ∂ x k ∣ x ^ k , u ^ k ⋅ δ x k + ∂ f ∂ u k ∣ x ^ k , u ^ k ⋅ δ u k = f ( x ^ k , u ^ k ) + ∂ f ∂ x k ∣ x ^ k , u ^ k ⋅ δ x k + ∂ f ∂ u k ∣ x ^ k , u ^ k ⋅ ∂ δ u k ∂ n k ⋅ n k = f ( x ^ k , u ^ k ) + ∂ f ∂ x k ∣ x ^ k , u ^ k ⋅ δ x k + ∂ f ∂ n k ∣ x ^ k , u ^ k ⋅ n k 误差递推: δ x k + 1 = F k ⋅ δ x k + G k ⋅ n k 协方差递推: P k + 1 = F k P k F k T + G k Q G k T \begin{split} \pmb x_{k+1} = \hat{\pmb x}_{k+1} + \delta \pmb x_{k+1} &= \pmb f(\hat{\pmb x}_{k} + \delta \pmb x_{k}, \hat{\pmb u}_{k} + \delta \pmb u_{k}) \\ &= \pmb f(\hat{\pmb x}_{k}, \hat{\pmb u}_{k}) + \left. \frac{\partial \pmb f}{\partial \pmb x_k} \right|_{\hat{\pmb x}_k,\hat{\pmb u}_{k}} \cdot \delta \pmb x_k + \left.\frac{\partial \pmb f}{\partial \pmb u_k} \right| _{\hat{\pmb x}_k,\hat{\pmb u}_{k}} \cdot \delta \pmb u_{k} \\ &= \pmb f(\hat{\pmb x}_{k}, \hat{\pmb u}_{k}) + \left. \frac{\partial \pmb f}{\partial \pmb x_k} \right|_{\hat{\pmb x}_k,\hat{\pmb u}_{k}} \cdot \delta \pmb x_k + \left.\frac{\partial \pmb f}{\partial \pmb u_k} \right| _{\hat{\pmb x}_k,\hat{\pmb u}_{k}} \cdot \frac{\partial \delta \pmb u_k}{\partial \pmb n_k} \cdot \pmb n_{k} \\ &= \pmb f(\hat{\pmb x}_{k}, \hat{\pmb u}_{k}) + \left. \frac{\partial \pmb f}{\partial \pmb x_k} \right|_{\hat{\pmb x}_k,\hat{\pmb u}_{k}} \cdot \delta \pmb x_k + \left.\frac{\partial \pmb f}{\partial \pmb n_k} \right| _{\hat{\pmb x}_k,\hat{\pmb u}_{k}} \cdot \pmb n_{k} \\ 误差递推: \delta \pmb x_{k+1} &= \pmb F_k \cdot \delta \pmb x_k + \pmb G_{k} \cdot \pmb n_{k} \\ 协方差递推:{\pmb P}_{k+1} &= \pmb F_k \pmb P_k \pmb F_k^T + \pmb G_k \pmb Q \pmb G_k^T \end{split} xk+1=x^k+1+δxk+1误差递推:δxk+1协方差递推:Pk+1=f(x^k+δxk,u^k+δuk)=f(x^k,u^k)+xkf x^k,u^kδxk+ukf x^k,u^kδuk=f(x^k,u^k)+xkf x^k,u^kδxk+ukf x^k,u^knkδuknk=f(x^k,u^k)+xkf x^k,u^kδxk+nkf x^k,u^knk=Fkδxk+Gknk=FkPkFkT+GkQGkT
这里运动方程 f ( ) \pmb f() f()采用中值法,采样扰动求导的方法。

k k k时刻真值状态变量 x k \pmb x_k xk k k k时刻名义状态变量 k k k时刻误差状态变量 k k k时刻相关噪声项
x k = [ α k i θ k i β k i b k a b k g ] ∈ R 15 \pmb x_k = \begin{bmatrix} \pmb \alpha^i_k \\ \pmb \theta^i_k \\ \pmb \beta^i_k \\\pmb b^a_k \\ \pmb b^g_k \end{bmatrix} \in \mathbb R^{15} xk= αkiθkiβkibkabkg R15 x ^ k = [ α ^ k i θ ^ k i β ^ k i b ^ k a b ^ k g ] ∈ R 15 \hat{\pmb x}_k = \begin{bmatrix} \hat{\pmb \alpha}^i_k \\ \hat{\pmb \theta}^i_k \\ \hat{\pmb \beta}^i_k \\ \hat{\pmb b}^a_k \\ \hat{\pmb b}^g_k \end{bmatrix} \in \mathbb R^{15} x^k= α^kiθ^kiβ^kib^kab^kg R15 δ x k = [ δ α k i δ θ k i δ β k i δ b k a δ b k g ] ∈ R 15 \delta \pmb x_k = \begin{bmatrix} \delta \pmb \alpha^i_k \\ \delta \pmb \theta^i_k \\ \delta \pmb \beta^i_k \\ \delta \pmb b^a_k \\ \delta \pmb b^g_k \end{bmatrix} \in \mathbb R^{15} δxk= δαkiδθkiδβkiδbkaδbkg R15 n k = [ n k a n k g n k + 1 a n k + 1 a n k b a n k b g ] ∈ R 18 \pmb n_k = \begin{bmatrix} \pmb n^a_k \\ \pmb n^g_k \\ \pmb n^a_{k+1} \\ \pmb n^a_{k+1} \\ \pmb n^{ba}_k \\ \pmb n^{bg}_k \end{bmatrix} \in \mathbb R^{18} nk= nkankgnk+1ank+1ankbankbg R18
  • 雅可比矩阵 F k ∈ R 15 × 15 , G k ∈ R 15 × 18 \pmb F_k \in \mathbb R^{15 \times 15}, \pmb G_k \in \mathbb R^{15 \times 18} FkR15×15,GkR15×18
  • 协方差矩阵 P k ∈ R 15 × 15 , Q ∈ R 18 × 18 \pmb P_k \in \mathbb R^{15 \times 15}, \pmb Q \in \mathbb R^{18 \times 18} PkR15×15,QR18×18
  • θ k i ∈ R 3 γ k i = E x p ( θ k i ) ∈ S O ( 3 ) \pmb \theta^i_k \in \mathbb R^3 \quad \pmb \gamma^i_k = Exp(\pmb \theta^i_k) \in SO(3) θkiR3γki=Exp(θki)SO(3)

雅可比计算可采用如下方式:
∂ x k + 1 ∂ x k ∣ x ^ k = lim ⁡ δ x k → 0 f ( x ^ k + δ x k ) − f ( x ^ k ) ∂ δ x k \begin{split} \left . \frac{\partial \pmb x_{k+1}}{\partial \pmb x_k} \right|_{\hat{\pmb x}_{k}} = \lim_{\delta \pmb x_k \rightarrow \pmb 0} \frac{\pmb f(\hat{\pmb x}_{k} + \delta \pmb x_k) - f(\hat{\pmb x}_{k})}{\partial \delta \pmb x_k} \\ \end{split} xkxk+1 x^k=δxk0limδxkf(x^k+δxk)f(x^k)
f ( x ^ k + δ x k ) \pmb f(\hat{\pmb x}_{k} + \delta \pmb x_k) f(x^k+δxk)可以整理为 f ( x ^ k ) + f ˙ ( x ^ k ) ⋅ δ x k \pmb f(\hat{\pmb x}_{k}) + \dot{\pmb f}(\hat{\pmb x}_{k}) \cdot \delta \pmb x_k f(x^k)+f˙(x^k)δxk的形式,可得到雅可比: f ˙ ( x ^ k ) \dot{\pmb f}(\hat{\pmb x}_{k}) f˙(x^k)

真值状态变量:
b k + 1 a = b k a + n k b a Δ t b k + 1 g = b k g + n k b g Δ t ω k b = 1 2 [ ( ω ~ k b − b k g + n k g ) + ( ω ~ k + 1 b − b k + 1 g + n k + 1 g ) ] θ k + 1 i = θ k i + ω k b Δ t γ k + 1 i = γ k i E x p ( ω k b Δ t ) a k b = 1 2 [ ( a ~ k b − b k a + n k a ) + E x p ( ω k b Δ t ) ( a ~ k + 1 b − b k + 1 a + n k + 1 a ) ] β k + 1 i = β k i + γ k i a k b Δ t α k + 1 i = α k i + β k i Δ t + 1 2 γ k i a k b Δ t 2 \begin{split} \pmb b^a_{k+1} &= \pmb b^a_k + \pmb n^{ba}_k \Delta t \\ \pmb b^g_{k+1} &= \pmb b^g_k + \pmb n^{bg}_k \Delta t \\ \pmb \omega^b_k &= \frac12 \left[(\tilde{\pmb \omega}^b_k - {\pmb b}^g_k + \pmb n^g_k) + ( \tilde{\pmb \omega}^b_{k+1} - {\pmb b}^g_{k+1} + \pmb n^g_{k+1}) \right] \\ {\pmb \theta}^i_{k+1} &= {\pmb \theta}^i_{k} + {\pmb \omega}^b_k \Delta t \\ \pmb \gamma^i_{k+1} &= \pmb \gamma^i_k Exp(\pmb \omega^b_k \Delta t)\\ \pmb a^b_k & =\frac12 \left[(\tilde{\pmb a}^b_k - \pmb b^a_k + \pmb n^a_k) + Exp(\pmb \omega^b_k \Delta t)( \tilde{\pmb a}^b_{k+1} - \pmb b^a_{k+1} + \pmb n^a_{k+1}) \right] \\ \pmb \beta^i_{k+1} &= \pmb \beta^i_k + \pmb \gamma^i_k \pmb a^b_k \Delta t \\ \pmb \alpha^i_{k+1} &= \pmb \alpha^i_k + \pmb \beta^i_k \Delta t + \frac12 \pmb \gamma^i_k \pmb a^b_k \Delta t^2 \\ \end{split} bk+1abk+1gωkbθk+1iγk+1iakbβk+1iαk+1i=bka+nkbaΔt=bkg+nkbgΔt=21[(ω~kbbkg+nkg)+(ω~k+1bbk+1g+nk+1g)]=θki+ωkbΔt=γkiExp(ωkbΔt)=21[(a~kbbka+nka)+Exp(ωkbΔt)(a~k+1bbk+1a+nk+1a)]=βki+γkiakbΔt=αki+βkiΔt+21γkiakbΔt2
名义状态变量:

将原始的Imu数据中值法进行积分。
b ^ k + 1 a = b ^ k a b ^ k + 1 g = b ^ k g ω ^ k b = 1 2 [ ( ω ~ k b − b ^ k g ) + ( ω ~ k + 1 b − b ^ k g ) ] θ ^ k + 1 i = θ ^ k i + ω ^ k b Δ t γ ^ k + 1 i = γ ^ k i E x p ( ω ^ k b Δ t ) a ^ k b = 1 2 [ ( a ~ k b − b ^ k a ) + E x p ( ω ^ k b Δ t ) ( a ~ k + 1 b − b ^ k a ) ] β ^ k + 1 i = β ^ k i + γ ^ k i a ^ k b Δ t α ^ k + 1 i = α ^ k i + β ^ k i Δ t + 1 2 γ ^ k i a ^ k b Δ t 2 \begin{split} \hat{\pmb b}^a_{k+1} &= \hat{\pmb b}^a_k \\ \hat{\pmb b}^g_{k+1} &= \hat{\pmb b}^g_k \\ \hat{\pmb \omega}^b_k &= \frac12 \left[(\tilde{\pmb \omega}^b_k - \hat{\pmb b}_k^g) + ( \tilde{\pmb \omega}^b_{k+1} - \hat{\pmb b}_k^g ) \right] \\ \hat{\pmb \theta}^i_{k+1} &= \hat{\pmb \theta}^i_{k} + \hat{\pmb \omega}^b_k \Delta t \\ \hat{\pmb \gamma}^i_{k+1} &= \hat{\pmb \gamma}^i_k Exp(\hat{\pmb \omega}^b_k \Delta t) \\ \hat{\pmb a}^b_k & =\frac12 \left[(\tilde{\pmb a}^b_k - \hat{\pmb b}_k^a) + Exp(\hat{\pmb \omega}^b_k \Delta t)(\tilde{\pmb a}^b_{k+1} - \hat{\pmb b}^a_k) \right] \\ \hat{\pmb \beta}^i_{k+1} &= \hat{\pmb \beta}^i_k + \hat{\pmb \gamma}^i_k \hat{\pmb a}^b_k \Delta t \\ \hat{\pmb \alpha}^i_{k+1} &= \hat{\pmb \alpha}^i_k + \hat{\pmb \beta}^i_k \Delta t + \frac12 \hat{\pmb \gamma}^i_k \hat{\pmb a}^b_k \Delta t^2 \\ \end{split} b^k+1ab^k+1gω^kbθ^k+1iγ^k+1ia^kbβ^k+1iα^k+1i=b^ka=b^kg=21[(ω~kbb^kg)+(ω~k+1bb^kg)]=θ^ki+ω^kbΔt=γ^kiExp(ω^kbΔt)=21[(a~kbb^ka)+Exp(ω^kbΔt)(a~k+1bb^ka)]=β^ki+γ^kia^kbΔt=α^ki+β^kiΔt+21γ^kia^kbΔt2
其中隐含的的等价:

  • 陀螺仪噪声不可观, n ^ k g = n ^ k + 1 g = 0 \hat{\pmb n}^g_k = \hat{\pmb n}^g_{k+1} = \pmb 0 n^kg=n^k+1g=0,偏置噪声不可观, n ^ k b g = 0 \hat{\pmb n}^{bg}_k=\pmb 0 n^kbg=0
    b ^ k + 1 g = b ^ k g + n ^ k b g Δ t = b ^ k g ω ^ k b = 1 2 [ ( ω ~ k b − b ^ k g + n ^ k a ) + ( ω ~ k + 1 b − b ^ k + 1 g + n ^ k + 1 a ) ] = 1 2 [ ( ω ~ k b − b ^ k g ) + ( ω ~ k + 1 b − b ^ k g ) ] \begin{split} \hat{\pmb b}^g_{k+1} &= \hat{\pmb b}^g_k + \hat{\pmb n}^{bg}_k \Delta t \\ &= \hat{\pmb b}^g_k \\ \hat{\pmb \omega}^b_k &= \frac12 \left[(\tilde{\pmb \omega}^b_k - \hat{\pmb b}_k^g + \hat{\pmb n}^a_k ) + ( \tilde{\pmb \omega}^b_{k+1} - \hat{\pmb b}^g_{k+1} + \hat{\pmb n}^a_{k+1}) \right] \\ &= \frac12 \left[(\tilde{\pmb \omega}^b_k - \hat{\pmb b}_k^g) + ( \tilde{\pmb \omega}^b_{k+1} - \hat{\pmb b}^g_{k}) \right] \end{split} b^k+1gω^kb=b^kg+n^kbgΔt=b^kg=21[(ω~kbb^kg+n^ka)+(ω~k+1bb^k+1g+n^k+1a)]=21[(ω~kbb^kg)+(ω~k+1bb^kg)]

  • 加速计噪声不可观, n ^ k a = n ^ k + 1 a = 0 \hat{\pmb n}^a_k = \hat{\pmb n}^a_{k+1} = \pmb 0 n^ka=n^k+1a=0,偏置噪声不可观, n ^ k b a = 0 \hat{\pmb n}^{ba}_k=\pmb 0 n^kba=0
    b ^ k + 1 a = b ^ k a + n ^ k b a Δ t = b ^ k a a ^ k b = 1 2 [ ( a ~ k b − b ^ k a + n ^ k a ) + E x p ( ω ^ k b Δ t ) ( a ~ k + 1 b − b ^ k + 1 a + n ^ k + 1 a ) ] = 1 2 [ ( a ~ k b − b ^ k a ) + E x p ( ω ^ k b Δ t ) ( a ~ k + 1 b − b ^ k a ) ] \begin{split} \hat{\pmb b}^a_{k+1} &= \hat{\pmb b}^a_k + \hat{\pmb n}^{ba}_k \Delta t \\ &= \hat{\pmb b}^a_k \\ \hat{\pmb a}^b_k &= \frac12 \left[(\tilde{\pmb a}^b_k - \hat{\pmb b}_k^a + \hat{\pmb n}^a_k ) + Exp(\hat{\pmb \omega}^b_k \Delta t)(\tilde{\pmb a}^b_{k+1} - \hat{\pmb b}^a_{k+1} + \hat{\pmb n}^a_{k+1}) \right] \\ &=\frac12 \left[(\tilde{\pmb a}^b_k - \hat{\pmb b}_k^a) + Exp(\hat{\pmb \omega}^b_k \Delta t)(\tilde{\pmb a}^b_{k+1} - \hat{\pmb b}^a_{k}) \right] \end{split} b^k+1aa^kb=b^ka+n^kbaΔt=b^ka=21[(a~kbb^ka+n^ka)+Exp(ω^kbΔt)(a~k+1bb^k+1a+n^k+1a)]=21[(a~kbb^ka)+Exp(ω^kbΔt)(a~k+1bb^ka)]

预积分量的雅可比推导见:
链接: 对状态变量雅可比推导
链接: 对噪声雅可比推导

预积分结果分析

假设从 i i i时刻到 j j j时刻,对Imu数据进行预积分,共迭代 K = j − i K=j-i K=ji次。

初始状态:
x i = [ α i i θ i i β i i b i a b i g ] = [ 0 0 0 b i a b i g ] δ x i = [ δ α i i δ θ i i δ β i i δ b i a δ b i g ] = [ 0 0 0 0 0 ] P i = C o v ( δ x i ) Q = C o v ( n ) = d i a g [ 1 Δ t σ a 2 , 1 Δ t σ g 2 , 1 Δ t σ g 2 , Δ t σ b a 2 , Δ t σ b g 2 ] \begin{split} \pmb x_i &= \begin{bmatrix} \pmb \alpha^i_i \\ \pmb \theta^i_i \\ \pmb \beta^i_i \\\pmb b^a_i \\ \pmb b^g_i \end{bmatrix} = \begin{bmatrix} \pmb 0 \\ \pmb 0 \\ \pmb 0 \\\pmb b^a_i \\ \pmb b^g_i \end{bmatrix} \quad \delta \pmb x_i = \begin{bmatrix} \delta \pmb \alpha^i_i \\ \delta \pmb \theta^i_i \\ \delta \pmb \beta^i_i \\ \delta \pmb b^a_i \\ \delta \pmb b^g_i \end{bmatrix} = \begin{bmatrix} \pmb 0 \\ \pmb 0 \\ \pmb 0 \\\pmb 0 \\ \pmb 0 \end{bmatrix} \\ \\ \pmb P_i &= Cov(\delta \pmb x_i) \\ \pmb Q &= Cov(\pmb n) = diag \left[\frac{1}{\Delta t} \pmb \sigma^2_a, \frac{1}{\Delta t} \pmb \sigma^2_g,\frac{1}{\Delta t} \pmb \sigma^2_g,\Delta t \pmb \sigma^2_{ba},\Delta t \pmb \sigma^2_{bg} \right] \\ \end{split} xiPiQ= αiiθiiβiibiabig = 000biabig δxi= δαiiδθiiδβiiδbiaδbig = 00000 =Cov(δxi)=Cov(n)=diag[Δt1σa2,Δt1σg2,Δt1σg2,Δtσba2,Δtσbg2]
最终状态:
x ^ j = [ α ^ j i θ ^ j i β ^ j i b ^ j a b ^ j g ] δ x j = [ δ α j i δ θ j i δ β j i δ b j a δ b j g ] = [ 0 0 0 0 0 ] J = ∂ x K ∂ x 0 = ∏ k = K 1 F k G = ∏ k = K 1 G k P j = C o v ( δ x j ) = J P i J T + G Q G T \begin{split} \hat{\pmb x}_j &= \begin{bmatrix} \hat{\pmb \alpha}^i_j \\ \hat{\pmb \theta}^i_j \\ \hat{\pmb \beta}^i_j \\ \hat{\pmb b}^a_j \\ \hat{\pmb b}^g_j \end{bmatrix} \quad \delta \pmb x_j = \begin{bmatrix} \delta \pmb \alpha^i_j \\ \delta \pmb \theta^i_j \\ \delta \pmb \beta^i_j \\ \delta \pmb b^a_j \\ \delta \pmb b^g_j \end{bmatrix} =\begin{bmatrix} \pmb 0 \\ \pmb 0 \\ \pmb 0 \\\pmb 0 \\ \pmb 0 \end{bmatrix} \\ \\ \pmb J &= \frac{\partial \pmb x_K}{\partial \pmb x_0} = \prod_{k=K}^1 \pmb F_k \\ \pmb G &= \prod_{k=K}^{1} \pmb G_k \\ \pmb P_j &= Cov(\delta \pmb x_j) = \pmb J \pmb P_i \pmb J^T + \pmb G \pmb Q \pmb G^T \\ \end{split} x^jJGPj= α^jiθ^jiβ^jib^jab^jg δxj= δαjiδθjiδβjiδbjaδbjg = 00000 =x0xK=k=K1Fk=k=K1Gk=Cov(δxj)=JPiJT+GQGT
以上迭代都是假设 i i i时刻的偏置不变,当偏置更新时,假定预积分观测时随零偏线性变化的。当 i i i时刻的偏置有 δ b i a , δ b i g \delta \pmb b^a_i,\delta \pmb b^g_i δbia,δbig变化时,预积分修正如下:
α j i = α ^ j i + J b a α δ b i a + J b g α δ b i g β j i = β ^ j i + J b a β δ b i a + J b g β δ b i g γ j i = γ ^ j i E x p ( J b g γ δ b i g ) \begin{split} {\pmb \alpha}^{i}_{j} &= \hat{\pmb \alpha}^{i}_{j} + {\pmb J}^{\alpha}_{ba} \delta{\pmb b}^a_i + {\pmb J}^{\alpha}_{bg} \delta{\pmb b}^g_i \\ {\pmb \beta}^{i}_{j} &= \hat{\pmb \beta}^{i}_{j} + {\pmb J}^{\beta}_{ba} \delta{\pmb b}^a_i + {\pmb J}^{\beta}_{bg} \delta{\pmb b}^g_i \\ {\pmb \gamma}^{i}_{j} &= \hat{\pmb \gamma}^{i}_{j} Exp\left({\pmb J}^\gamma_{bg} \delta {\pmb b}^g_i \right) \\ \end{split} αjiβjiγji=α^ji+Jbaαδbia+Jbgαδbig=β^ji+Jbaβδbia+Jbgβδbig=γ^jiExp(Jbgγδbig)
其中:
J b a α = ∂ α j i ∂ b i a J b g α = ∂ α j i ∂ b i g J b a β = ∂ β j i ∂ b i a J b g β = ∂ β j i ∂ b i g J b g γ = ∂ γ j i ∂ b i g \begin{split} &{\pmb J}_{ba}^{\alpha} = \frac{\partial {\pmb \alpha}^i_j}{\partial {\pmb b}_i^a} \quad {\pmb J}_{bg}^{\alpha} = \frac{\partial {\pmb \alpha}^i_j}{\partial {\pmb b}_i^g} \\ &{\pmb J}_{ba}^{\beta} = \frac{\partial {\pmb \beta}^i_j}{\partial {\pmb b}_i^a} \quad {\pmb J}_{bg}^{\beta} = \frac{\partial {\pmb \beta}^i_j}{\partial {\pmb b}_i^g} \\ &{\pmb J}_{bg}^{\gamma} = \frac{\partial {\pmb \gamma}^i_j}{\partial {\pmb b}_i^g} \\ \end{split} Jbaα=biaαjiJbgα=bigαjiJbaβ=biaβjiJbgβ=bigβjiJbgγ=bigγji

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值