| title | Sensor Fusion | EKF |
|---|---|
| textbook | #sensor-fusion |
remember this?
Note:
- sensors and state estimation, by its very probabilistic and noisy nature, introduces errors.
question is → "which sensor do we believe?"
this might be the wrong question!
instead of picking one vs. the other
instead of picking one vs. the other
process of combining sensory data from multiple sources to obtain more accurate information than would be possible using individual sensors alone
individual sensors have inherent limitations:
individual sensors have inherent limitations:
- limited accuracy → measurement errors
individual sensors have inherent limitations:
- limited accuracy → measurement errors
- limited range/coverage → may only work in certain conditions
individual sensors have inherent limitations:
- limited accuracy → measurement errors
- limited range/coverage → may only work in certain conditions
- limited sampling rates → cannot always update fast enough
individual sensors have inherent limitations:
- limited accuracy → measurement errors
- limited range/coverage → may only work in certain conditions
- limited sampling rates → cannot always update fast enough
- sensor-specific weaknesses: GPS fails indoors, cameras in darkness
- combines complementary data from multiple sensors
- combines complementary data from multiple sensors
- each with different strengths/weaknesses
- combines complementary data from multiple sensors
- each with different strengths/weaknesses
goal → produce combination that's more accurate, complete, robust
so, how do we fuse sensors?
can we use the kalman filter for sensor fusion?
can we use the kalman filter for sensor fusion?
example: consider the following
- state, $\mathbf{x}=\left[\begin{array}{l}x \newline \dot{x}\end{array}\right]$
example: consider the following
- state, $\mathbf{x}=\left[\begin{array}{l}x \newline \dot{x}\end{array}\right]$
- two sensors, $\mathbf{z}=\left[\begin{array}{c}z_{G P S} \newline z_{\text {odom }}\end{array}\right]$
Note:
- (GPS → metres, odometry → feet)
using parameters for Kalman Filter,
substituting this into the Kalman Filter equations,
$$ \begin{aligned} \mathbf{y} = & \mathbf{z}-\mathbf{H} \overline{\mathbf{x}} \newline \end{aligned} $$
substituting this into the Kalman Filter equations,
substituting this into the Kalman Filter equations,
substituting this into the Kalman Filter equations,
but Kalman filter doesn't work for non-linear systems
but Kalman filter doesn't work for non-linear systems
what exactly is the problem with nonlinear systems?
Kalman Filter (and any Bayes' Filter) requires → Gaussians
Kalman Filter (and any Bayes' Filter) requires → Gaussians
breaks down in the face of non-linearities
Gaussians and non-linear functions
Gaussians and non-linear functions
| mixing of | result |
|---|---|
| two Gaussians | Gaussian |
Gaussians and non-linear functions
| mixing of | result |
|---|---|
| two Gaussians | Gaussian |
| Gaussian and linear function | Gaussian |
Gaussians and non-linear functions
| mixing of | result |
|---|---|
| two Gaussians | Gaussian |
| Gaussian and linear function | Gaussian |
| Gaussian and non-linear function | non-Gaussian |
Gaussians and non-linear functions
| mixing of | result |
|---|---|
| two Gaussians | Gaussian |
| Gaussian and linear function | Gaussian |
| Gaussian and non-linear function | non-Gaussian |
| linear and non-linear function | non-Gaussian |
Gaussians and non-linear functions
| mixing of | result |
|---|---|
| two Gaussians | Gaussian |
| Gaussian and linear function | Gaussian |
| Gaussian and non-linear function | non-Gaussian |
| linear and non-linear function | non-Gaussian |
| two non-linear function | non-Gaussian |
example: Gaussian being transformed using another function,
case 1:
case 1:
Note:
- we can see the result and it is a nice Gaussian
case 2:
case 2:
case 2:
output is no longer a Gaussian
output is no longer a Gaussian
violates unimodality assumption of Kalman Filter → requires single peak
-
linearization → approximate a non-linear function,
$g(.)$
-
linearization → approximate a non-linear function,
$g(.)$ - by a linear function that is tangent to
$g(.)$
-
linearization → approximate a non-linear function,
$g(.)$ - by a linear function that is tangent to
$g(.)$ - at the point of interest
EKF → uses Taylor Series Expansion
a brief detour...
approximates function → around specific point using polynomial terms
approximates function → around specific point using polynomial terms
infinite sum of polynomials → function’s derivatives at single point,
| term | description |
|---|---|
| the function value at point |
| term | description |
|---|---|
| the function value at point |
|
|
|
the derivatives of |
| term | description |
|---|---|
| the function value at point |
|
|
|
the derivatives of |
| represents the deviation from the expansion point | |
- higher-order Taylor Expansions → closer approximation of original function
- computation → intractable!
example 1:
Note:
- f(x) is non-linear here
example 1:
$f(1) = 1$
example 1:
$f(1) = 1$ -
$f'(x) = 2x$ , so$f'(1) = 2$
example 1:
$f(1) = 1$ -
$f'(x) = 2x$ , so$f'(1) = 2$ - first-order Taylor approximation:
$f(x) \approx 1 + 2(x-1)$
example 1:
$f(1) = 1$ -
$f'(x) = 2x$ , so$f'(1) = 2$ - first-order Taylor approximation:
$f(x) \approx 1 + 2(x-1)$ - this gives us a linear approximation:
$f(x) \approx 2x - 1$
linear approximation:
example 2: non-linear function from before:
first order Taylor approximation (in red)
first order Taylor approximation (in red)
not a very good approximation!
what do we care about?
what do we care about?
- only concerned with approximation at → posterior
what do we care about?
- only concerned with approximation at → posterior
- recompute posteriors → very short time period
what do we care about?
- only concerned with approximation at → posterior
- recompute posteriors → very short time period
- approximation → quite good in close vicinity of point of interest
let's look at our approximation again
let's look at our approximation again
let's look at our approximation again
let's look at our approximation again
quite good!
EKF → first-order Taylor expansions
EKF → first-order Taylor expansions
- for nonlinear system and
- measurement functions
EKF → first-order Taylor expansions
- for nonlinear system and
- measurement functions
linearizing nonlinear functions → around current estimate
state equation:
state equation:
measurement equation:
state equation:
measurement equation:
-
$F_k$ → Jacobian of$f$ w.r.t.$x$ -
$H_k$ → Jacobian of$h$ w.r.t.$x$
- contain all partial derivatives of nonlinear functions
- contain all partial derivatives of nonlinear functions
- w.r.t each state variable
- contain all partial derivatives of nonlinear functions
- w.r.t each state variable
- evaluated at the current estimate
- contain all partial derivatives of nonlinear functions
- w.r.t each state variable
- evaluated at the current estimate
represent sensitivity of functions → to small changes in state
state is a vector → need partial derivaties
Note:
- x is state
- P is uncertainty/covariance
Note:
- K is kalman gain
please read the textbook chapter on ekf for actual details!
two main approaches → multi-sensor fusion with EKF
two main approaches → multi-sensor fusion with EKF
- all sensor measurements → processed in single EKF
- all sensor measurements are processed in a single EKF
- measurement vector combines all sensor readings $$z_k = \begin{bmatrix} z_k^1 \newline z_k^2 \newline \vdots \newline z_k^n \end{bmatrix}$$
- all sensor measurements are processed in a single EKF
- measurement vector combines all sensor readings
- measurement function
- all sensor measurements are processed in a single EKF
- measurement vector combines all sensor readings
- measurement function, noise covariance
- each sensor → has its own local filter
- each sensor → has its own local filter
- results are combined → fusion center
- each sensor → has its own local filter
- results are combined → fusion center
more modular and fault-tolerant
- state estimates from individual filters → combined
- using covariance intersection:
- how much weight → each sensor's measurements
- how much weight → each sensor's measurements
- sensors with lower measurement uncertainty (smaller values in
$R_k$ )
- how much weight → each sensor's measurements
- sensors with lower measurement uncertainty (smaller values in
$R_k$ )- more influence → on final state estimate
- how much weight → each sensor's measurements
- sensors with lower measurement uncertainty (smaller values in
$R_k$ )- more influence → on final state estimate
- lower uncertainty → higher confidence
adaptive methods → dynamically adjust covariances
adaptive methods → dynamically adjust covariances
- current operating conditions
adaptive methods → dynamically adjust covariances
- current operating conditions
- sensor health monitoring
adaptive methods → dynamically adjust covariances
- current operating conditions
- sensor health monitoring
- consistency checks between sensors
adaptive methods → dynamically adjust covariances
- current operating conditions
- sensor health monitoring
- consistency checks between sensors
- historical performance
example → GPS accuracy degrades in urban canyons
example → GPS accuracy degrades in urban canyons
GPS covariance → increase (lower confidence) in those environments
fusing IMU (accelerometer, gyroscope) + GPS → position tracking
constant velocity model + heading changes from gyroscope
constant velocity model + heading changes from gyroscope
constant velocity model + heading changes from gyroscope
| accelerometer readings |
constant velocity model + heading changes from gyroscope
- GPS →
$h_{gps}(x_k) = [\text{position}_x, \text{position}_y]^T$
- GPS →
$h_{gps}(x_k) = [\text{position}_x, \text{position}_y]^T$ - IMU (for update) →
$h_{imu}(x_k) = [\text{velocity}_x, \text{velocity}_y, \text{heading}]^T$
| high-frequency updates | IMU updates at |
smooth tracking |
| high-frequency updates | IMU updates at |
smooth tracking |
| drift correction | GPS updates at |
corrects accumulated drift from IMU |
| high-frequency updates | IMU updates at |
smooth tracking |
| drift correction | GPS updates at |
corrects accumulated drift from IMU |
robustness to GPS outages → reasonable position estimates
| data source | description |
|---|---|
| blue dots | raw gps data |
| orange line | dead reckoning using only imu data |
| green line | ekf fusion of gps and imu |
| best practices | description | notes |
|---|---|---|
| careful state selection | include only necessary states | avoid computational burden |
| best practices | description | notes |
|---|---|---|
| careful state selection | include only necessary states | avoid computational burden |
| proper initialization | set initial covariance | reflect actual uncertainty |
| best practices | description | notes |
|---|---|---|
| careful state selection | include only necessary states | avoid computational burden |
| proper initialization | set initial covariance | reflect actual uncertainty |
| tuning noise parameters | adjust |
based on empirical data |
| best practices | description | notes |
|---|---|---|
| consistency monitoring | check filter consistency | normalized innovation squared (NIS) |
| best practices | description | notes |
|---|---|---|
| consistency monitoring | check filter consistency | normalized innovation squared (NIS) |
| fault detection | implement mechanisms to detect sensor failures |
| best practices | description | notes |
|---|---|---|
| consistency monitoring | check filter consistency | normalized innovation squared (NIS) |
| fault detection | implement mechanisms to detect sensor failures | |
| numerical stability | use square-root or UD factorization | improved numerical properties |
EKF → both process and measurement noise are Gaussian
| method | description |
|---|---|
| particle filters | represent the probability distribution using samples |
| method | description |
|---|---|
| particle filters | represent the probability distribution using samples |
| robust kalman filters | use heavy-tailed distributions to model outliers |
| method | description |
|---|---|
| particle filters | represent the probability distribution using samples |
| robust kalman filters | use heavy-tailed distributions to model outliers |
| pre-filtering | apply outlier rejection before using EKF |
Note:
- UKF -- unscented kalman filter
- selects a set of sigma points around the current state estimate
- propagates these points through the nonlinear functions
- computes a weighted mean and covariance from the transformed points
| EKF error | UKF error | impr. | |
|---|---|---|---|
| position | 1.45m | 0.95m | 34.5% |
| velocity | 0.32m/s | 0.25m/s | 21.9% |
| heading | 2.1deg | 1.7deg | 19.0% |
Note:
- avoids the need for explicit Jacobian calculations and can handle nonlinearities better.






