forked from simondlevy/TinyEKF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtinyekf_config.h
48 lines (36 loc) · 1.3 KB
/
tinyekf_config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* TinyEKF: Extended Kalman Filter for embedded processors.
*
* tinyekf_config.h: static configuration parameters
*
* Copyright (C) 2015 Simon D. Levy
*
* MIT License
*/
/* states */
#define Nsta 8
/* observables */
#define Mobs 4
typedef struct {
int n; /* number of state values */
int m; /* number of observables */
double x[Nsta]; /* state vector */
double P[Nsta][Nsta]; /* prediction error covariance */
double Q[Nsta][Nsta]; /* process noise covariance */
double R[Mobs][Mobs]; /* measurement error covariance */
double G[Nsta][Mobs]; /* Kalman gain; a.k.a. K */
double F[Nsta][Nsta]; /* Jacobian of process model */
double H[Mobs][Nsta]; /* Jacobian of measurement model */
double Ht[Nsta][Mobs]; /* transpose of measurement Jacobian */
double Ft[Nsta][Nsta]; /* transpose of process Jacobian */
double Pp[Nsta][Nsta]; /* P, post-prediction, pre-update */
double fx[Nsta]; /* output of user defined f() state-transition function */
double hx[Mobs]; /* output of user defined h() measurement function */
/* temporary storage */
double tmp0[Nsta][Nsta];
double tmp1[Nsta][Mobs];
double tmp2[Mobs][Nsta];
double tmp3[Mobs][Mobs];
double tmp4[Mobs][Mobs];
double tmp5[Mobs];
} ekf_t;