误差状态卡尔曼滤波

  1. True-state 真值状态 x x x
  2. Nominal-state 名义状态 x ˉ \bar{x} xˉ
  3. Error-state 误差状态 δ x \delta x δx
    x = x ˉ + δ x x=\bar{x}+\delta x x=xˉ+δx
  • 真值状态被表达成名义状态和误差状态的组合(线性相加、四元数乘法或矩阵乘法)
  • 名义状态不考虑噪声项和其他可能的建模误差

连续时间模型

假设系统模型方程:
x ˙ ( t ) = f ( x ( t ) , v ( t ) , w ( t ) ) \dot{x}\left( t\right) =f\left( x\left( t\right) ,v\left( t\right) ,w\left( t\right) \right) x˙(t)=f(x(t),v(t),w(t))
则按照名义状态的定义,有:
x ˉ ˙ ( t ) = f ( x ˉ ( t ) , v ( t ) , 0 ) \dot{\bar{x}}\left( t\right) =f\left( \bar{x}\left( t\right) ,v\left( t\right) ,0\right) xˉ˙(t)=f(xˉ(t),v(t),0)
x ˙ ( t ) = ( x ˉ ( t ) + δ x ) ˙ = x ˉ ˙ ( t ) + δ x ˙ = f ( x ˉ ( t ) + δ x ( t ) , u ( t ) , w ( t ) ) \begin{aligned} \dot{x}(t)&=\dot{(\bar{x}\left( t\right) +\delta x)}=\dot{\bar{x}}\left( t\right) +\dot{\delta x} \\&=f\left( \bar{x}\left( t\right) +\delta x\left( t\right) ,u\left( t\right) ,w \left( t\right) \right) \end{aligned} x˙(t)=(xˉ(t)+δx)˙=xˉ˙(t)+δx˙=f(xˉ(t)+δx(t),u(t),w(t))

δ x ˙ ( t ) = x ˙ ( t ) − x ˉ ˙ ( t ) = f ( x ˉ ( t ) + δ x ( t ) , u ( t ) , w ( t ) ) − f ( x ˉ ( t ) , u ( t ) , 0 ) = ∂ f ( x ˉ ( t ) , u ( t ) , 0 ) ∂ x δ x ( t ) + 1 2 ! ∂ 2 f ( x ˉ ( t ) , u ( t ) , 0 ) ∂ x 2 δ x ( t ) 2 + ⋯ + ∂ f ( x ˉ ( t ) , u ( t ) , 0 ) ∂ w w ( t ) + 1 2 ! ∂ 2 f ( x ˉ ( t ) , u ( t ) , 0 ) ∂ w 2 w ( t ) 2 + ⋯ = ∂ f ( x ˉ ( t ) , u ( t ) , 0 ) ∂ x δ x ( t ) + O ( δ x ( t ) ) + ∂ f ( x ˉ ( t ) , u ( t ) , 0 ) ∂ w w ( t ) + O ( w ( t ) ) \begin{aligned} \dot{\delta x}(t)&=\dot{x}\left( t\right) - \dot{\bar{x}}\left( t\right) =f\left( \bar{x}\left( t\right) +\delta x\left( t\right) ,u\left( t\right) ,w \left( t\right) \right) - f\left( \bar{x}\left( t\right) ,u\left( t\right) ,0\right) \\ &=\dfrac{\partial f(\bar{x}(t),u(t),0)}{\partial x}\delta x \left( t\right)+\dfrac{1}{2!}\dfrac{\partial^2 f(\bar{x}(t),u(t),0)}{\partial x^2}\delta x \left( t\right)^2+\cdots \\&\quad+\dfrac{\partial f(\bar{x}(t),u(t),0)}{\partial w}w \left( t\right)+\dfrac{1}{2!}\dfrac{\partial^2 f(\bar{x}(t),u(t),0)}{\partial w^2}w \left( t\right)^2+\cdots \\ &=\dfrac{\partial f(\bar{x}(t),u(t),0)}{\partial x}\delta x \left( t\right) +O\left( \delta x\left( t\right) \right) +\dfrac{\partial f(\bar{x}(t),u(t),0)}{\partial w }w\left( t\right) +O\left( w \left( t\right) \right) \end{aligned} δx˙(t)=x˙(t)xˉ˙(t)=f(xˉ(t)+δx(t),u(t),w(t))f(xˉ(t),u(t),0)=xf(xˉ(t),u(t),0)δx(t)+2!1x22f(xˉ(t),u(t),0)δx(t)2++wf(xˉ(t),u(t),0)w(t)+2!1w22f(xˉ(t),u(t),0)w(t)2+=xf(xˉ(t),u(t),0)δx(t)+O(δx(t))+wf(xˉ(t),u(t),0)w(t)+O(w(t))
F ( t ) = ∂ f ( x ˉ ( t ) , u ( t ) , 0 ) ∂ x ,   L ( t ) = ∂ f ( x ˉ ( t ) , u ( t ) , 0 ) ∂ w F(t)=\dfrac{\partial f(\bar{x}(t),u(t),0)}{\partial x},\ L(t)=\dfrac{\partial f(\bar{x}(t),u(t),0)}{\partial w } F(t)=xf(xˉ(t),u(t),0), L(t)=wf(xˉ(t),u(t),0),忽略噪声 w w w的高阶项,则
δ x ˙ ( t ) = F ( t ) δ x ( t ) + L ( t ) w ( t ) + O ( δ x ( t ) ) \dot{\delta x}(t)=F(t)\delta x(t)+L(t)w(t)+O\left( \delta x\left( t\right)\right) δx˙(t)=F(t)δx(t)+L(t)w(t)+O(δx(t))
误差状态方程的离散化:
δ x ( t + Δ t ) = δ x ( t ) + δ x ˙ ( t ) Δ t = δ x ( t ) + F ( t ) δ x ( t ) Δ t + O ( δ x ( t ) ) Δ t + L ( t ) w ( t ) Δ t = ( I + F ( t ) Δ t ) δ x ( t ) + O ( δ x ( t ) ) Δ t + L ( t ) w ( t ) Δ t = Φ ( t ) δ x ( t ) + O ( δ x ( t ) ) Δ t + L ( t ) w ( t ) Δ t \begin{aligned} \delta x\left( t+\Delta t\right) &=\delta x\left( t\right) + \dot{\delta x}\left( t\right) \Delta t\\ &=\delta x\left( t\right) +F\left( t\right) \delta x\left( t\right) \Delta t+O\left( \delta x\left( t\right) \right) \Delta t+L\left( t\right) w\left( t\right) \Delta t\\ &=\left( I+F\left( t\right) \Delta t\right) \delta x\left( t\right) +O\left( \delta x\left( t\right) \right) \Delta t+L\left( t\right) w\left( t\right) \Delta t\\ &=\Phi \left( t\right) \delta x\left( t\right) +O\left( \delta x\left( t\right) \right) \Delta t+L\left( t\right) w\left( t\right) \Delta t \end{aligned} δx(t+Δt)=δx(t)+δx˙(t)Δt=δx(t)+F(t)δx(t)Δt+O(δx(t))Δt+L(t)w(t)Δt=(I+F(t)Δt)δx(t)+O(δx(t))Δt+L(t)w(t)Δt=Φ(t)δx(t)+O(δx(t))Δt+L(t)w(t)Δt
在ESKF中, Φ ( t ) \Phi(t) Φ(t)被称作State Transition Matrix。ESKF的Predict步骤作近似 δ x ( t + Δ t ) ≃ Φ ( t ) δ x ( t ) \delta x\left( t+\Delta t\right)\simeq \Phi(t)\delta x\left( t\right) δx(t+Δt)Φ(t)δx(t) ,剩下的由于非线性导致的误差项 O ( δ x ( t ) ) Δ t + L ( t ) w ( t ) Δ t O\left( \delta x\left( t\right) \right) \Delta t+L\left( t\right) w\left( t\right) \Delta t O(δx(t))Δt+L(t)w(t)Δt在Update步骤使用观测方程进行估计。
F ( t ) F(t) F(t) 的定义中可以看到,其与 error δ x ( t ) \delta x(t) δx(t) 是无关的,使用上一步的估计值 x ^ ( t ) \hat{x}(t) x^(t) 与这一步的控制值 u ( t ) u(t) u(t) 即可计算得到。于是,在 Predict 步骤无需设计 error 部分 δ x ( t ) \delta x(t) δx(t) ,对 Φ ( t ) \Phi(t) Φ(t) 进行近似。
误差状态卡尔曼滤波_第1张图片

离散时间模型

真实状态的运动模型方程
x k = f ( x k − 1 , u k , w k ) (1) x_{k}=f\left( x_{k-1},u_{k},w_{k}\right) \tag{1} xk=f(xk1,uk,wk)(1)
由名义状态的定义,不考虑噪声项,得到名义状态的运动模型方程
x ˉ k = f ( x ˉ k − 1 , u k , 0 ) (2) \bar{x}_{k}=f\left( \bar{x}_{k-1},u_{k},0\right) \tag{2} xˉk=f(xˉk1,uk,0)(2)

由定义: x k = x ˉ k + δ x k x_{k}=\bar{x}_{k}+\delta x_{k} xk=xˉk+δxk,得
δ x k = f ( x k − 1 , u k , w k ) − f ( x ˉ k − 1 , u k , 0 ) = f ( x ˉ k − 1 + δ x k − 1 , u k , w k ) − f ( x ˉ k − 1 , u k , 0 ) = ∂ f ( x ˉ k − 1 , u k , 0 ) ∂ x δ x k − 1 + 1 2 ! ∂ 2 f ( x ˉ k − 1 , u k , 0 ) ∂ x 2 δ x k − 1 2 + ⋯ + ∂ f ( x ˉ k − 1 , u k , 0 ) ∂ w w k + 1 2 ! ∂ 2 f ( x ˉ k − 1 , u k , 0 ) ∂ w 2 w k 2 + ⋯ = ∂ f ( x ˉ k − 1 , u k , 0 ) ∂ x δ x k − 1 + O ( δ x k − 1 ) + ∂ f ( x ˉ k − 1 , u k , 0 ) ∂ w w k + O ( w k ) \begin{aligned} \delta x_{k}&=f\left( x_{k-1},u_{k},w_{k}\right) -f\left( \bar{x}_{k-1},u_{k},0\right) \\ &=f\left( \bar{x}_{k-1}+\delta x_{k-1},u_{k},w_{k}\right) -f\left( \bar{x}_{k-1},u_{k},0\right) \\ &=\dfrac{\partial f(\bar{x}_{k-1},u_k,0)}{\partial x}\delta x_{k-1} +\dfrac{1}{2!}\dfrac{\partial^2 f(\bar{x}_{k-1},u_{k},0)}{\partial x^2}\delta x_{k-1}^2+\cdots \\&\quad+\dfrac{\partial f(\bar{x}_{k-1},u_{k},0)}{\partial w}w_{k}+\dfrac{1}{2!}\dfrac{\partial^2 f(\bar{x}_{k-1},u_k,0)}{\partial w^2}w_k^2+\cdots \\ &=\dfrac{\partial f(\bar{x}_{k-1},u_k,0)}{\partial x}\delta x_{k-1} +O\left( \delta x_{k-1} \right) +\dfrac{\partial f(\bar{x}_{k-1},u_k,0)}{\partial w }w_k +O\left( w_k \right) \end{aligned} δxk=f(xk1,uk,wk)f(xˉk1,uk,0)=f(xˉk1+δxk1,uk,wk)f(xˉk1,uk,0)=xf(xˉk1,uk,0)δxk1+2!1x22f(xˉk1,uk,0)δxk12++wf(xˉk1,uk,0)wk+2!1w22f(xˉk1,uk,0)wk2+=xf(xˉk1,uk,0)δxk1+O(δxk1)+wf(xˉk1,uk,0)wk+O(wk)
F k − 1 = ∂ f ( x ˉ k − 1 , u k , 0 ) ∂ x ,   L k = ∂ f ( x ˉ k − 1 , u k , 0 ) ∂ w F_{k-1}=\dfrac{\partial f(\bar{x}_{k-1},u_k,0)}{\partial x},\ L_k=\dfrac{\partial f(\bar{x}_{k-1},u_k,0)}{\partial w } Fk1=xf(xˉk1,uk,0), Lk=wf(xˉk1,uk,0),忽略非线性小量部分: δ x k , w \delta x_k,w δxk,w的高阶项,则
δ x k = F k − 1 δ x k − 1 + L k w k (3) \delta x_k=F_{k-1}\delta x_{k-1}+L_kw_k\tag{3} δxk=Fk1δxk1+Lkwk(3)
观测方程:
y k = h ( x k , n n ) = h ( x ‾ k + δ x k , n k ) = h ( x ˉ k + δ x k , n k ) − h ( x ˉ k , 0 ) + h ( x ‾ k , 0 ) ≈ h ( x ˉ k , 0 ) + ∂ h ( x ˉ k , 0 ) ∂ x δ x k + ∂ h ( x ˉ k , 0 ) ∂ n n k + O ( δ x k ) + O ( n k ) \begin{aligned} y_{k}&=h\left( x_{k},n_{n}\right) =h\left( \overline{x}_{k}+\delta x_{k},n_{k}\right) \\ &=h\left( \bar{x}_{k}+\delta x_{k},n_{k}\right) -h\left( \bar{x}_{k},0\right) +h\left( \overline{x}_{k},0\right) \\ &\approx h\left( \bar{x}_{k},0\right) + \dfrac{\partial h\left( \bar{x}_{k},0\right)}{\partial x}\delta x_{k}+\dfrac{\partial h\left( \bar{x}_{k},0\right)}{\partial n}n_{k}+O(\delta x_k) +O(n_k) \end{aligned} yk=h(xk,nn)=h(xk+δxk,nk)=h(xˉk+δxk,nk)h(xˉk,0)+h(xk,0)h(xˉk,0)+xh(xˉk,0)δxk+nh(xˉk,0)nk+O(δxk)+O(nk)
H k − 1 = ∂ h ( x ˉ k , 0 ) ∂ x ,   L k = ∂ h ( x ˉ k , 0 ) ∂ n H_{k-1}=\dfrac{\partial h(\bar{x}_{k},0)}{\partial x},\ L_k=\dfrac{\partial h(\bar{x}_{k},0)}{\partial n } Hk1=xh(xˉk,0), Lk=nh(xˉk,0),忽略非线性小量部分: δ x k , n k \delta x_k,n_k δxk,nk的高阶项,则
y k = h ( x ˉ k , 0 ) + H k δ x k + M k n k (4) y_k=h(\bar{x}_k,0)+H_k\delta x_k + M_k n_k\tag{4} yk=h(xˉk,0)+Hkδxk+Mknk(4)

ES-EKF过程

ES-EKF直接估计Error State,然后用它矫正Nominal State。在整个滤波过程中,我们实际上修正的变量是 δ x \delta x δx

  1. 使用运动模型更新Nominal state
    x ˉ k = f ( x k − 1 , u k , 0 ) \bar{x}_{k}=f\left( x_{k-1},u_{k},0\right) xˉk=f(xk1,uk,0)
    式中的 x k − 1 x_{k-1} xk1是当前能获得的k-1时刻最优状态估计值。可能是前一次Prediction产生的State值(连续多次使用Motion Model),也可能是Measurement Update后State值。
  2. 前向传播
    我们认为前一时刻的误差状态为零均值的高斯变量
    δ x k − 1 ∼ N ( 0 , P ^ k − 1 ) \delta x_{k-1}\sim \mathcal{N}\left( 0,\hat{P}_{k-1}\right) δxk1N(0,P^k1)
    由误差状态模型方程
    δ x k = F k − 1 δ x k − 1 + L k w k \delta x_{k}=F_{k-1}\delta x_{k-1}+L_{k}w_{k}\\ δxk=Fk1δxk1+Lkwk
    概率密度向前传播得
    δ x ˇ k = 0 P ˇ k = F k − 1 P ^ k − 1 F k − 1 T + L k Q k L k T \delta \check{x}_{k}=0 \\ \check{P}_{k}=F_{k-1}\hat{P}_{k-1}F_{k-1}^{T}+L_{k}Q_{k}L_{k}^{T} δxˇk=0Pˇk=Fk1P^k1Fk1T+LkQkLkT
  3. 使用测量更新后验估计
    • 计算卡尔曼增益
      K k = P ˇ k H k T ( H k P ˇ k H k T + M k R k M k T ) − 1 K_k = \check{P}_kH_k^T\left( H_k\check{P}_k H_k^T+M_kR_kM_k^T \right)^{-1} Kk=PˇkHkT(HkPˇkHkT+MkRkMkT)1
    • 计算误差状态后验估计
      δ x ^ = δ x ˇ + K k ( y k − h ( x ˉ k , 0 ) ) P ^ k = ( 1 − K k H k ) P ˇ k \begin{aligned} \delta \hat{x}&=\delta\check{x}+K_k\left(y_k - h(\bar{x}_k,0)\right) \\ \hat{P}_k&=(1-K_k H_k)\check{P}_k \end{aligned} δx^P^k=δxˇ+Kk(ykh(xˉk,0))=(1KkHk)Pˇk
  4. 校正名义状态
    x ^ k = x ˉ k + δ x ^ k \hat{x}_k=\bar{x}_k+\delta\hat{x}_k x^k=xˉk+δx^k

ESKF的优势0

若状态量里面有旋转,则旋转通常被表示为欧拉角或四元数的形式。

在EKF框架中,若一个旋转状态量:

  1. 表示为欧拉角,三个参数三个自由度,则在优化的过程中有可能出现万向节死锁的情况。
  2. 表示为四元数,四个参数三个自由度,需要满足模为1的约束,优化的时候可能 会出现协方差奇异(?)的情况。

但这些问题在ESKF中被弥补。在ESKF中,一个误差旋转变量:

  1. 表示为欧拉角,在优化的过程中三个角度都在0附近,不用担心万向节死锁的情况出现。
  2. 表示为四元数,当一个旋转很小的时候,四元数的w=1,同样只要优化三个参数。
    δ q ≃ [ 1 2 δ θ T 1 ] T \delta q\simeq\begin{bmatrix}\dfrac{1}{2}\delta \theta^T&1\end{bmatrix}^T δq[21δθT1]T

参考链接1
参考链接2

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