Ensemble Kalman Filter Localization

https://github.com/AtsushiSakai/PythonRoboticsGifs/raw/master/Localization/ensamble_kalman_filter/animation.gif

This is a sensor fusion localization with Ensemble Kalman Filter(EnKF).

The blue line is true trajectory, the black line is dead reckoning trajectory, and the red line is estimated trajectory with EnKF.

The red ellipse is estimated covariance ellipse with EnKF.

It is assumed that the robot can measure distance and bearing angle from landmarks (RFID).

These measurements are used for EnKF localization.

Input Vector

The robot has a velocity sensor and a gyro sensor, so the control input vector at each time step is:

\[\mathbf{u}_t = [v_t, \omega_t]^T\]

where:

  • \(v_t\) is linear velocity

  • \(\omega_t\) is angular velocity (yaw rate)

The input vector includes sensor noise modeled by covariance matrix \(\mathbf{R}\):

\[\begin{split}\mathbf{R} = \begin{bmatrix} \sigma_v^2 & 0 \\ 0 & \sigma_\omega^2 \end{bmatrix}\end{split}\]

Observation Vector

The robot can observe landmarks (RFID tags) with distance and bearing measurements:

\[\mathbf{z}_t = [d_t, \theta_t, x_{lm}, y_{lm}]\]

where:

  • \(d_t\) is the distance to the landmark

  • \(\theta_t\) is the bearing angle to the landmark

  • \(x_{lm}, y_{lm}\) are the known landmark positions

The observation noise is modeled by covariance matrix \(\mathbf{Q}\):

\[\begin{split}\mathbf{Q} = \begin{bmatrix} \sigma_d^2 & 0 \\ 0 & \sigma_\theta^2 \end{bmatrix}\end{split}\]

Motion Model

The robot motion model is:

\[\dot{x} = v \cos(\phi)\]
\[\dot{y} = v \sin(\phi)\]
\[\dot{\phi} = \omega\]
\[\dot{v} = 0\]

Discretized with time step \(\Delta t\), the motion model becomes:

\[\mathbf{x}_{t+1} = f(\mathbf{x}_t, \mathbf{u}_t) = \mathbf{F}\mathbf{x}_t + \mathbf{B}\mathbf{u}_t\]

where:

\(\begin{equation*} \mathbf{F} = \begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 \\ \end{bmatrix} \end{equation*}\)

\(\begin{equation*} \mathbf{B} = \begin{bmatrix} \cos(\phi) \Delta t & 0\\ \sin(\phi) \Delta t & 0\\ 0 & \Delta t\\ 1 & 0\\ \end{bmatrix} \end{equation*}\)

The motion function expands to:

\(\begin{equation*} \begin{bmatrix} x_{t+1} \\ y_{t+1} \\ \phi_{t+1} \\ v_{t+1} \end{bmatrix} = \begin{bmatrix} x_t + v_t\cos(\phi_t)\Delta t \\ y_t + v_t\sin(\phi_t)\Delta t \\ \phi_t + \omega_t \Delta t \\ v_t \end{bmatrix} \end{equation*}\)

Observation Model

For each landmark at position \((x_{lm}, y_{lm})\), the observation model calculates the expected landmark position in the global frame:

\[\begin{split}\begin{bmatrix} x_{lm,obs} \\ y_{lm,obs} \end{bmatrix} = \begin{bmatrix} x + d \cos(\phi + \theta) \\ y + d \sin(\phi + \theta) \end{bmatrix}\end{split}\]

where \(d\) and \(\theta\) are the observed distance and bearing to the landmark.

The observation function projects the robot state to expected landmark positions, which are then compared with actual landmark positions for the update step.

Advantages of EnKF

  • No Jacobian required: Unlike EKF, EnKF does not need to compute Jacobian matrices, making it easier to implement for nonlinear systems

  • Handles non-Gaussian distributions: The ensemble representation can capture non-Gaussian features of the state distribution

  • Computationally efficient: For high-dimensional systems, EnKF can be more efficient than maintaining full covariance matrices

  • Easy to parallelize: Each ensemble member can be propagated independently

Reference