Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sim_baro.c
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include "estimator.h"
3 #include "subsystems/nav.h"
4 #include "subsystems/gps.h"
5 #include "baro_MS5534A.h"
6 
16 
17 void baro_MS5534A_init(void) {
19 
20  baro_MS5534A_r = 10.;
22 }
23 
24 // void baro_MS5534A_reset(void);
25 
26 void baro_MS5534A_send(void) {
27  static bool_t even = FALSE;
28  even = !even;
29 
30  spi_message_received = even;
31 }
32 
34  baro_MS5534A_pressure = baro_MS5534A_ground_pressure - (gps.hmsl/1000.-ground_alt) / 0.08 + ((10.*random()) / RAND_MAX);
37 }
unsigned short uint16_t
Definition: types.h:16
uint32_t baro_MS5534A_ground_pressure
Definition: sim_baro.c:11
bool_t spi_message_received
Definition: sim_baro.c:8
uint16_t baro_MS5534A_temp
Definition: sim_baro.c:12
uint32_t baro_MS5534A_pressure
Definition: sim_baro.c:10
int32_t hmsl
height above mean sea level in mm
Definition: gps.h:66
void baro_MS5534A_send(void)
Definition: sim_baro.c:26
#define FALSE
Definition: imu_chimu.h:141
float baro_MS5534A_z
Definition: sim_baro.c:15
bool_t baro_MS5534A_available
Definition: sim_baro.c:9
Device independent GPS code (interface)
unsigned long uint32_t
Definition: types.h:18
bool_t alt_baro_enabled
Definition: sim_baro.c:7
float baro_MS5534A_r
Definition: sim_baro.c:13
void baro_MS5534A_init(void)
Definition: sim_baro.c:17
#define TRUE
Definition: imu_chimu.h:144
void baro_MS5534A_event_task(void)
Definition: sim_baro.c:33
float estimator_z
altitude above MSL in meters
Definition: estimator.c:44
State estimation, fusioning sensors.
float baro_MS5534A_sigma2
Definition: sim_baro.c:14
struct GpsState gps
global GPS state
Definition: gps.c:31