Implements a generalized extended Kalman filter.
Makes heavy use of automatic differentiation to automatically linearize your arbitrary, possibly-nonlinear system model and sensor mappings.
Automatic differentiation is very fast, and computes derivatives to machine precision while avoiding finite differencing or symbolic manipulations. As long as all intermidiate computations are carried out using the Dual class, a sensible derivative will be computed.
The pieces are:
- A
Sensortakes a state (made ofDuals) and converts it to a reading, using arbitrary math. - A
Predictortakes a state (made ofDuals) and a time delta, and produces a new state for t + dt, using arbitrary math. - A
KalmanFiltertakes aPredictorand a list ofSensors, and constructs an EKF model for the system they describe. - In an update loop, the
KalmanFilteris fedMeasurements (i.e. a sensor object and its reading) anddt, and updates itself to the new optimal estimate of state.