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(a−g)+ba+naωm=ω+bw+nω{a=R(am−ba−na)+gω=ωm−bω−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(am−ba−na)+g=21q⊗(ωm−bω−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=[am−naωm−nω]w=[nbanbω]
系统的名义态运动学方程对应于无噪声和扰动的系统模型。
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ˉ(am−bˉa)+gˉ=21qˉ⊗(ωm−bˉω)=0=0=0(nominal state)
由 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=x−xˉ,其中+,-
代指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}} ωˉ≜ωm−bˉω和小信号量项 δ ω = − δ 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ˉ⊗(ωm−bˉω)⊗δq+qˉ⊗δq˙⟹2δq˙=21q⊗(ωm−bω−nω)=21qˉ⊗δq⊗(ωm−bω−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} δθ˙=δω−ω∧δθ=−(ωm−bω)∧δθ−δ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(am−ba−na)+g]−[Rˉ(am−bˉa)+gˉ]=[R(am−bˉa−δba−na)+g]−[Rˉ(am−bˉa)+gˉ]=(R−Rˉ)(am−bˉa)−R(δba+na)+δg=Rˉ[Exp(δθ)−I](am−bˉa)−RˉExp(δθ)(δba+na)+δg=Rˉδθ∧(am−bˉ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} a∧b=−b∧a可得
δ 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ˉ[−(am−bˉa)∧δθ−δba−na]+δ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 na←Rna
其余误差状态量的微分方程可以很容易的得到,于是
δ 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ˉ[−(am−bˉa)∧δθ−δba]+δg−na=−(ωm−bω)∧δθ−δbω−nω=nba=nbω=0(error state)
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ωg←p+vΔt+21(R(am−ba)+g)Δt2←v+(R(am−ba)+g)Δt←q⊗q{(ωm−bω)Δt}←ba←bω←g
δ 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ˉ(am−ba)∧δθ−Rˉδba+δg)Δt+vi←RT{(ωm−bω)Δ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}} na、nω、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的数据手册或标定得到。
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} δx←f(x,δx,um,i)=Fx(x,um)⋅δx+Fi⋅i
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^p←Fx(x,um)⋅δx^←FxPFxT+FiQiFiT
其中 δ x ∼ N { δ x ^ , p } \delta \bold{x}\sim \mathcal{N}\{\hat{\delta \bold{x}},\bold{p}\} δx∼N{δ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=∂δx∂f x,um= I00000IΔtI00000−R(am−ba)∧ΔtRT{(ωm−bω)Δt}0000−RΔt0I0000−IΔt0I00IΔt000I Fi=∂i∂f x,um= 0I000000I000000I000000I0 Qi= Vi0000Θi0000Ai0000Ωi
到目前为止,IMU的信息用于对ESKF进行预测,其他信息可以用于滤波器的校正,校正包含三步:
通常我们有一个传感器,他的测量取决于状态:
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}\} n∼N{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)−1←K(y−h(x^))←(I−KH)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≡∂δx∂h xˉ≡∂n∂h xˉ
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≜∂δx∂h xˉ=∂x∂h xˉ∂δx∂x xˉ=HxXδx
其中 H x ≜ ∂ h ∂ x ∣ x ˉ \bold{H_x}\triangleq \dfrac{\partial h}{\partial \bold{x}}{\Big\lvert}_{\bar{\bold{x}}} Hx≜∂x∂h 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 −qxqwqz−qy−qy−qzqwqx−qzqy−qxqw
在ESKF更新之后,就需要用校正后的误差状态去校正名义状态
x ← x ⊞ δ x ^ \bold{x}\leftarrow \bold{x}\boxplus \hat{\delta \bold{x}} x←x⊞δ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ωg←p+δp^←v+δv^←q⊗q{δθ^}←ba+δba^←bω+δbω^←g+δg^
在误差状态加入名义状态后,误差状态均值 δ 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}} δx←g(δ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^p←0←GPGT
其中 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≜∂δx∂g δx^= I6000I−(21δθ^)∧000I9
下面给出方向误差块的导数推导
基于以下事实:
考虑无偏差和噪声的角误差动力学
δ θ = − ω ∧ δ θ \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Δt2−3!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} ϕ=I−u∧(Δθ−3!Δθ3+5!Δθ5−…)+u∧2(2!Δθ2−4!Δθ4+6!Δθ6−…)=I−u∧sinΔθ+u∧2(I−cosΔθ)
根据罗德里格斯公式,状态转移矩阵对应
ϕ = 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
我们的目标是在动态系统中给出适当的随机变量积分方法。当然,我们不能积分未知随机值,但我们可以积分它们的方差和协方差,以实现不确定性的传播。这是为了在具有连续性质(在连续时间中指定)但以离散方式估计的系统的估计器中建立协方差矩阵所需要的。
考虑连续时间动态系统,
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}w∼N{0,Wc}
其中上标 ⋅ c \cdot^{c} ⋅c表示连续时间。
控制信号的噪声 u ~ \tilde{\bold{u}} u~和随机扰动 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≜∂δx∂f x,umB≜∂u~∂f x,umC≜∂w∂f 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τ
式中有三项不同本质的积分。