Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
alt_vfilter.h
Go to the documentation of this file.
1 #ifndef ALT_VFILTER_H
2 #define ALT_VFILTER_H
3 
4 #define STATE_SIZE 3
5 
6 extern float alt_vf_z;
7 extern float alt_vf_zdot;
8 extern float alt_vf_bias;
9 extern float alt_vf_P[STATE_SIZE][STATE_SIZE];
10 
11 extern float alt_vf_z_meas;
12 
13 extern void alt_vf_init(float z, float zdot, float bias);
14 extern void alt_vf_predict(float accel);
15 extern void alt_vf_update_z(float z_meas);
16 extern void alt_vf_update_vz(float vz);
17 
18 extern void alt_vf_periodic_task(void);
19 
20 
21 #if USE_BARO_MS5534A
22 
23 #include "baro_MS5534A.h"
24 
25 #define AltVFliterEvent() { \
26  if (spi_message_received) { \
27  /* Got a message on SPI. */ \
28  spi_message_received = FALSE; \
29  baro_MS5534A_event_task(); \
30  if (baro_MS5534A_available) { \
31  baro_MS5534A_available = FALSE; \
32  baro_MS5534A_z = ground_alt +((float)baro_MS5534A_ground_pressure - baro_MS5534A_pressure)*0.084; \
33  if (alt_baro_enabled) { \
34  alt_vf_update_z(-baro_MS5534A_z); \
35  } \
36  } \
37  } \
38 }
39 
40 #else
41 #define AltVFliterEvent() {}
42 #endif
43 
44 
45 #endif /* ALT_VFILTER_H */
void alt_vf_update_vz(float vz)
Definition: alt_vfilter.c:150
float alt_vf_bias
Definition: alt_vfilter.c:22
float alt_vf_z
Definition: alt_vfilter.c:20
void alt_vf_predict(float accel)
Definition: alt_vfilter.c:59
#define STATE_SIZE
Definition: alt_vfilter.h:4
float alt_vf_P[STATE_SIZE][STATE_SIZE]
Definition: alt_vfilter.c:24
float alt_vf_zdot
Definition: alt_vfilter.c:21
float alt_vf_z_meas
Definition: alt_vfilter.c:26
void alt_vf_init(float z, float zdot, float bias)
Definition: alt_vfilter.c:28
void alt_vf_update_z(float z_meas)
Definition: alt_vfilter.c:101
void alt_vf_periodic_task(void)