The Extended Kalman Filter is the Kalman filter for systems whose motion or measurement models are nonlinear. It linearises the models around the current estimate at every step. In mobile robots it fuses wheel odometry, an IMU and other sensors into one smooth pose estimate. The linear filter is explained in Kalman Filtering.

Models

  • is the state, for example position, heading and velocities
  • is the motion model, maps a state to what a sensor would measure
  • is process noise, is measurement noise

Predict

  • evaluated at the current estimate, the Jacobian of the motion model
  • uncertainty grows every predict step

Update

  • , the Jacobian of the measurement model
  • is the innovation, the surprise in the measurement
  • a large means a sensor is trusted less, so its gain is smaller

Where The EKF Fails

  • strongly nonlinear models over one step, because a straight-line approximation is then poor
  • noise that is not Gaussian, or a belief with several peaks (for example "I am in one of two identical corridors"), which is why map localisation often uses a particle filter
  • biased errors: the filter assumes zero-mean noise, so a sensor that is wrong in one direction pulls the estimate even with a large covariance

Fusing Sensors In ROS 2

The robot_localization package runs an EKF and lets each sensor update only chosen state variables:

  • each input has a 15-value boolean list: , roll, pitch, yaw, their velocities, and the linear accelerations
  • a good rule is to fuse each sensor only for what it measures well
  • wheel encoders: forward velocity only, because their position drifts and their yaw rate is wrong when wheels slip
  • an IMU with on-board fusion: absolute yaw, because its fused orientation does not drift in heading
  • two_d_mode: true holds roll, pitch and at zero for a ground robot
  • the EKF publishes the odom to base_link transform, so no other node may publish it as well

Absolute versus differential:

  • absolute mode uses a sensor's orientation as it is
  • differential mode turns successive readings into a velocity, which helps when two sensors give absolute values that disagree