EKF SLAM
PPT 教程地址:http://ais.informatik.uni-freiburg.de/teaching/
- 在估计理论中,扩展卡尔曼滤波器 (EKF) 是卡尔曼滤波器的非线性版本,它对当前均值和协方差的估计进行线性化。 在定义明确的过渡模型的情况下,EKF 已被视为非线性状态估计、导航系统和 GPS 理论中的事实标准。
- 缺点:与其线性对应物不同,扩展卡尔曼滤波器通常不是最优估计器(如果测量和状态转换模型都是线性的,则它是最优的,因为在这种情况下扩展卡尔曼滤波器与常规卡尔曼滤波器相同)。 此外,如果状态的初始估计是错误的,或者如果过程建模不正确,则滤波器可能会由于其线性化而迅速发散。 扩展卡尔曼滤波器的另一个问题是估计的协方差矩阵倾向于低估真实的协方差矩阵,因此在不添加“稳定噪声”的情况下可能会在统计意义上变得不一致[8]。
- 迭代扩展卡尔曼滤波器:通过递归修改泰勒展开的中心点来改进扩展卡尔曼滤波器的线性化。 这以增加计算要求为代价减少了线性化误差。 [13]
- 鲁棒扩展卡尔曼滤波器:
- 扩展卡尔曼滤波器是通过对当前状态估计的信号模型进行线性化并使用线性卡尔曼滤波器来预测下一个估计而产生的。 这试图产生一个局部最优的滤波器,然而,它不一定是稳定的,因为基础里卡蒂方程的解不能保证是正定的。 提高性能的一种方法是仿代数 Riccati 技术 [14],它以最优性换取稳定性。 扩展卡尔曼滤波器的熟悉结构被保留,但通过为增益设计选择伪代数 Riccati 方程的正定解来实现稳定性。
- 提高扩展卡尔曼滤波器性能的另一种方法是使用鲁棒控制的 H 无穷大结果。 通过在设计 Riccati 方程中添加一个正定项来获得稳健的滤波器。 [15] 附加项由标量参数化,设计人员可以调整该标量以在均方误差和峰值误差性能标准之间取得平衡。
- 不变扩展卡尔曼滤波器:不变扩展卡尔曼滤波器 (IEKF) 是 EKF 的修改版本,适用于具有对称性(或不变性)的非线性系统。 它结合了 EKF 和最近引入的保持对称滤波器的优点。 IEKF 不使用基于线性输出误差的线性校正项,而是使用基于不变输出误差的几何自适应校正项; 同样,增益矩阵不是从线性状态误差更新,而是从不变状态误差更新。 主要好处是增益和协方差方程在比平衡点大得多的轨迹集上收敛到常数值,因为 EKF 就是这种情况,这导致估计的更好收敛。
EKF
-
EKF 线性化:一阶泰勒展开
-
预测: g ( u t , x t − 1 ) ≈ g ( u t , μ t − 1 ) + ∂ g ( u t , μ t − 1 ) ∂ x t − 1 ( x t − 1 − μ t − 1 ) {g(u_t,x_{t-1})\approx g(u_t,\mu_{t-1}) + \frac{\partial g(u_t,\mu_{t-1})}{\partial x_{t-1}}(x_{t-1}-\mu_{t-1})} g(ut,xt−1)≈g(ut,μt−1)+∂xt−1∂g(ut,μt−1)(xt−1−μt−1)
-
修正: h ( x t ) ≈ h ( μ t ˉ ) + ∂ h ( μ t ˉ ) ∂ x t ( x t − μ t ˉ ) {h(x_t)\approx h(\bar{\mu_t})+\frac{\partial h(\bar{\mu_t})}{\partial x_t}(x_t-\bar{\mu_t})} h(xt)≈h(μtˉ)+∂xt∂h(μtˉ)(xt−μtˉ)
-
两偏导用 G t G_t Gt 和 H t {H_t} Ht 表示,
Jacobian matrices
-
-
Jacobian Matrix
-
他是一个非线性矩阵: m × n {m\times n} m×n
-
给一个向量值函数: g ( x ) = ( g 1 ( x ) g 2 ( x ) ⋮ g m ( x ) ) {g(x)= \begin{pmatrix} g_1(x)\\g_2(x)\\ \vdots \\ g_m(x) \end{pmatrix}} g(x)=⎝⎜⎜⎜⎛g1(x)g2(x)⋮gm(x)⎠⎟⎟⎟⎞
-
则雅克比矩阵被定义为:
G x = ( ∂ g 1 ∂ x 1 ∂ g 1 ∂ x 2 ⋯ ∂ g 1 ∂ x n ∂ g 2 ∂ x 1 ∂ g 2 ∂ x 2 ⋯ ∂ g 2 ∂ x n ⋮ ⋮ ⋮ ⋮ ∂ g m ∂ x 1 ∂ g m ∂ x 2 ⋯ ∂ g m ∂ x n ) {G_x=\begin{pmatrix} \frac{\partial g_1}{\partial x_1} &\frac{\partial g_1}{\partial x_2}& \cdots& \frac{\partial g_1}{\partial x_n} \\ \frac{\partial g_2}{\partial x_1} &\frac{\partial g_2}{\partial x_2}& \cdots& \frac{\partial g_2}{\partial x_n} \\ \vdots & \vdots & \vdots & \vdots \\ \frac{\partial g_m}{\partial x_1} &\frac{\partial g_m}{\partial x_2}& \cdots& \frac{\partial g_m}{\partial x_n} \end{pmatrix}} Gx=⎝⎜⎜⎜⎜⎛∂x1∂g1∂x1∂g2⋮∂x1∂gm∂x2∂g1∂x2∂g2⋮∂x2∂gm⋯⋯⋮⋯∂xn∂g1∂xn∂g2⋮∂xn∂gm⎠⎟⎟⎟⎟⎞
-
它是给定点处向量值函数的切平面的方向
-
一个标量值函数的梯度
-
Extended Kalman filter Algorithm
- Extended_kalman_filter ( μ t − 1 {\mu_{t-1}} μt−1 , Σ t − 1 {\Sigma_{t-1}} Σt−1, u t {u_t} ut, z t {z_t} zt )
- predict:
- μ t ˉ = g ( u t , μ t − 1 ) {\bar{\mu_t}=g(u_t,\mu_{t-1})} μtˉ=g(ut,μt−1)
- Σ t ˉ = G t Σ t − 1 G t T + R T {\bar{\Sigma_t}=G_t\Sigma_{t-1}G_t^T+R^T} Σtˉ=GtΣt−1GtT+RT
- update:
- K t = Σ t ˉ H t T ( H t Σ t ˉ H t T + Q t ) − 1 {K_t = \bar{\Sigma_t}H_t^T(H_t\bar{\Sigma_t}H_t^T+Q_t)^{-1}} Kt=ΣtˉHtT(HtΣtˉHtT+Qt)−1
- μ t = μ t ˉ + K t ( z t − h ( μ t ˉ ) ) {\mu_t = \bar{\mu_t}+K_t(z_t-h(\bar{\mu_t}))} μt=μtˉ+Kt(zt−h(μtˉ))
- Σ t = ( I − K t H t ) Σ t ˉ {\Sigma_t=(I-K_tH_t)\bar{\Sigma_t}} Σt=(I−KtHt)Σtˉ
- return μ t {\mu_t} μt, Σ t {\Sigma_t} Σt
EKF to SLAM
-
对于2D空间,状态
-
x
t
=
(
x
,
y
,
θ
,
m
1
,
x
,
m
1
,
y
,
⋯
,
m
n
,
x
,
m
n
,
y
)
T
{x_t = (x,y,\theta,m_{1,x},m_{1,y},\cdots,m_{n,x},m_{n,y})^T}
xt=(x,y,θ,m1,x,m1,y,⋯,mn,x,mn,y)T
- 机器人位姿,landmark 1,…,landmark n
-
x
t
=
(
x
,
y
,
θ
,
m
1
,
x
,
m
1
,
y
,
⋯
,
m
n
,
x
,
m
n
,
y
)
T
{x_t = (x,y,\theta,m_{1,x},m_{1,y},\cdots,m_{n,x},m_{n,y})^T}
xt=(x,y,θ,m1,x,m1,y,⋯,mn,x,mn,y)T
-
地图有N个landmark时,有 3 + 2 n {3+2n} 3+2n维高斯分布,其置信度为:
- μ = ( x y θ m 1 , x m 1 , y ⋯ m n , x m n , y ) T {\mu =\begin{pmatrix} x&y&\theta&m_{1,x}&m_{1,y}& \cdots& m_{n,x}&m_{n,y}\end{pmatrix}^T} μ=(xyθm1,xm1,y⋯mn,xmn,y)T
- Σ = ( σ x x σ x y σ x θ σ x m 1 , x σ x m 1 , y ⋯ σ x m n , x σ x m n , y σ y x σ y y σ y θ σ y m 1 , x σ y m 1 , y ⋯ σ y m n , x σ y m n , y σ θ x σ θ y σ θ θ σ θ m 1 , x σ y m 1 , y ⋯ σ θ m n , x σ θ m n , y σ m 1 , x x σ m 1 , x y σ m 1 , x θ σ m 1 , x m 1 , x σ m 1 , x m 1 , y ⋯ σ m 1 , x m n , x σ m 1 , x m n , y σ m 1 , y x σ m 1 , y y σ m 1 , y θ σ m 1 , y m 1 , x σ m 1 , y m 1 , y ⋯ σ m 1 , y m n , x σ m 1 , y m n , y ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ σ m n , x x σ m n , x y σ m n , x θ σ m n , x m 1 , x σ m n , x m 1 , y ⋯ σ m n , x m n , x σ m n , x m n , y σ m n , y x σ m n , y y σ m n , y θ σ m n , y m 1 , x σ m n , y m 1 , y ⋯ σ m n , y m n , x σ m n , y m n , y ) {\Sigma =\begin{pmatrix} \sigma_{xx} & \sigma_{xy} & \sigma_{x\theta} & \sigma_{xm_{1,x}} & \sigma_{xm_{1,y}} & \cdots & \sigma_{xm_{n,x}} & \sigma_{xm_{n,y}} \\ \sigma_{yx} & \sigma_{yy} & \sigma_{y\theta} & \sigma_{ym_{1,x}} & \sigma_{ym_{1,y}} & \cdots & \sigma_{ym_{n,x}} & \sigma_{ym_{n,y}} \\ \sigma_{\theta x} & \sigma_{\theta y} & \sigma_{\theta \theta} & \sigma_{\theta m_{1,x}} & \sigma_{ym_{1,y}} & \cdots & \sigma_{\theta m_{n,x}} & \sigma_{\theta m_{n,y}} \\ \sigma_{m_{1,x}x} & \sigma_{m_{1,x}y} & \sigma_{m_{1,x}\theta } & \sigma_{m_{1,x}m_{1,x}} & \sigma_{m_{1,x}m_{1,y}} & \cdots & \sigma_{m_{1,x} m_{n,x}} & \sigma_{m_{1,x} m_{n,y}} \\ \sigma_{m_{1,y}x} & \sigma_{m_{1,y}y} & \sigma_{m_{1,y}\theta } & \sigma_{m_{1,y}m_{1,x}} & \sigma_{m_{1,y}m_{1,y}} & \cdots & \sigma_{m_{1,y} m_{n,x}} & \sigma_{m_{1,y} m_{n,y}} \\ \vdots &\vdots &\vdots & \vdots & \vdots &\vdots & \vdots & \vdots \\ \sigma_{m_{n,x}x} & \sigma_{m_{n,x}y} & \sigma_{m_{n,x}\theta } & \sigma_{m_{n,x}m_{1,x}} & \sigma_{m_{n,x}m_{1,y}} & \cdots & \sigma_{m_{n,x} m_{n,x}} & \sigma_{m_{n,x} m_{n,y}} \\ \sigma_{m_{n,y}x} & \sigma_{m_{n,y}y} & \sigma_{m_{n,y}\theta } & \sigma_{m_{n,y}m_{1,x}} & \sigma_{m_{n,y}m_{1,y}} & \cdots & \sigma_{m_{n,y} m_{n,x}} & \sigma_{m_{n,y} m_{n,y}} \end{pmatrix}} Σ=⎝⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎜⎛σxxσyxσθxσm1,xxσm1,yx⋮σmn,xxσmn,yxσxyσyyσθyσm1,xyσm1,yy⋮σmn,xyσmn,yyσxθσyθσθθσm1,xθσm1,yθ⋮σmn,xθσmn,yθσxm1,xσym1,xσθm1,xσm1,xm1,xσm1,ym1,x⋮σmn,xm1,xσmn,ym1,xσxm1,yσym1,yσym1,yσm1,xm1,yσm1,ym1,y⋮σmn,xm1,yσmn,ym1,y⋯⋯⋯⋯⋯⋮⋯⋯σxmn,xσymn,xσθmn,xσm1,xmn,xσm1,ymn,x⋮σmn,xmn,xσmn,ymn,xσxmn,yσymn,yσθmn,yσm1,xmn,yσm1,ymn,y⋮σmn,xmn,yσmn,ymn,y⎠⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎟⎞
- 简写:
- μ = ( x , m ) T {\mu=(x,m)^T} μ=(x,m)T
- ( Σ x x Σ x m Σ m x Σ m m ) {\begin{pmatrix} \Sigma_{xx} & \Sigma_{xm} \\ \Sigma_{mx} & \Sigma_{mm} \end{pmatrix}} (ΣxxΣmxΣxmΣmm)
-
状态预测 – 红色部分
- μ = ( x , m ) T {\mu=({\color{red}x},m)^T} μ=(x,m)T
- Σ = ( Σ x x Σ x m Σ m x Σ m m ) {\Sigma = \begin{pmatrix} {\color{red}\Sigma_{xx}}& {\color{red}\Sigma_{xm}} \\ {\color{red}\Sigma_{mx} }& \Sigma_{mm} \end{pmatrix}} Σ=(ΣxxΣmxΣxmΣmm)
-
初始化:
-
μ = ( 0 0 0 ⋯ 0 ) T {\mu= \begin{pmatrix}0 &0& 0& \cdots & 0\end{pmatrix}^T} μ=(000⋯0)T
-
Σ = ( 0 0 0 ∞ ) {\Sigma = \begin{pmatrix} 0& 0 \\ 0 & \infty \end{pmatrix}} Σ=(000∞)
-
-
预测:
-
μ t ˉ {\bar{\mu_t}} μtˉ预测:
-
目标:根据机器人的运动更新状态空间
-
已知线速度和角速度,时间:
- ( x ′ y ′ θ ′ ) = ( x y θ ) + ( − v t w t s i n ( θ ) + v t w t s i n ( θ + w t Δ t ) v t w t c o s ( θ ) − v t w t c o s ( θ + w t Δ t ) w t Δ t ) {\begin{pmatrix} x'\\ y'\\ \theta'\end{pmatrix}= \begin{pmatrix} x \\ y \\ \theta \end{pmatrix}+ \begin{pmatrix} -\frac{v_t}{w_t}sin(\theta)+\frac{v_t}{w_t}sin(\theta+w_t\Delta _t) \\ \frac{v_t}{w_t}cos(\theta) -\frac{v_t}{w_t}cos(\theta+w_t\Delta _t) \\ w_t \Delta _t \end{pmatrix}} ⎝⎛x′y′θ′⎠⎞=⎝⎛xyθ⎠⎞+⎝⎛−wtvtsin(θ)+wtvtsin(θ+wtΔt)wtvtcos(θ)−wtvtcos(θ+wtΔt)wtΔt⎠⎞
-
到 2 N + 3 {2N+3} 2N+3 空间:
-
( x ′ y ′ θ ′ ⋮ ) = ( x y θ ⋮ ) + ( 1 0 0 0...0 0 1 0 0...0 0 0 1 0...0 ⏟ 2 N c o l s ) T ⏟ F x T ( − v t w t s i n ( θ ) + v t w t s i n ( θ + w t Δ t ) v t w t c o s ( θ ) − v t w t c o s ( θ + w t Δ t ) w t Δ t ) {\begin{pmatrix} x'\\ y'\\ \theta' \\ \vdots \end{pmatrix}= \begin{pmatrix} x \\ y \\ \theta \\ \vdots \end{pmatrix} + \underset{F_x^T}{\underbrace{\begin{pmatrix} 1&0&0 & 0...0 \\ 0&1&0 & 0...0 \\ 0&0&1 & \underset{2N cols}{\underbrace{0...0}}\end{pmatrix}^T}}\begin{pmatrix} -\frac{v_t}{w_t}sin(\theta)+\frac{v_t}{w_t}sin(\theta+w_t\Delta _t) \\ \frac{v_t}{w_t}cos(\theta) -\frac{v_t}{w_t}cos(\theta+w_t\Delta _t) \\ w_t \Delta _t \end{pmatrix}} ⎝⎜⎜⎜⎛x′y′θ′⋮⎠⎟⎟⎟⎞=⎝⎜⎜⎜⎛xyθ⋮⎠⎟⎟⎟⎞+FxT ⎝⎜⎛1000100010...00...02Ncols 0...0⎠⎟⎞T⎝⎛−wtvtsin(θ)+wtvtsin(θ+wtΔt)wtvtcos(θ)−wtvtcos(θ+wtΔt)wtΔt⎠⎞
-
-
{} Σ t ˉ {\bar{\Sigma_t}} Σtˉ预测:
- 该功能
g
仅影响机器人运动,不影响landmark
-
G
t
=
(
G
t
x
0
0
I
)
{G_t = \begin{pmatrix} G_t^x &0\\0 &I \end{pmatrix}}
Gt=(Gtx00I)
- G t x {G_t^x} Gtx: Jacobian of the motion 3 × 3 {3\times 3} 3×3
- I I I:Identity 2 N × 2 N {2N\times 2N} 2N×2N
- G t x = ∂ ∂ ( x , y , θ ) T [ ( x ′ y ′ θ ′ ) = ( x y θ ) + ( − v t w t s i n ( θ ) + v t w t s i n ( θ + w t Δ t ) v t w t c o s ( θ ) − v t w t c o s ( θ + w t Δ t ) w t Δ t ) ] {G_t^x=\frac{\partial}{\partial{(x,y,\theta)^T}}\begin{bmatrix} \begin{pmatrix} x'\\ y'\\ \theta'\end{pmatrix}= \begin{pmatrix} x \\ y \\ \theta \end{pmatrix}+ \begin{pmatrix} -\frac{v_t}{w_t}sin(\theta)+\frac{v_t}{w_t}sin(\theta+w_t\Delta _t) \\ \frac{v_t}{w_t}cos(\theta) -\frac{v_t}{w_t}cos(\theta+w_t\Delta _t) \\ w_t \Delta _t \end{pmatrix} \end{bmatrix}} Gtx=∂(x,y,θ)T∂⎣⎡⎝⎛x′y′θ′⎠⎞=⎝⎛xyθ⎠⎞+⎝⎛−wtvtsin(θ)+wtvtsin(θ+wtΔt)wtvtcos(θ)−wtvtcos(θ+wtΔt)wtΔt⎠⎞⎦⎤
- G t x = ( 1 0 v t w t c o s ( θ ) + v t w t c o s ( θ + w t Δ t ) 0 1 − v t w t s i n ( θ ) + v t w t s i n ( θ + w t Δ t ) 0 0 1 ) {G_t^x= \begin{pmatrix} 1& 0& \frac{v_t}{w_t}cos(\theta)+\frac{v_t}{w_t}cos(\theta+w_t\Delta _t) \\0&1& -\frac{v_t}{w_t}sin(\theta)+\frac{v_t}{w_t}sin(\theta+w_t\Delta _t) \\ 0& 0& 1\end{pmatrix}} Gtx=⎝⎛100010wtvtcos(θ)+wtvtcos(θ+wtΔt)−wtvtsin(θ)+wtvtsin(θ+wtΔt)1⎠⎞
- Σ t ˉ = G t Σ t − 1 G t T + R T = ( G t x 0 0 I ) ( Σ x x Σ x m Σ m x Σ m m ) ( G t x T 0 0 I ) + R t = ( G t x Σ x x G t x T G t x Σ x m G t x Σ m x T Σ m m ) + R t {\bar{\Sigma_t}=G_t\Sigma_{t-1}G_t^T+R^T= \begin{pmatrix} G_t^x & 0 \\ 0 & I\end{pmatrix} \begin{pmatrix} \Sigma_{xx} & \Sigma_{xm} \\ \Sigma_{mx} & \Sigma_{mm}\end{pmatrix} \begin{pmatrix} {G_t^x}^T & 0 \\ 0 & I\end{pmatrix} +R_t = \begin{pmatrix} G_t^x\Sigma_{xx}{G_t^x}^T & G_t^x\Sigma_{xm} \\ {G_t^x\Sigma_{mx}}^T & \Sigma_{mm}\end{pmatrix}+R_t} Σtˉ=GtΣt−1GtT+RT=(Gtx00I)(ΣxxΣmxΣxmΣmm)(GtxT00I)+Rt=(GtxΣxxGtxTGtxΣmxTGtxΣxmΣmm)+Rt
- 该功能
-
《自主机器人导论》中里程计模型。
- ( x ′ y ′ θ ′ ) = ( x y θ ) + ( Δ s c o s ( θ + Δ θ / 2 ) Δ s s i n ( θ + Δ θ / 2 ) Δ θ ) {\begin{pmatrix} x'\\ y'\\ \theta'\end{pmatrix}= \begin{pmatrix} x \\ y \\ \theta \end{pmatrix}+ \begin{pmatrix} \Delta{s} \ cos(\theta+\Delta \theta/2) \\ \Delta{s} \ sin(\theta+\Delta \theta/2) \\ \Delta \theta \end{pmatrix}} ⎝⎛x′y′θ′⎠⎞=⎝⎛xyθ⎠⎞+⎝⎛Δs cos(θ+Δθ/2)Δs sin(θ+Δθ/2)Δθ⎠⎞
- 其中:
- Δ θ = Δ s r − Δ s l b {\Delta \theta = \frac{\Delta s_r - \Delta s_l}{b}} Δθ=bΔsr−Δsl
- Δ s = Δ s r + Δ s l 2 {\Delta s = \frac{\Delta s_r + \Delta s_l}{2}} Δs=2Δsr+Δsl
- Δ s l / r = k l / r ⋅ Δ e l / r {\Delta s_{l/r}=k_{l/r} \cdot \Delta e_{l/r}} Δsl/r=kl/r⋅Δel/r
- k l / r {k_{l/r}} kl/r左右轮系数,把编码器增量 Δ e l / r {\Delta e_{l/r}} Δel/r转换为左右轮的位移, b b b是轮间距。左右轮位移的增量 Δ s l / r {\Delta s_{l/r}} Δsl/r服从高斯分布,均值就是编码器计算出的位移增量,标准差与增量大小成正比。如果 t-1 时刻机器人位姿的协方差为 Σ ξ , t {\Sigma_{\xi,t}} Σξ,t,控制的协方差也就是编码器的协方差为: Σ u {\Sigma_u} Σu,那么机器人位姿在 t 时刻的协方差就是: Σ ξ , t = G ξ Σ ξ , t − 1 G ξ T + G u ′ Σ u G u ′ T {\Sigma_{\xi,t}=G_{\xi}\Sigma_{\xi,t-1}G_{\xi}^T+G_u'\Sigma_uG_u'^T} Σξ,t=GξΣξ,t−1GξT+Gu′ΣuGu′T
- G ξ {G_\xi} Gξ:为状态更新中对状态变量的 偏导。
- G u {G_u} Gu:为状态更新中对 编码器变量的 偏导。
-
-
预测总结:
- F x = ( 1 0 0 0...0 0 1 0 0...0 0 0 1 0...0 ⏟ 2 N c o l s ) {F_x = \begin{pmatrix} 1&0&0 & 0...0 \\ 0&1&0 & 0...0 \\ 0&0&1 & \underset{2N cols}{\underbrace{0...0}}\end{pmatrix}} Fx=⎝⎜⎛1000100010...00...02Ncols 0...0⎠⎟⎞
- μ t ˉ = μ t − 1 + F x T ( − v t w t s i n ( θ ) + v t w t s i n ( θ + w t Δ t ) v t w t c o s ( θ ) − v t w t c o s ( θ + w t Δ t ) w t Δ t ) {\bar{\mu_t}=\mu_{t-1}+F_x^T\begin{pmatrix} -\frac{v_t}{w_t}sin(\theta)+\frac{v_t}{w_t}sin(\theta+w_t\Delta _t) \\ \frac{v_t}{w_t}cos(\theta) -\frac{v_t}{w_t}cos(\theta+w_t\Delta _t) \\ w_t \Delta _t \end{pmatrix}} μtˉ=μt−1+FxT⎝⎛−wtvtsin(θ)+wtvtsin(θ+wtΔt)wtvtcos(θ)−wtvtcos(θ+wtΔt)wtΔt⎠⎞
- G t = I + F x T ( 0 0 v t w t c o s ( θ ) + v t w t c o s ( θ + w t Δ t ) 0 0 − v t w t s i n ( θ ) + v t w t s i n ( θ + w t Δ t ) 0 0 0 ) F x {G_t=I+F_x^T \begin{pmatrix} 0& 0& \frac{v_t}{w_t}cos(\theta)+\frac{v_t}{w_t}cos(\theta+w_t\Delta _t) \\0&0& -\frac{v_t}{w_t}sin(\theta)+\frac{v_t}{w_t}sin(\theta+w_t\Delta _t) \\ 0& 0& 0\end{pmatrix} F_x} Gt=I+FxT⎝⎛000000wtvtcos(θ)+wtvtcos(θ+wtΔt)−wtvtsin(θ)+wtvtsin(θ+wtΔt)0⎠⎞Fx
- Σ t ˉ = G t Σ t − 1 G t T + F x T R t x F x {\bar{\Sigma_t}=G_t\Sigma_{t-1}G_t^T+ F_x^TR_t^xF_x} Σtˉ=GtΣt−1GtT+FxTRtxFx
-
测量模型
- c t i = j {c_t^i=j} cti=j 在时间 t t t 的第 i i i 次测量观测到landmark 的下表为 j j j
- 步骤:若第一次观测到landmark时初始化,计算观测期望+雅克比,再计算卡尔曼
- 测距模型: z t i = ( r t i ϕ t i ) T {z_t^i=\begin{pmatrix}r_t^i& \phi_t^i \end{pmatrix}^T} zti=(rtiϕti)T
- 若landmark未被观测到时:
- landmark j j j的位置 = 机器人的预估位姿 + 相对测量
- ( μ j , x ˉ μ j , y ˉ ) = ( μ t , x ˉ μ t , y ˉ ) + ( r t i c o s ( ϕ t i + μ t , θ ˉ ) r t i s i n ( ϕ t i + μ t , θ ˉ ) ) {\begin{pmatrix} \bar{\mu_{j,x}} \\ \bar{\mu_{j,y}} \end{pmatrix} = \begin{pmatrix} \bar{\mu_{t,x}} \\ \bar{\mu_{t,y}} \end{pmatrix} + \begin{pmatrix} r_t^i cos(\phi_t^i+\bar{\mu_{t,\theta}}) \\r_t^i sin(\phi_t^i+\bar{\mu_{t,\theta}}) \end{pmatrix}} (μj,xˉμj,yˉ)=(μt,xˉμt,yˉ)+(rticos(ϕti+μt,θˉ)rtisin(ϕti+μt,θˉ))
- 通过当前估计计算期望观测:
- δ = ( δ x δ y ) = ( μ j , x ˉ − μ t , x ˉ μ j , y ˉ − μ t , y ˉ ) {\delta=\begin{pmatrix}\delta_x \\ \delta_y \end{pmatrix}= \begin{pmatrix} \bar{\mu_{j,x}}-\bar{\mu_{t,x}} \\\bar{\mu_{j,y}}-\bar{\mu_{t,y}} \end{pmatrix}} δ=(δxδy)=(μj,xˉ−μt,xˉμj,yˉ−μt,yˉ)
- q = δ T δ {q=\delta^T\delta} q=δTδ
- z t i ^ = ( q a t a n 2 ( δ y , δ x ) − μ t , θ ˉ ) = h ( μ t ˉ ) {\hat{z_t^i}=\begin{pmatrix} \sqrt q \\ atan2(\delta_y,\delta_x)- \bar{\mu_{t,\theta}} \end{pmatrix} = h(\bar{\mu_t})} zti^=(qatan2(δy,δx)−μt,θˉ)=h(μtˉ)
- 通过观测期望,计算 jacobian
- l o w H t i = ∂ h ( μ t ˉ ) ∂ μ t ˉ { ^{low}H_t^i=\frac{\partial h(\bar{\mu_t})}{\partial \bar{\mu_t}}} lowHti=∂μtˉ∂h(μtˉ)
- 涉及到的低维空间: ( x , y , θ , m j , x , m j , y ) {(x,y,\theta,m_{j,x},m_{j,y})} (x,y,θ,mj,x,mj,y)
- ( a t a n x ) ′ = 1 1 + x 2 {(atan x)' = \frac{1}{1+x^2}} (atanx)′=1+x21
- 故有: l o w H t i = ∂ h ( μ t ˉ ) ∂ μ t ˉ = 1 q ( − q δ x − q δ y 0 q δ x q δ y δ y − δ x − q − δ y δ x ) {^{low}H_t^i=\frac{\partial h(\bar{\mu_t})}{\partial \bar{\mu_t}} = \frac{1}{q}\begin{pmatrix} -\sqrt{q}\delta_x & -\sqrt{q}\delta_y & 0 & \sqrt{q}\delta_x & \sqrt{q}\delta_y \\ \delta_y & -\delta_x & -q & -\delta_y & \delta_x \end{pmatrix}} lowHti=∂μtˉ∂h(μtˉ)=q1(−qδxδy−qδy−δx0−qqδx−δyqδyδx)
- 其映射到高维空间:
- H t i = l o w H t i F x , j {H_t^i=^{low}H_t^i F_{x,j}} Hti=lowHtiFx,j
- F x , j = ( 1 0 0 0...0 0 0 0...0 0 1 0 0...0 0 0 0...0 0 0 1 0...0 0 0 0...0 0 0 0 0...0 1 0 0...0 0 0 0 0...0 ⏟ 2 j − 2 0 1 0...0 ⏟ 2 N − 2 ) {F_{x,j} = \begin{pmatrix} 1 & 0 & 0 & 0...0 & 0 & 0 & 0...0 \\ 0 & 1 & 0 & 0...0 & 0 & 0 & 0...0 \\ 0 & 0 & 1 & 0...0 & 0 & 0 & 0...0 \\ 0 & 0 & 0 & 0...0 & 1 & 0 & 0...0 \\ 0 & 0 & 0 & \underset{2j-2}{\underbrace{0...0}} & 0 & 1 & \underset{2N -2}{\underbrace{0...0}} \end{pmatrix}} Fx,j=⎝⎜⎜⎜⎜⎜⎜⎛1000001000001000...00...00...00...02j−2 0...000010000010...00...00...00...02N−2 0...0⎠⎟⎟⎟⎟⎟⎟⎞
-
修正总结:
- Q t = ( δ r 2 0 0 σ ϕ 2 ) {Q_t=\begin{pmatrix} \delta_r^2 & 0 \\ 0& \sigma_{\phi}^2 \end{pmatrix}} Qt=(δr200σϕ2)
- 对于所有观测特征
z
t
i
=
(
r
t
i
ϕ
t
i
)
T
{z_t^i=\begin{pmatrix}r_t^i& \phi_t^i \end{pmatrix}^T}
zti=(rtiϕti)T 作:
- j = c t i {j = c_t^i} j=cti
- 如果 landmark
j
j
j 在此之前没有看到过:
- ( μ j , x ˉ μ j , y ˉ ) = ( μ t , x ˉ μ t , y ˉ ) + ( r t i c o s ( ϕ t i + μ t , θ ˉ ) r t i s i n ( ϕ t i + μ t , θ ˉ ) ) {\begin{pmatrix} \bar{\mu_{j,x}} \\ \bar{\mu_{j,y}} \end{pmatrix} = \begin{pmatrix} \bar{\mu_{t,x}} \\ \bar{\mu_{t,y}} \end{pmatrix} + \begin{pmatrix} r_t^i cos(\phi_t^i+\bar{\mu_{t,\theta}}) \\r_t^i sin(\phi_t^i+\bar{\mu_{t,\theta}}) \end{pmatrix}} (μj,xˉμj,yˉ)=(μt,xˉμt,yˉ)+(rticos(ϕti+μt,θˉ)rtisin(ϕti+μt,θˉ))
- δ = ( δ x δ y ) = ( μ j , x ˉ − μ t , x ˉ μ j , y ˉ − μ t , y ˉ ) {\delta=\begin{pmatrix}\delta_x \\ \delta_y \end{pmatrix}= \begin{pmatrix} \bar{\mu_{j,x}}-\bar{\mu_{t,x}} \\\bar{\mu_{j,y}}-\bar{\mu_{t,y}} \end{pmatrix}} δ=(δxδy)=(μj,xˉ−μt,xˉμj,yˉ−μt,yˉ)
- q = δ T δ {q=\delta^T\delta} q=δTδ
- z t i ^ = ( q a t a n 2 ( δ y , δ x ) − μ t , θ ˉ ) = h ( μ t ˉ ) {\hat{z_t^i}=\begin{pmatrix} \sqrt q \\ atan2(\delta_y,\delta_x)- \bar{\mu_{t,\theta}} \end{pmatrix} = h(\bar{\mu_t})} zti^=(qatan2(δy,δx)−μt,θˉ)=h(μtˉ)
- F x , j = ( 1 0 0 0...0 0 0 0...0 0 1 0 0...0 0 0 0...0 0 0 1 0...0 0 0 0...0 0 0 0 0...0 1 0 0...0 0 0 0 0...0 ⏟ 2 j − 2 0 1 0...0 ⏟ 2 N − 2 ) {F_{x,j} = \begin{pmatrix} 1 & 0 & 0 & 0...0 & 0 & 0 & 0...0 \\ 0 & 1 & 0 & 0...0 & 0 & 0 & 0...0 \\ 0 & 0 & 1 & 0...0 & 0 & 0 & 0...0 \\ 0 & 0 & 0 & 0...0 & 1 & 0 & 0...0 \\ 0 & 0 & 0 & \underset{2j-2}{\underbrace{0...0}} & 0 & 1 & \underset{2N -2}{\underbrace{0...0}} \end{pmatrix}} Fx,j=⎝⎜⎜⎜⎜⎜⎜⎛1000001000001000...00...00...00...02j−2 0...000010000010...00...00...00...02N−2 0...0⎠⎟⎟⎟⎟⎟⎟⎞
- H t i = 1 q ( − q δ x − q δ y 0 q δ x q δ y δ y − δ x − q − δ y δ x ) F x , j {H_t^i= \frac{1}{q}\begin{pmatrix}-\sqrt{q}\delta_x & -\sqrt{q}\delta_y & 0 & \sqrt{q}\delta_x & \sqrt{q}\delta_y \\ \delta_y & -\delta_x & -q & -\delta_y & \delta_x \end{pmatrix}F_{x,j}} Hti=q1(−qδxδy−qδy−δx0−qqδx−δyqδyδx)Fx,j
- K t = Σ t ˉ H t T ( H t Σ t ˉ H t T + Q t ) − 1 {K_t = \bar{\Sigma_t}H_t^T(H_t\bar{\Sigma_t}H_t^T+Q_t)^{-1}} Kt=ΣtˉHtT(HtΣtˉHtT+Qt)−1
- μ ˉ t = μ t ˉ + K t ( z t − h ( μ t ˉ ) ) {\bar \mu_t = \bar{\mu_t}+K_t(z_t-h(\bar{\mu_t}))} μˉt=μtˉ+Kt(zt−h(μtˉ))
- Σ ˉ t = ( I − K t H t ) Σ t ˉ {\bar\Sigma_t=(I-K_tH_t)\bar{\Sigma_t}} Σˉt=(I−KtHt)Σtˉ
- μ t = μ t ˉ {\mu_t = \bar{\mu_t}} μt=μtˉ
- Σ t = Σ ˉ t {\Sigma_t=\bar\Sigma_t} Σt=Σˉt
-
执行时注意:
- 单个步骤中的测量更新只需要一次完整的置信度更新
- 始终归一化角度分量
- 你可能不需要创建 F F F 矩阵
Loop Closures
-
Notes:
-
闭环意味着识别已有的地图。
-
数据关联:高度模糊,尽可能的环境相似。关注:闭环是否正确
-
闭环减少了机器人与landmark之间的不确定性,提高建图效率,但错误的闭环导致滤波器发散
-
-
相关性:
- 机器人的姿态与地标之间的相关性不容忽略(识别精度)
- 假设独立性会对不确定性的影响过于乐观估计
-
不确定性:
- 任何子矩阵都是地图协方差单调递减的决定因素
- 新的landmark以最大不确定初始化
-
限制:
- 在限制中,与任何单个地标位置估计相关联的协方差仅由车辆位置估计中的初始协方差确定。
-
EKF 的复杂度:
- 复杂度仅取决于测量的维度
- 每一步的代价:有地标的数量决定 O ( n 2 ) O(n^2) O(n2)
- 内存消耗 O ( n 2 ) O(n^2) O(n2)
- 对于大型地图,EKF变得难以计算