26 #ifndef LINEAR_KALMAN_FILTER_H
27 #define LINEAR_KALMAN_FILTER_H
32 #ifndef KF_MAX_STATE_SIZE
33 #define KF_MAX_STATE_SIZE 6
37 #ifndef KF_MAX_CMD_SIZE
38 #define KF_MAX_CMD_SIZE 2
42 #ifndef KF_MAX_MEAS_SIZE
43 #define KF_MAX_MEAS_SIZE 6
#define KF_MAX_STATE_SIZE
float C[KF_MAX_MEAS_SIZE][KF_MAX_STATE_SIZE]
observation matrix
uint8_t n
state vector size (<= KF_MAX_STATE_SIZE)
float R[KF_MAX_MEAS_SIZE][KF_MAX_MEAS_SIZE]
measurement covariance noise
bool linear_kalman_filter_init(struct linear_kalman_filter *filter, uint8_t n, uint8_t c, uint8_t m)
Init all matrix and vectors to zero.
uint8_t m
measurement vector size (<= KF_MAX_MEAS_SIZE)
void linear_kalman_filter_predict(struct linear_kalman_filter *filter, float *U)
Prediction step.
float X[KF_MAX_STATE_SIZE]
estimated state X
uint8_t c
command vector size (<= KF_MAX_CMD_SIZE)
float P[KF_MAX_STATE_SIZE][KF_MAX_STATE_SIZE]
state covariance matrix
float A[KF_MAX_STATE_SIZE][KF_MAX_STATE_SIZE]
dynamic matrix
float B[KF_MAX_STATE_SIZE][KF_MAX_CMD_SIZE]
command matrix
void linear_kalman_filter_update(struct linear_kalman_filter *filter, float *Y)
Update step.
float Q[KF_MAX_STATE_SIZE][KF_MAX_STATE_SIZE]
proces covariance noise
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.