It is a 10 state Kalman filter, and at this point we want to write a general implementation since we might decide to reduce the number of states in the end (and don't implement some sensors, such as GPS etc).
init state matrices and other objects to their default values
when a callback from a sensor happens (new data available) set a sensor flag to true and copy the new measurement (this can be converted to just periodic read from sensors since everything is at the same frequency of 200Hz)
in the main loop:
perform sanitty checks (std, errors, reset)
see which sensors are available
check for NaN in matrices (are they numerically stable?)
We are trying to mimic PX4 local position estimator - a Kalman filter that uses optical flow and bunch of other sensors. Here is the full code: https://github.com/PX4/Firmware/tree/master/src/modules/local_position_estimator
It is a 10 state Kalman filter, and at this point we want to write a general implementation since we might decide to reduce the number of states in the end (and don't implement some sensors, such as GPS etc).
Structure:
Sensors
How does it work?