-
Notifications
You must be signed in to change notification settings - Fork 2
/
kalman.h
69 lines (49 loc) · 1.09 KB
/
kalman.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* file: kalman.h
*
* implements kalman filter for linear system:
*
* | 1 dt | * | p | + | 0.5 * dt ^ 2 | * | a | = | p |
* | 0 1 | * | v | | dt | | v |
*
* authors:
* Jan Roemisch, Ilmenau University of Technology
* Tobias Simon, Ilmenau University of Technology
*/
#ifndef __KALMAN_H__
#define __KALMAN_H__
typedef struct
{
float pos;
float speed;
}
kalman_out_t;
typedef struct
{
float pos; /* position in m */
//float speed; /* speed in m/s */
float acc; /* acceleration min m/s^2 */
}
kalman_in_t;
typedef struct
{
float dt; /* delta t in sec */
float process_var;
float measurement_var;
}
kalman_config_t;
struct kalman;
typedef struct kalman kalman_t;
/*
* executes kalman predict and correct step
*/
void kalman_run(kalman_out_t *out, kalman_t *kalman, const kalman_in_t *in);
/*
* allocates and initializes a kalman filter
*/
kalman_t *kalman_create(const kalman_config_t *config, const kalman_out_t *init_state);
/*
* deletes the kalman filter
*/
void kalman_free(kalman_t *kalman);
#endif /* __KALMAN_H__ */