流型上的Kalman Filter

连续时间系统运动学

The true-state kinematics

p ˙ = v v ˙ = a q ˙ = 1 2 q ⊗ ω b ˙ a = n a b ˙ ω = n ω g ˙ = 0 \begin{aligned} \dot{\bold{p}}&=\bold{v}\\ \dot{\bold{v}}&=\bold{a} \\ \dot{\bold{q}}&=\dfrac{1}{2}\bold{q}\otimes \bm{\omega} \\ \dot{\bold{b}}_{a}&=\bold{n}_{a}\\ \dot{\bold{b}}_{\bm{\omega} }&=\bold{n}_{\bm{\omega} } \\ \dot{\bold{g}}&=0\end{aligned} p˙v˙q˙b˙ab˙ωg˙=v=a=21qω=na=nω=0
真值状态的观测来源于IMU测量的加速度和角速度(IMU系)
{ a m = R T ( a − g ) + b a + n a ω m = ω + b w + n ω    ⟹    { a = R ( a m − b a − n a ) + g ω = ω m − b ω − n ω \begin{aligned} & \begin{cases} \bold{a}_{m}=\bold{R}^{T}\left( \bold{a}-\bold{g}\right) +\bold{b}_{a}+\bold{n} _{a}\\ \bm{\omega} _{m}=\bm{\omega} +\bold{b}_{\bold{w}}+\bold{n}_{\bm{\omega} }\\ \end{cases}\\ \implies & \begin{cases} \bold{a}=\bold{R} \left( \bold{a}_{m}-\bold{b}_{a}-\bold{n}_{a}\right) +\bold{g} \\ \bm{\omega} =\bm{\omega} _{m}-\bold{b}_{\bm{\omega}} -\bold{n}_{\bm{\omega}} \end{cases} \end{aligned} {am=RT(ag)+ba+naωm=ω+bw+nω{a=R(ambana)+gω=ωmbωnω
代入可得

p ˙ = v v ˙ = R ( a m − b a − n a ) + g q ˙ = 1 2 q ⊗ ( ω m − b ω − n ω ) b ˙ a = n b a b ˙ ω = n b ω g ˙ = 0 (true state) \begin{aligned} \dot{\bold{p}}&=\bold{v}\\ \dot{\bold{v}}&=\bold{R}\left( \bold{a}_{m}-\bold{b}_{a}-\bold{n}_{a}\right) +\bold{g}\\ \dot{\bold{q}}&=\dfrac{1}{2}\bold{q}\otimes \left( \bm{\omega} _{m}-\bold{b}_{\bm{\omega} }-\bold{n} _{\bm{\omega}} \right) \\ \dot{\bold{b}}_{a}&=\bold{n}_{\bold{ba}} \\ \dot{\bold{b}}_{\bm{\omega}}&=\bold{n}_{\bold{b}{\bm{\omega}}}\\ \dot{\bold{g}}&=0 \end{aligned}\tag{true state} p˙v˙q˙b˙ab˙ωg˙=v=R(ambana)+g=21q(ωmbωnω)=nba=nbω=0(true state)
写成更简便的形式
x ˙ = f ( x , u , w ) \dot{\bold{x}}=f(\bold{x},\bold{u},\bold{w}) x˙=f(x,u,w)
其中 x \bold{x} x为状态向量, u \bold{u} u为受噪声影响的IMU测量, w \bold{w} w为高斯白噪声扰动
x = [ p v q b a b ω g ] u = [ a m − n a ω m − n ω ] w = [ n b a n b ω ] \bold{x}=\begin{bmatrix}\bold{p}\\\bold{v}\\\bold{q}\\\bold{b_a}\\\bold{b}_{\bm{\omega}}\\\bold{g}\end{bmatrix}\qquad \bold{u}=\begin{bmatrix}\bold{a}_{m}-\bold{n_{a}}\\ \bm{\omega}_{m}-\bold{n_{\bm{\omega}}}\end{bmatrix}\qquad \bold{w}=\begin{bmatrix}\bold{n}_{\bold{ba}}\\\bold{n}_{\bold{b}{\bm{\omega}}}\end{bmatrix} x= pvqbabωg u=[amnaωmnω]w=[nbanbω]

The nominal-state kinematics

系统的名义态运动学方程对应于无噪声和扰动的系统模型。

p ˉ ˙ = v ˉ v ˉ ˙ = R ˉ ( a m − b ˉ a ) + g ˉ q ˉ ˙ = 1 2 q ˉ ⊗ ( ω m − b ˉ ω ) b ˉ ˙ a = 0 b ˉ ˙ ω = 0 g ˉ ˙ = 0 (nominal state) \begin{aligned} \dot{\bar{\bold{p}}}&=\bar{\bold{v}}\\ \dot{\bar{\bold{v}}}&=\bar{\bold{R}}\left( \bold{a}_{m}-\bar{\bold{b}}_{a}\right) +\bar{\bold{g}}\\ \dot{\bar{\bold{q}}}&=\dfrac{1}{2}\bar{\bold{q}}\otimes \left( \bm{\omega} _{m}-\bar{\bold{b}}_{\bm{\omega} } \right) \\ \dot{\bar{\bold{b}}}_{a}&=0 \\ \dot{\bar{\bold{b}}}_{\bm{\omega}}&=0\\ \dot{\bar{\bold{g}}}&=0 \end{aligned}\tag{nominal state} pˉ˙vˉ˙qˉ˙bˉ˙abˉ˙ωgˉ˙=vˉ=Rˉ(ambˉa)+gˉ=21qˉ(ωmbˉω)=0=0=0(nominal state)

The error-state kinematics

x = x ˉ + δ x    ⟹    δ x = x − x ˉ \bold{x}=\bar{\bold{x}}+\delta \bold{x}\implies \delta \bold{x}=\bold{x}-\bar{\bold{x}} x=xˉ+δxδx=xxˉ,其中+,-代指compose和decompose,根据变量类型采取不同的compose方式, 对于四元数
q = q ˉ ⊗ δ q \bold{q}=\bar{\bold{q}}\otimes \delta \bold{q} q=qˉδq
为了简便起见,我们将角速度分成大信号量项 ω ˉ ≜ ω m − b ˉ ω \bar{\bm{\omega}}\triangleq \bm{\omega}_m-\bar{\bold{b}}_{\bm{\omega}} ωˉωmbˉω和小信号量项 δ ω = − δ b ω − n ω \delta \bm{\omega}=-\delta \bold{b}_{\bm{\omega}}-\bold{n}_{\bm{\omega}} δω=δbωnω
ω = ω ˉ + δ ω \bm{\omega}=\bar{\bm{\omega}}+\delta\bm{\omega} ω=ωˉ+δω
于是
q ˙ = q ˉ ˙ ⊗ δ q + q ˉ ⊗ δ q ˙ = 1 2 q ⊗ ( ω m − b ω − n ω ) 1 2 q ˉ ⊗ ( ω m − b ˉ ω ) ⊗ δ q + q ˉ ⊗ δ q ˙ = 1 2 q ˉ ⊗ δ q ⊗ ( ω m − b ω − n ω )    ⟹    2 δ q ˙ = δ q ⊗ ω − ω ˉ ⊗ δ q = ( [ ω ] R − [ ω ˉ ] L ) δ q = [ 0 − ( ω − ω ˉ ) T ω − ω ˉ − ( ω + ω ˉ ) ∧ ] δ q = [ 0 − δ ω T δ ω − ( 2 ω + δ ω ˉ ) ∧ ] δ q \begin{aligned} \dot{\bold{q}}=\dot{\bar{\bold{q}}}\otimes \delta \bold{q}+\bar{\bold{q}}\otimes \dot{\delta \bold{q}}&=\dfrac{1}{2}\bold{q}\otimes \left( \bm{\omega} _{m}-\bold{b}_{\bm{\omega}} -\bold{n}_{\bm{\omega}} \right) \\ \dfrac{1}{2}\bar{\bold{q}}\otimes \left( \bm{\omega}_{m}-\bar{\bold{b}}_{\bm{\omega}}\right)\otimes\delta \bold{q} +\bar{\bold{q}}\otimes \dot{\delta \bold{q}}&=\dfrac{1}{2}\bar{\bold{q}}\otimes \delta \bold{q}\otimes \left( \bm{\omega} _{m}-\bold{b}_{\bm{\omega}}-\bold{n}_{\bm{\omega}}\right) \\ \implies 2 \dot{\delta \bold{q}}&=\delta \bold{q}\otimes \bm{\omega}-\bar{\bm{\omega}}\otimes\delta \bold{q} \\&=\left([\bm{\omega}]_R-[\bar{\bm{\omega}}]_L\right)\delta \bold{q} \\&=\begin{bmatrix} 0 & -\left( \bm{\omega} -\bar{\bm{\omega} }\right) ^{T} \\ \bm{\omega} -\bar{\bm{\omega} } & -\left( \bm{\omega} +\bar{\bm{\omega} }\right) ^{\wedge } \end{bmatrix} \delta \bold{q} \\&=\begin{bmatrix} 0 & -\delta\bm{\omega}^{T} \\ \delta\bm{\omega} & -\left( 2\bar{\bm{\omega} +\delta\bm{\omega} }\right) ^{\wedge } \end{bmatrix} \delta \bold{q} \end{aligned} q˙=qˉ˙δq+qˉδq˙21qˉ(ωmbˉω)δq+qˉδq˙2δq˙=21q(ωmbωnω)=21qˉδq(ωmbωnω)=δqωωˉδq=([ω]R[ωˉ]L)δq=[0ωωˉ(ωωˉ)T(ω+ωˉ)]δq=[0δωδωT(2ω+δωˉ)]δq
δ q \delta \bold{q} δq进行小量近似, δ q = [ cos ⁡ ( ∥ δ θ ∥ / 2 ) δ θ ∥ δ θ ∥ sin ⁡ ( ∥ δ θ ∥ / 2 ) ] ≈ [ 1 δ θ / 2 ] + O ( ∥ δ θ ∥ 2 ) \delta \bold{q}=\begin{bmatrix}\cos(\Vert\delta \bm{\theta}\Vert/2)\\\dfrac{\delta\bm{\theta}}{\Vert\delta\bm{\theta}\Vert} \sin(\Vert\delta \bm{\theta}\Vert/2)\end{bmatrix}\approx\begin{bmatrix}1\\\delta \bm{\theta}/2\end{bmatrix}+O(\Vert\delta\bm{\theta}\Vert^2) δq= cos(δθ∥/2)δθδθsin(δθ∥/2) [1δθ/2]+O(δθ2),于是
[ 0 δ θ ˙ ] = [ 0 − δ ω T δ ω − ( 2 ω + δ ω ) ∧ ] [ 1 δ θ / 2 ] + O ( ∥ δ θ ∥ 2 )    ⟹    δ θ ˙ = δ ω − ω ∧ δ θ − 1 2 δ ω ∧ δ θ + O ( ∥ δ θ ∥ 2 ) \begin{aligned} \begin{bmatrix} 0 \\ \dot{\delta\bm{\theta}} \end{bmatrix}&=\begin{bmatrix} 0 & -\delta \bm{\omega}^{T} \\ \delta \bm{\omega} & -\left( 2\bm{\omega} +\delta \bm{\omega}\right) ^{\wedge } \end{bmatrix}\begin{bmatrix} 1 \\ \delta \bm{\theta} /2 \end{bmatrix}+O\left( \left\| \delta \bm{\theta} \right\| ^{2}\right) \\ \implies\dot{\delta\bm{\theta}}&=\delta \bm{\omega}-\bm{\omega}^{\wedge}\delta\bm{\theta}-\dfrac{1}{2} \delta\bm{\omega}^{\wedge}\delta \bm{\theta}+O(\Vert\delta\bm{\theta}\Vert^2) \end{aligned} [0δθ˙]δθ˙=[0δωδωT(2ω+δω)][1δθ/2]+O(δθ2)=δωωδθ21δωδθ+O(δθ2)
忽略二阶小量之后,可以得到
δ θ ˙ = δ ω − ω ∧ δ θ = − ( ω m − b ω ) ∧ δ θ − δ b ω − n ω \begin{aligned} \dot{\delta\bm{\theta}}&=\delta \bm{\omega}-\bm{\omega}^{\wedge}\delta\bm{\theta}\\ &=-(\bm{\omega}_{m}-\bold{b}_{\bm{\omega}})^{\wedge}\delta\bm{\theta}-\delta \bold{b}_{\bm{\omega}}-\bold{n}_{\bm{\omega}} \end{aligned} δθ˙=δωωδθ=(ωmbω)δθδbωnω
对于SO(3)
R = R ˉ δ R = R ˉ E x p ( δ θ ) ≈ R ˉ ( I + δ θ ∧ ) + O ( ∥ δ θ ∥ 2 ) \begin{aligned} \bold{R}&=\bar{\bold{R}}\delta \bold{R}\\ &=\bar{\bold{R}}{\rm Exp}\left( \delta \bm{\theta} \right) \\ &\approx \bar{\bold{R}}\left( \bold{I}+\delta \bm{\theta} ^{\wedge }\right) +O\left( \left\| \delta \bm{\theta} \right\| ^{2}\right) \end{aligned} R=RˉδR=RˉExp(δθ)Rˉ(I+δθ)+O(δθ2)
其中 δ θ \delta\bm{\theta} δθ δ R \delta \bold{R} δR的李代数。
δ v ˙ = v ˙ − v ˉ ˙ = [ R ( a m − b a − n a ) + g ] − [ R ˉ ( a m − b ˉ a ) + g ˉ ] = [ R ( a m − b ˉ a − δ b a − n a ) + g ] − [ R ˉ ( a m − b ˉ a ) + g ˉ ] = ( R − R ˉ ) ( a m − b ˉ a ) − R ( δ b a + n a ) + δ g = R ˉ [ E x p ( δ θ ) − I ] ( a m − b ˉ a ) − R ˉ E x p ( δ θ ) ( δ b a + n a ) + δ g = R ˉ δ θ ∧ ( a m − b ˉ a ) − R ˉ ( I + δ θ ∧ ) ( δ b a + n a ) + δ g \begin{aligned} \dot{\delta \bold{v}}=\dot{\bold{v}}-\dot{\bar{\bold{v}}}&= \left[ \bold{R}\left( \bold{a}_{m}-\bold{b_a}-\bold{n}_{a}\right) +\bold{g}\right] -\left[ \bar{\bold{R}}\left( \bold{a}_{m}-\bar{\bold{b}}_{a}\right) +\bar{\bold{g}}\right] \\ &=\left[ \bold{R}\left( \bold{a}_{m}-\bar{\bold{b}}_a-\delta \bold{b}_{a}-\bold{n}_{a}\right) +\bold{g}\right] -\left[ \bar{\bold{R}}\left( \bold{a}_{m}-\bar{\bold{b}}_{a}\right) +\bar{\bold{g}}\right] \\ &=\left( \bold{R}-\bar{\bold{R}}\right) \left( \bold{a}_{m}-\bar{\bold{b}}_{a}\right) -\bold{R}\left( \delta \bold{b_a}+\bold{n}_{a}\right) +\delta \bold{g} \\ &=\bar{\bold{R}}\left[{\rm Exp}(\delta\bm{\theta})-\bold{I}\right]\left( \bold{a}_{m}-\bar{\bold{b}}_a\right) -\bar{\bold{R}}{\rm Exp}(\delta\bm{\theta})\left( \delta \bold{b_a}+\bold{n}_{a}\right)+\delta \bold{g} \\ &=\bar{\bold{R}}\delta\bm{\theta}^{\wedge}\left( \bold{a}_{m}-\bar{\bold{b}}_a\right)-\bar{\bold{R}}\left(\bold{I}+\delta\bm{\theta}^{\wedge}\right)\left( \delta \bold{b_a}+\bold{n}_{a}\right)+\delta \bold{g} \end{aligned} δv˙=v˙vˉ˙=[R(ambana)+g][Rˉ(ambˉa)+gˉ]=[R(ambˉaδbana)+g][Rˉ(ambˉa)+gˉ]=(RRˉ)(ambˉa)R(δba+na)+δg=Rˉ[Exp(δθ)I](ambˉa)RˉExp(δθ)(δba+na)+δg=Rˉδθ(ambˉa)Rˉ(I+δθ)(δba+na)+δg

忽略二阶小量 δ ⋅ δ \delta\cdot\delta δδ δ ⋅ n \delta \cdot \bold{n} δn,同时利用 a ∧ b = − b ∧ a \bold{a}^{\wedge}\bold{b}=-\bold{b}^{\wedge}\bold{a} ab=ba可得
δ v ˙ = R ˉ [ − ( a m − b ˉ a ) ∧ δ θ − δ b a − n a ] + δ g \dot{\delta \bold{v}}=\bar{\bold{R}}\left[ -\left( \bold{a}_{m}-\bar{\bold{b}}_{a}\right) ^{\wedge }\delta \bm{\theta} -\delta \bold{b_a}-\bold{n}_{a}\right] +\delta \bold{g} δv˙=Rˉ[(ambˉa)δθδbana]+δg
我们假设加速度计噪声是白噪声、不相关的、各向同性的。
E ( n a ) = 0 E ( n a n a T ) = σ a 2 I E(\bold{n}_a)=0\quad E(\bold{n}_{a} \bold{n}_a^T)=\sigma_a^2 \bold{I} E(na)=0E(nanaT)=σa2I
也就是说,协方差椭球是一个以原点为中心的球体,这意味着它的均值和协方差矩阵在旋转时是不变的。
证明: E ( R n a ) = R E ( n a ) = 0 E(\bold{R} \bold{n}_a)=\bold{R} E(\bold{n}_a)=0 E(Rna)=RE(na)=0 E [ ( R n a ) ( R n a ) T ] = R E [ n a n a T ] R T = R σ a 2 I R T = σ a 2 I E[(\bold{R} \bold{n}_a)(\bold{R} \bold{n}_a)^T] = \bold{R}E[\bold{n}_a \bold{n}_a^T]\bold{R}^T= \bold{R}\sigma_a^2 \bold{I} \bold{R}^T = \sigma_a^2 \bold{I} E[(Rna)(Rna)T]=RE[nanaT]RT=Rσa2IRT=σa2I。然后我们可以重新定义加速度计噪声矢量:
n a ← R n a \bold{n}_a\leftarrow \bold{R} \bold{n}_a naRna
其余误差状态量的微分方程可以很容易的得到,于是

δ p ˙ = δ v δ v ˙ = R ˉ [ − ( a m − b ˉ a ) ∧ δ θ − δ b a ] + δ g − n a δ θ ˙ = − ( ω m − b ω ) ∧ δ θ − δ b ω − n ω δ b a ˙ = n b a δ b ω ˙ = n b ω δ g ˙ = 0 (error state) \begin{aligned} \dot{\delta \bold{p}}&=\delta \bold{v}\\ \dot{\delta \bold{v}}&=\bar{\bold{R}}\left[ -\left( \bold{a}_{m}-\bar{\bold{b}}_{a}\right) ^{\wedge }\delta \bm{\theta} -\delta \bold{b_a}\right] +\delta \bold{g} -\bold{n}_{a}\\ \dot{\delta \bm{\theta}}&=-(\bm{\omega}_{m}-\bold{b}_{\bm{\omega}})^{\wedge}\delta\bm{\theta}-\delta \bold{b}_{\bm{\omega}}-\bold{n}_{\bm{\omega}}\\ \dot{\delta \bold{b}_{a}}&=\bold{n}_{\bold{ba}}\\ \dot{\delta \bold{b}_{\bm{\omega}}}&=\bold{n}_{\bold{b}{\bm{\omega}}}\\ \dot{\delta \bold{g}}&=0 \end{aligned}\tag{error state} δp˙δv˙δθ˙δba˙δbω˙δg˙=δv=Rˉ[(ambˉa)δθδba]+δgna=(ωmbω)δθδbωnω=nba=nbω=0(error state)

离散时间系统动力学

The nominal-state kinematics

p ← p + v Δ t + 1 2 ( R ( a m − b a ) + g ) Δ t 2 v ← v + ( R ( a m − b a ) + g ) Δ t q ← q ⊗ q { ( ω m − b ω ) Δ t } b a ← b a b ω ← b ω g ← g \begin{aligned} \bold{p}&\leftarrow \bold{p}+\bold{v}\Delta t+\dfrac{1}{2}\left( \bold{R}\left( \bold{a}_{m}-\bold{b_a}\right) +\bold{g}\right) \Delta t^{2}\\ \bold{v}&\leftarrow \bold{v}+\left( \bold{R}\left( \bold{a}_{m}-\bold{b_{a}}\right) +\bold{g}\right) \Delta t\\ \bold{q}&\leftarrow \bold{q}\otimes \bold{q}\left\{ \left( \bm{\omega}_{m}-\bold{b}_{\bm{\omega}}\right) \Delta t\right\} \\ \bold{b_a}&\leftarrow \bold{b_a}\\ \bold{b}_{\bm{\omega}}&\leftarrow \bold{b}_{\bm{\omega}} \\ \bold{g}&\leftarrow \bold{g} \end{aligned} pvqbabωgp+vΔt+21(R(amba)+g)Δt2v+(R(amba)+g)Δtqq{(ωmbω)Δt}babωg

The error-state kinematics

δ p ← δ p + δ v Δ t δ v ← δ v + ( − R ˉ ( a m − b a ) ∧ δ θ − R ˉ δ b a + δ g ) Δ t + v i δ θ ← R T { ( ω m − b ω ) Δ t } δ θ − b ω Δ t + θ i δ b a ← δ b a + a i δ b ω ← δ b ω + ω i δ g ← δ g \begin{aligned} \delta \bold{p}&\leftarrow \delta \bold{p}+\delta \bold{v}\Delta t\\ \delta \bold{v}&\leftarrow \delta \bold{v}+\left( -\bar{\bold{R}}\left( \bold{a}_{m}-\bold{b_a}\right) ^{\wedge }\delta \bm{\theta} -\bar{\bold{R}}\delta \bold{b_a}+\delta \bold{g}\right) \Delta t + \bold{v}_{i}\\ \delta \bm{\theta} &\leftarrow \bold{R}^{T}\left\{ \left( \bm{\omega}_{m}-\bold{b}_{\bm{\omega}} \right) \Delta t\right\} \delta \bm{\theta} -\bold{b}_{\bm{\omega}} \Delta t+\bm{\theta} _{i}\\ \delta \bold{b}_{a}&\leftarrow \delta \bold{b_a}+\bold{a}_i\\ \delta \bold{b}_{\bm{\omega}}&\leftarrow \delta \bold{b}_{\bm{\omega}}+\bm{\omega}_{i}\\ \delta \bold{g}&\leftarrow \delta \bold{g}\end{aligned} δpδvδθδbaδbωδgδp+δvΔtδv+(Rˉ(amba)δθRˉδba+δg)Δt+viRT{(ωmbω)Δt}δθbωΔt+θiδba+aiδbω+ωiδg
其中 δ θ \delta\bm{\theta} δθ式的积分参照, v i , θ i , a i \bold{v}_i,\bm{\theta}_i,\bold{a}_i vi,θi,ai ω i \bm{\omega}_i ωi 是应用于速度,方向和偏置估计的随机脉冲,建模为高斯白噪声过程。它们的均值为零,它们的协方差矩阵由 n a 、 n ω 、 n b a \bold{n}_a、\bold{n}_{\bm{\omega}}、\bold{n}_{\bold{b_a}} nanωnba n b ω \bold{n}_{\bold{b}_{\bm{\omega}}} nbω的协方差在步长 Δ t \Delta t Δt积分得到(参照)
V i = σ a 2 Δ t 2 I Θ i = σ ω 2 Δ t 2 I A i = σ b a 2 Δ t I Ω i = σ b ω 2 Δ t I \begin{aligned} \bold{V_i}&=\sigma_{a}^2 \Delta t^2 \bold{I}\\ \bold{\Theta_i}&=\sigma_{\bm{\omega}}^2 \Delta t^2 \bold{I}\\ \bold{A_i}&=\sigma_{\bold{b_a}}^2\Delta t \bold{I}\\ \bm{\Omega}_{\bold{i}}&=\sigma_{\bold{b}_{\bm{\omega}}}^2\Delta t \bold{I} \end{aligned} ViΘiAiΩi=σa2Δt2I=σω2Δt2I=σba2ΔtI=σbω2ΔtI
其中 σ a [ m / s 2 ] , σ ω [ r a d / s ] , σ b a [ m / s 2 s ] , σ b ω [ r a d / s s ] \sigma_{a}[m/s^2],\sigma_{\bm{\omega}}[rad/s],\sigma_{\bold{b_a}}[m/s^2\sqrt{s}],\sigma_{\bold{b}_{\bm{\omega}}}[rad/s\sqrt{s}] σa[m/s2],σω[rad/s],σba[m/s2s ],σbω[rad/ss ]由IMU的数据手册或标定得到。

The error-state Jacobian and perturbation matrices

x = [ p v q b a b ω g ] δ x = [ δ p δ v δ θ δ b a δ b ω δ g ] u m = [ a m ω m ] i = [ v i θ i a i w i ] \bold{x}=\begin{bmatrix} \bold{p} \\ \bold{v} \\ \bold{q} \\ \bold{b_a} \\ \bold{b}_{\bm{\omega}} \\ \bold{g} \end{bmatrix}\quad \delta \bold{x}=\begin{bmatrix} \delta \bold{p} \\ \delta \bold{v} \\ \delta \bm{\theta} \\ \delta \bold{b_a} \\ \delta \bold{b}_{\bm{\omega}} \\ \delta \bold{g} \end{bmatrix} \quad \bold{u}_m=\begin{bmatrix} \bold{a}_m\\\bm{\omega}_m \end{bmatrix} \quad i=\begin{bmatrix} \bold{v}_{i} \\ \bm{\theta} _{i} \\ \bold{a}_{i} \\ \bold{w}_{i} \end{bmatrix} x= pvqbabωg δx= δpδvδθδbaδbωδg um=[amωm]i= viθiaiwi
误差状态系统方程可以写作
δ x ← f ( x , δ x , u m , i ) = F x ( x , u m ) ⋅ δ x + F i ⋅ i \delta \bold{x}\leftarrow f\left( \bold{x},\delta \bold{x},\bold{u}_{m},\bold{i}\right) =\bold{F}_{\bold{x}}\left( \bold{x},\bold{u}_{m}\right) \cdot \delta \bold{x}+\bold{F}_{i}\cdot \bold{i} δxf(x,δx,um,i)=Fx(x,um)δx+Fii
ESKF的预测步公式可以写成:
δ x ^ ← F x ( x , u m ) ⋅ δ x ^ p ← F x P F x T + F i Q i F i T \begin{aligned} \hat{\delta \bold{x}}&\leftarrow \bold{F}_{\bold{x}}\left( \bold{x},\bold{u}_{m}\right) \cdot \hat{\delta \bold{x}}\\ \bold{p}&\leftarrow \bold{F}_{\bold{x}}\bold{PF}_{\bold{x}}^{T}+\bold{F}_{i}\bold{\bold{Q}}_{i}\bold{F}_{i}^{T}\end{aligned} δx^pFx(x,um)δx^FxPFxT+FiQiFiT
其中 δ x ∼ N { δ x ^ , p } \delta \bold{x}\sim \mathcal{N}\{\hat{\delta \bold{x}},\bold{p}\} δxN{δx^,p} F x \bold{F_x} Fx F i \bold{F_i} Fi f ( ) f() f()对于误差和扰动向量的Jacobian矩阵。
以上Jacobian矩阵和协方差矩阵的详细表达式如下,其中所有与状态相关的值都直接从名义状态提取。
F x = ∂ f ∂ δ x ∣ x , u m = [ I I Δ t 0 0 0 0 0 I − R ( a m − b a ) ∧ Δ t − R Δ t 0 I Δ t 0 0 R T { ( ω m − b ω ) Δ t } 0 − I Δ t 0 0 0 0 I 0 0 0 0 0 0 I 0 0 0 0 0 0 I ] 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 0 0 0 0 ] Q i = [ V i 0 0 0 0 Θ i 0 0 0 0 A i 0 0 0 0 Ω i ] \bold{F}_{\bold{x}}= \dfrac{\partial f}{\partial \delta \bold{x}}{\Big\lvert} _{\bold{x},\bold{u}_m}= \begin{bmatrix} \bold{I} & \bold{I}\Delta t & 0 & 0 & 0 & 0 \\ 0 & \bold{I} & -\bold{R} \left( \bold{a}_{m}-\bold{b_a}\right) ^{\wedge }\Delta t & -\bold{R}\Delta t & 0 & \bold{I}\Delta t \\ 0 & 0 & \bold{R}^{T}\left\{ \left( \bm{\omega}_{m}-\bold{b}_{\bm{\omega}}\right) \Delta t\right\} & 0 & -\bold{I}\Delta t & 0 \\ 0 & 0 & 0 & \bold{I} & 0 & 0 \\ 0 & 0 & 0 & 0 & \bold{I} & 0 \\ 0 & 0 & 0 & 0 & 0 & \bold{I} \end{bmatrix} \\ \bold{F}_{i}= \dfrac{\partial f}{\partial \bold{i}}{\Big\lvert}_{\bold{x},\bold{u}_{m}} =\begin{bmatrix} 0 & 0 & 0 & 0 \\ \bold{I} & 0 & 0 & 0 \\ 0 & \bold{I} & 0 & 0 \\ 0 & 0 & \bold{I} & 0 \\ 0 & 0 & 0 & \bold{I} \\ 0 & 0 & 0 & 0 \end{bmatrix}\quad \bold{\bold{Q}}_{i}=\begin{bmatrix} \bold{V_{i}} & 0 & 0 & 0 \\ 0 & \bm{\Theta}_{\bold{i}} & 0 & 0 \\ 0 & 0 & \bold{A_i} & 0 \\ 0 & 0 & 0 & \bm{\Omega}_{\bold{i}} \end{bmatrix} Fx=δxf x,um= I00000IΔtI00000R(amba)ΔtRT{(ωmbω)Δt}0000RΔt0I0000IΔt0I00IΔt000I Fi=if x,um= 0I000000I000000I000000I0 Qi= Vi0000Θi0000Ai0000Ωi

Fusing IMU with complementary sensory data

到目前为止,IMU的信息用于对ESKF进行预测,其他信息可以用于滤波器的校正,校正包含三步:

  1. 通过观测校正误差状态
  2. 将校正后的误差状态加入标称状态
  3. 重置误差状态

校正误差状态

通常我们有一个传感器,他的测量取决于状态:
y = h ( x , n ) \bold{y}=h(\bold{x},\bold{n}) y=h(x,n)
其中 n \bold{n} n是高斯白噪声。
n ∼ N { 0 , R } \bold{n}\sim\mathcal{N}\{0,\bold{R}\} nN{0,R}
滤波器校正步:
K = P H T ( H P H T + M R M T ) − 1 δ x ^ ← K ( y − h ( x ^ ) ) p ← ( I − K H ) p \begin{aligned} \bold{K}&=\bold{PH}^T(\bold{HPH}^T+\bold{MRM}^T)^{-1}\\ \hat{\delta \bold{x}}&\leftarrow \bold{K}\left(\bold{y}-h(\hat{\bold{x}})\right)\\ \bold{p}&\leftarrow (\bold{I}-\bold{KH})\bold{p} \end{aligned} Kδx^p=PHT(HPHT+MRMT)1K(yh(x^))(IKH)p
H \bold{H} H为相对误差状态 δ x \delta \bold{x} δx的Jacobian矩阵,且要求在最佳估计状态 x ^ = x ˉ ⊞ δ x ^ \hat{\bold{x}}=\bar{\bold{x}}\boxplus\hat{\delta \bold{x}} x^=xˉδx^处展开。由于在此阶段我们还没有观察到误差状态,故 x ^ = x ˉ \hat{\bold{x}}=\bar{\bold{x}} x^=xˉ,我们可以用名义状态 x ˉ \bar{\bold{x}} xˉ作为评估点。
H ≡ ∂ h ∂ δ x ∣ x ˉ M ≡ ∂ h ∂ n ∣ x ˉ \begin{aligned} \bold{H}&\equiv \dfrac{\partial h}{\partial \delta \bold{x}}{\Big \lvert}_{\bar{\bold{x}}} \\ \bold{M}&\equiv\dfrac{\partial h}{\partial \bold{n}}{\Big \lvert}_{\bar{\bold{x}}}\\ \end{aligned} HMδxh xˉnh xˉ

Jacobian矩阵的计算

H ≜ ∂ h ∂ δ x ∣ x ˉ = ∂ h ∂ x ∣ x ˉ ∂ x ∂ δ x ∣ x ˉ = H x X δ x \bold{H}\triangleq \dfrac{\partial h}{\partial \delta \bold{x}}{\Big\lvert}_{\bar{\bold{x}}}=\dfrac{\partial h}{\partial \bold{x}}{\Big\lvert}_{\bar{\bold{x}}}\dfrac{\partial \bold{x}}{\partial \delta \bold{x}}{\Big\lvert}_{\bar{\bold{x}}}=\bold{H_x} \bold{X}_{\delta \bold{x}} Hδxh xˉ=xh xˉδxx xˉ=HxXδx
其中 H x ≜ ∂ h ∂ x ∣ x ˉ \bold{H_x}\triangleq \dfrac{\partial h}{\partial \bold{x}}{\Big\lvert}_{\bar{\bold{x}}} Hxxh xˉ是通常卡尔曼滤波中 h ( ) h() h()的Jacobian矩阵。
X δ x = [ ∂ ( p + δ p ) ∂ δ p ∂ ( v + δ v ) ∂ δ v 0 ∂ ( q ⊗ δ q ) ∂ δ θ ∂ ( b a + δ b a ) ∂ δ b a 0 ∂ ( b ω + δ b ω ) ∂ δ b ω ∂ ( g + δ g ) ∂ δ g ] = [ I 6 0 0 0 Q δ θ 0 0 0 I 9 ] \begin{aligned} \bold{X}_{\delta \bold{x}}&= \begin{bmatrix} \dfrac{\partial (\bold{p}+\delta \bold{p})}{\partial \delta \bold{p}}&&&&&\\ & \dfrac{\partial (\bold{v}+\delta \bold{v})}{\partial \delta \bold{v}}&&&0&\\ &&\dfrac{\partial (\bold{q}\otimes\delta \bold{q})}{\partial \delta \bm{\theta}}&&&\\ &&&\dfrac{\partial (\bold{b_a}+\delta \bold{b_a})}{\partial \delta \bold{b_a}}&&\\ &0&&&\dfrac{\partial (\bold{b}_{\bm{\omega}}+\delta \bold{b}_{\bm{\omega}})}{\partial \delta \bold{b}_{\bm{\omega}}}&\\ &&&&&\dfrac{\partial (\bold{g}+\delta \bold{g})}{\partial \delta \bold{g}} \end{bmatrix}\\ &=\begin{bmatrix} \bold{I}_6&0&0\\ 0 & \bold{Q}_{\delta \bm{\theta}}&0\\ 0&0&\bold{I}_9 \end{bmatrix} \end{aligned} Xδx= δp(p+δp)δv(v+δv)0δθ(qδq)δba(ba+δba)0δbω(bω+δbω)δg(g+δg) = I6000Qδθ000I9
Q δ θ = ∂ ( q ⊗ δ q ) ∂ δ θ ∣ q = ∂ ( q ⊗ δ q ) ∂ δ q ∣ q ∂ δ q ∂ δ θ ∣ δ θ ^ = 0 = ∂ ( [ q ] L δ q ) ∂ δ q ∣ q ∂ [ 1 1 2 δ θ ] ∂ δ θ ∣ δ θ ^ = 0 = [ q ] L 1 2 [ 0 0 0 1 0 0 0 1 0 0 0 1 ] = 1 2 [ − q x − q y − q z q w − q z q y q z q w − q x − q y q x q w ] \begin{aligned} \bold{Q}_{\delta \bm{\theta}}&=\dfrac{\partial(\bold{q}\otimes \delta \bold{q})}{\partial \delta \bm{\theta}}{\Big\lvert}_{\bold{q}}=\dfrac{\partial(\bold{q}\otimes \delta \bold{q})}{\partial\delta \bold{q}}{\Big\lvert}_q \dfrac{\partial\delta \bold{q}}{\partial \delta \bm{\theta}}{\Big\lvert}_{\hat{\delta \bm{\theta}}=0}\\ &=\dfrac{\partial([\bold{q}]_L \delta \bold{q})}{\partial\delta \bold{q}}{\Big\lvert}_q \dfrac{\partial\begin{bmatrix}1\\\frac{1}{2}\delta \bm{\theta}\end{bmatrix}}{\partial \delta \bm{\theta}}{\Big\lvert}_{\hat{\delta \bm{\theta}}=0} \\&=[\bold{q}]_L \dfrac{1}{2}\begin{bmatrix}0&0&0\\1&0&0\\0&1&0\\0&0&1\end{bmatrix} \\&=\dfrac{1}{2}\begin{bmatrix}-q_x&-q_y&-q_z\\q_w&-q_z&q_y\\q_z&q_w&-q_x\\-q_y&q_x&q_w\end{bmatrix} \end{aligned} Qδθ=δθ(qδq) q=δq(qδq) qδθδq δθ^=0=δq([q]Lδq) qδθ[121δθ] δθ^=0=[q]L21 010000100001 =21 qxqwqzqyqyqzqwqxqzqyqxqw

校正误差加入名义状态

在ESKF更新之后,就需要用校正后的误差状态去校正名义状态
x ← x ⊞ δ x ^ \bold{x}\leftarrow \bold{x}\boxplus \hat{\delta \bold{x}} xxδx^

p ← p + δ p ^ v ← v + δ v ^ q ← q ⊗ q { δ θ ^ } b a ← b a + δ b a ^ b ω ← b ω + δ b ω ^ g ← g + δ g ^ \begin{aligned} \bold{p}&\leftarrow \bold{p}+\hat{\delta \bold{p}}\\ \bold{v}&\leftarrow \bold{v}+\hat{\delta \bold{v}}\\ \bold{q}&\leftarrow \bold{q}\otimes \bold{q}\{\hat{\delta \bm{\theta}}\} \\ \bold{b}_{a}&\leftarrow \bold{b_a}+\hat{\delta \bold{b_a}}\\ \bold{b}_{\bm{\omega} }&\leftarrow \bold{b}_{\bm{\omega}} +\hat{\delta \bold{b}_{\bm{\omega}}}\\ \bold{g}&\leftarrow \bold{g} +\hat{\delta \bold{g}} \end{aligned} pvqbabωgp+δp^v+δv^qq{δθ^}ba+δba^bω+δbω^g+δg^

ESKF reset

在误差状态加入名义状态后,误差状态均值 δ x ^ \hat{\delta \bold{x}} δx^被重置。这与方向部分尤其相关,因为新的方向误差在新的名义状态的局部坐标系表达。为了使ESKF更新完整,需要根据此修改误差状态的协方差。
令误差状态重置函数为 g ( ⋅ ) \bold{g}(\cdot) g()
δ x ← g ( δ x ) = δ x ⊟ δ x ^ \delta \bold{x}\leftarrow \bold{g}(\delta \bold{x})=\delta \bold{x}\boxminus \hat{\delta \bold{x}} δxg(δx)=δxδx^
δ x ^ ← 0 p ← G P G T \begin{aligned} \hat{\delta \bold{x}}&\leftarrow 0\\ \bold{p}&\leftarrow \bold{GPG}^T \end{aligned} δx^p0GPGT
其中 G \bold{G} G是Jacobian矩阵
G ≜ ∂ g ∂ δ x ∣ δ x ^ = [ I 6 0 0 0 I − ( 1 2 δ θ ^ ) ∧ 0 0 0 I 9 ] \begin{aligned} \bold{G}&\triangleq\dfrac{\partial \bold{g}}{\partial \delta \bold{x}}{\Big \lvert}_{\hat{\delta \bold{x}}}\\ &=\begin{bmatrix} I_6&0&0\\ 0&\bold{I}-\left(\frac{1}{2}\hat{\delta\bm{\theta}}\right)^{\wedge}&0\\ 0&0&I_9 \end{bmatrix} \end{aligned} Gδxg δx^= I6000I(21δθ^)000I9
下面给出方向误差块的导数推导

Jacobian of the reset operation to the orientation error

基于以下事实:

  • 真实的方向经过error reset是不改变的,即 q + = q \bold{q}^{+}=\bold{q} q+=q
    q ˉ + ⊗ δ q + = q ˉ ⊗ δ q \bar{\bold{q}}^{+}\otimes \delta \bold{q}^{+}=\bar{\bold{q}}\otimes \delta \bold{q} qˉ+δq+=qˉδq
  • 观测误差的均值已经被加入名义状态
    q ˉ + = q ˉ ⊗ δ q ^ \bar{\bold{q}}^{+}=\bar{\bold{q}}\otimes\hat{\delta \bold{q}} qˉ+=qˉδq^
    将两个事实结合起来,可得
    δ q + = ( q ˉ + ) ∗ ⊗ q ˉ ⊗ δ q = ( q ˉ ⊗ δ q ^ ) ∗ ⊗ q ˉ ⊗ δ q = δ q ^ ∗ ⊗ δ q = [ δ q ^ ∗ ] L ⋅ δ q \delta \bold{q}^{+}=(\bar{\bold{q}}^{+})^{\ast}\otimes\bar{\bold{q}}\otimes\delta \bold{q} =\left(\bar{\bold{q}}\otimes\hat{\delta \bold{q}}\right)^{\ast}\otimes\bar{\bold{q}}\otimes\delta \bold{q}=\hat{\delta \bold{q}}^{\ast}\otimes\delta \bold{q}=[\hat{\delta \bold{q}}^{\ast}]_L\cdot\delta \bold{q} δq+=(qˉ+)qˉδq=(qˉδq^)qˉδq=δq^δq=[δq^]Lδq
    使用四元数小量近似 δ q ^ ∗ ≈ [ 1 − 1 2 δ θ ^ ] \hat{\delta \bold{q}}^{\ast}\approx\begin{bmatrix}1\\-\frac{1}{2}\hat{\delta \bm{\theta}}\end{bmatrix} δq^[121δθ^],上式可化为
    [ 1 1 2 δ θ + ] = [ 1 1 2 δ θ ^ T − 1 2 δ θ ^ I − ( 1 2 δ θ ^ ) ∧ ] [ 1 1 2 δ θ ] + O ( ∥ δ θ ∥ 2 ) \begin{bmatrix}1\\\frac{1}{2}\delta \bm{\theta}^{+}\end{bmatrix}=\begin{bmatrix}1&\frac{1}{2}\hat{\delta \bm{\theta}}^T\\-\frac{1}{2}\hat{\delta \bm{\theta}}&\bold{I}-\left(\frac{1}{2}\hat{\delta\bm{\theta}}\right)^{\wedge}\end{bmatrix} \begin{bmatrix}1\\\frac{1}{2}\delta \bm{\theta}\end{bmatrix}+O(\lVert\delta \bm{\theta}\rVert^2) [121δθ+]= 121δθ^21δθ^TI(21δθ^) [121δθ]+O(∥δθ2)
    得到一个标量和一个矢量等式
    1 4 δ θ ^ T δ θ = O ( ∥ δ θ ∥ 2 ) δ θ + = − δ θ ^ + ( I − ( 1 2 δ θ ^ ) ∧ ) δ θ + O ( ∥ δ θ ∥ 2 ) \begin{aligned} \dfrac{1}{4}\hat{\delta \bm{\theta}}^T\delta \bm{\theta}&=O(\lVert\delta\bm{\theta}\rVert^2)\\ \delta\bm{\theta}^{+}&=-\hat{\delta\bm{\theta}}+\left(\bold{I}-\left(\frac{1}{2}\hat{\delta\bm{\theta}}\right)^{\wedge}\right)\delta \bm{\theta}+O(\lVert\delta\bm{\theta}\rVert^2) \end{aligned} 41δθ^Tδθδθ+=O(∥δθ2)=δθ^+(I(21δθ^))δθ+O(∥δθ2)
    第一个式子信息量不大,从第二个式子中我们可以看出 δ θ ^ + = 0 \hat{\delta\bm{\theta}}^{+}=0 δθ^+=0,这是我们在重置操作中期望得到的。
    ∂ δ θ + ∂ δ θ = I − ( 1 2 δ θ ^ ) ∧ \dfrac{\partial\delta\bm{\theta}^{+}}{\partial\delta \bm{\theta}}=\bold{I}-\left(\frac{1}{2}\hat{\delta\bm{\theta}}\right)^{\wedge} δθδθ+=I(21δθ^)

附录

Integration of the angular error


考虑无偏差和噪声的角误差动力学
δ θ = − ω ∧ δ θ \delta \bm{\theta} =-\bm{\omega} ^{\wedge }\delta \bm{\theta} δθ=ωδθ
状态转移矩阵可以写成泰勒级数的形式:
ϕ = e − ω ∧ Δ t = I − ω ∧ Δ t + 1 2 ! ω ∧ 2 Δ t 2 − 1 3 ! ω ∧ 3 Δ t 3 + 1 4 ! ω ∧ 4 Δ t 4 − … \begin{aligned}\bm{\phi} &=e^{-\bm{\omega} ^{\wedge}\Delta t}\\ &=\bold{I}-\bm{\omega} ^{\wedge }\Delta t+\dfrac{1}{2!}\bm{\omega} ^{\wedge 2}\Delta t^{2}-\dfrac{1}{3!}\bm{\omega}^{\wedge 3}\Delta t^{3}+\dfrac{1}{4!}\bm{\omega} ^{\wedge 4}\Delta t^{4}-\ldots \end{aligned} ϕ=eωΔt=IωΔt+2!1ω2Δt23!1ω3Δt3+4!1ω4Δt4
定义 ω Δ t = u Δ θ \bm{\omega}\Delta t=\bold{u}\Delta \bm{\theta} ωΔt=uΔθ为轴角的形式
ϕ = I − u ∧ ( Δ θ − Δ θ 3 3 ! + Δ θ 5 5 ! − … ) + u ∧ 2 ( Δ θ 2 2 ! − Δ θ 4 4 ! + Δ θ 6 6 ! − … ) = I − u ∧ sin ⁡ Δ θ + u ∧ 2 ( I − cos ⁡ Δ θ ) \begin{aligned} \bm{\phi} &=\bold{I}-\bold{u}^{\wedge}\left( \Delta \bm{\theta} -\dfrac{\Delta \bm{\theta} ^{3}}{3!}+\dfrac{\Delta \bm{\theta} ^{5}}{5!}-\ldots \right) +\bold{u}^{\wedge 2}\left( \dfrac{\Delta \bm{\theta} ^{2}}{2!}-\dfrac{\Delta \bm{\theta} ^{4}}{4!}+\dfrac{\Delta \bm{\theta} ^{6}}{6!}-\ldots \right) \\ &=\bold{I}-\bold{u}^{\wedge }\sin \Delta \bm{\theta} +\bold{u}^{\wedge 2}\left(\bold{I}-\cos \Delta \bm{\theta} \right) \end{aligned} ϕ=Iu(Δθ3!Δθ3+5!Δθ5)+u2(2!Δθ24!Δθ4+6!Δθ6)=IusinΔθ+u2(IcosΔθ)
根据罗德里格斯公式,状态转移矩阵对应
ϕ = R { − u Δ θ } = R { ω t } T \bm{\phi} =\bold{R}\left\{ -\bold{u}\Delta \bm{\theta} \right\} =\bold{R}\left\{ \bm{\omega} t\right\} ^{T} ϕ=R{uΔθ}=R{ωt}T

Integration of random noise and perturbations


我们的目标是在动态系统中给出适当的随机变量积分方法。当然,我们不能积分未知随机值,但我们可以积分它们的方差和协方差,以实现不确定性的传播。这是为了在具有连续性质(在连续时间中指定)但以离散方式估计的系统的估计器中建立协方差矩阵所需要的。
考虑连续时间动态系统,
x ˙ = f ( x , u , w ) \dot{\bold{x}}=f\left( \bold{x},\bold{u},\bold{w}\right) x˙=f(x,u,w)
其中 x \bold{x} x是状态向量, u \bold{u} u是包含噪声 u ~ \tilde{\bold{u}} u~的控制信号向量,因此控制测量值为 u m = u + u ~ \bold{u}_m=\bold{u}+\tilde{\bold{u}} um=u+u~ w \bold{w} w是随机扰动向量。噪声和扰动都假设为白高斯噪声:
u ~ ∼ N { 0 , U c } w ∼ N { 0 , W c } \tilde{\bold{u}} \sim \mathcal{N}\left\{ 0,\bold{U}^{c}\right\} \qquad \bold{w}\sim \mathcal{N}\left\{ 0,\bold{W}^{c}\right\} u~N{0,Uc}wN{0,Wc}
其中上标 ⋅ c \cdot^{c} c表示连续时间。
控制信号的噪声 u ~ \tilde{\bold{u}} u~和随机扰动 w \bold{w} w之间存在本质的区别:

  • 在离散化过程中,控制信号在 n Δ t \bold{n}\Delta t nΔt瞬间采样。在积分区间内,测量部分显然被认为是恒定的,即 u m ( t ) = u m ( n Δ t ) = u ( n Δ t ) + u ~ ( n Δ t ) n Δ t < t < ( n + 1 ) Δ t \bold{u}_m (t)=\bold{u}_m(\bold{n}\Delta t)=\bold{u}(\bold{n}\Delta t)+\tilde{\bold{u}}(\bold{n}\Delta t)\quad \bold{n}\Delta tum(t)=um(nΔt)=u(nΔt)+u~(nΔt)nΔt<t<(n+1)Δt噪声也同样保持不变 u ~ ( t ) = u ~ ( n Δ t ) = u ~ n n Δ t < t < ( n + 1 ) Δ t \tilde{\bold{u}}(t)=\tilde{\bold{u}}(\bold{n}\Delta t)=\tilde{\bold{u}}_n\quad \bold{n}\Delta tu~(t)=u~(nΔt)=u~nnΔt<t<(n+1)Δt
  • 扰动 w \bold{w} w是从未采样过的。

因此,两种随机过程在 Δ t \Delta t Δt间隔内的积分也不同。

误差状态动态方程为
δ x ˙ = A δ x + B u ~ + C w \dot{\delta \bold{x}}=\bold{A}\delta \bold{x}+\bold{B}\tilde{\bold{u}}+\bold{C} \bold{w} δx˙=Aδx+Bu~+Cw
其中
A ≜ ∂ f ∂ δ x ∣ x , u m B ≜ ∂ f ∂ u ~ ∣ x , u m C ≜ ∂ f ∂ w ∣ x , u m \bold{A}\triangleq \dfrac{\partial f}{\partial \delta \bold{x}}{\Big\lvert} _{\bold{x},\bold{u}_{m}}\qquad \bold{B}\triangleq \dfrac{\partial f}{\partial \tilde{\bold{u}}}{\Big\lvert}_{ \bold{x},\bold{u}_{m}}\qquad \bold{C}\triangleq \dfrac{\partial f}{\partial \bold{w}}{\Big\lvert}_{\bold{x},\bold{u}_{m}} Aδxf x,umBu~f x,umCwf x,um
经过采样时间 Δ t \Delta t Δt的积分,有
δ x n + 1 = δ x n + ∫ n Δ t ( n + 1 ) Δ t [ A δ x ( τ ) + B u ~ ( τ ) + C w ( τ ) ] d τ = δ x n + ∫ n Δ t ( n + 1 ) Δ t A δ x ( τ ) d τ + ∫ n Δ t ( n + 1 ) Δ t B u ~ ( τ ) d τ + ∫ n Δ t ( n + 1 ) Δ t C w ( τ ) d τ \begin{aligned} \delta \bold{x}_{n+1}&=\delta \bold{x}_{n}+\int ^{\left( n+1\right) \Delta t}_{n\Delta t}\left[ \bold{A}\delta \bold{x}\left( \tau \right) +\bold{B}\tilde{\bold{u}}\left( \tau \right) +\bold{C}\bold{w}\left( \tau \right) \right] d\tau \\ &=\delta \bold{x}_{\bold{n}}+\int _{n\Delta t}^{\left(n+1\right) \Delta t}\bold{A}\delta \bold{x}\left( \tau \right) d\tau +\int _{n\Delta t}^{\left(n+1\right) \Delta t}\bold{B}\tilde{\bold{u}}\left( \tau \right) d\tau +\int ^{\left(n+1\right) \Delta t}_{n\Delta t}\bold{C}\bold{w}\left( \tau \right) d\tau \end{aligned} δxn+1=δxn+nΔt(n+1)Δt[Aδx(τ)+Bu~(τ)+Cw(τ)]dτ=δxn+nΔt(n+1)ΔtAδx(τ)dτ+nΔt(n+1)ΔtBu~(τ)dτ+nΔt(n+1)ΔtCw(τ)dτ
式中有三项不同本质的积分。

  1. 第一项状态向量部分的积分
    δ x n + ∫ n Δ t ( n + 1 ) Δ t A δ x ( τ ) d τ = Φ ⋅ δ x n \delta \bold{x}_{\bold{n}}+\int ^{\left( \bold{n}+1\right) \Delta t}_{\bold{n}\Delta t}\bold{A}\delta \bold{x}\left( \tau \right) {\rm d}\tau=\bold{\Phi} \cdot \delta \bold{x}_{\bold{n}} δxn+nΔt(n+1)ΔtAδx(τ)dτ=Φδxn
    其中 Φ = e A Δ t \bold{\Phi}=e^{\bold{A}\Delta t} Φ=eAΔt可以求出闭式解
  2. 第二项控制向量的噪声部分的积分
    ∫ n Δ t ( n + 1 ) Δ t B u ~ ( τ ) d τ = B Δ t u ~ n \int _{\bold{n} \Delta t}^{\left( \bold{n}+1\right) \Delta t}\bold{B}\tilde{\bold{u}}\left( \tau \right) d\tau =\bold{B}\Delta t\tilde{\bold{u}}_{\bold{n}} nΔt(n+1)ΔtBu~(τ)dτ=BΔtu~n
    这意味着一旦采样测量噪声以确定的方式积分,因为它在积分区间内的行为是已知的。
  3. 由概率论可知,连续高斯白噪声在周期 Δ t \Delta t Δt上的积分产生一个离散高斯白脉冲 w n w_n wn,描述为
    w n ≜ ∫ n Δ t ( n + 1 ) Δ t w ( τ ) d τ w n ∼ N { 0 , W } with  W = W c Δ t \bold{w}_{\bold{n}}\triangleq\int ^{\left( \bold{n}+1\right) \Delta t}_{\bold{n}\Delta t}\bold{w}\left( \tau \right) d\tau \quad \bold{w}_{\bold{n}}\sim \mathcal{N}\left\{ 0,\bold{W}\right\} \quad\text{with } \bold{W}=\bold{W}^{c}\Delta t wnnΔt(n+1)Δtw(τ)dτwnN{0,W}with W=WcΔt
    我们观察到,与上面的测量噪声相反,扰动在积分区间内没有确定的行为,因此它必须是随机积分的。
    δ x n + 1 = F x δ x n + F n u ~ n + F w w n \delta \bold{x}_{\bold{n}+1}=\bold{F}_{\bold{x}}\delta \bold{x}_{\bold{n}}+\bold{F}_{\bold{n}}\tilde{\bold{u}}_{\bold{n}}+\bold{F}_{\bold{w}}\bold{w}_{\bold{n}} δxn+1=Fxδxn+Fnu~n+Fwwn
    转换矩阵、控制矩阵和扰动矩阵为
    F x = Φ = e A Δ t , F u = B Δ t , F w = C \bold{\bold{F_x}}=\bold{\Phi}=e^{\bold{A}\Delta t}\quad , \quad \bold{F_u}=\bold{B}\Delta t\quad,\quad \bold{F_w}=\bold{C} Fx=Φ=eAΔt,Fu=BΔt,Fw=C
    噪声和扰动的定义为
    u n ∼ N { 0 , U } , w n ∼ N { 0 , W } \bold{u}_n\sim\mathcal{N}\{0,\bold{U}\}\quad,\quad \bold{w}_n\sim\mathcal{N}\{0,\bold{W}\} unN{0,U},wnN{0,W}
    其中 U = U c , W = W c Δ t \bold{U}=\bold{U}^{c}\quad,\quad \bold{W}=\bold{W}^c\Delta t U=Uc,W=WcΔt
    EKF的预测阶段将计算误差状态的均值和协方差矩阵
    δ x ˇ n + 1 = F x δ x ^ n p ˇ n + 1 = F x p ^ n F x T + F u U F u T + F w W F w T = e A Δ t p ^ n ( e A Δ t ) T + Δ t 2 B U c B T + Δ t C W c C T \begin{aligned} \check{\delta \bold{x}}_{\bold{n}+1}&=\bold{\bold{F_x}}\hat{\delta \bold{x}}_n\\ \check{\bold{p}}_{\bold{n}+1}&=\bold{\bold{F_x}} \hat{\bold{p}}_n \bold{\bold{F_x}}^T+ \bold{F_u} \bold{U} \bold{F_u}^T+\bold{F_w} \bold{W} \bold{F_w}^T\\ &=e^{\bold{A}\Delta t}\hat{\bold{p}}_n \left(e^{\bold{A}\Delta t}\right)^T+\Delta t^2 \bold{B} \bold{U}^c \bold{B}^T+\Delta t \bold{CW}^c \bold{C}^T \end{aligned} δxˇn+1pˇn+1=Fxδx^n=Fxp^nFxT+FuUFuT+FwWFwT=eAΔtp^n(eAΔt)T+Δt2BUcBT+ΔtCWcCT
    在这里,观察积分区间 Δ t \Delta t Δt对协方差更新的三个项的不同影响是非常重要的,也是具有说明意义的:动态误差项是指数项,测量误差项是二次项,扰动误差项是线性项。

你可能感兴趣的:(SLAM,人工智能,算法)