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
sim_baro.c
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include "state.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
Dummy Handling of the MS5534a pressure sensor for the sim.
int32_t hmsl
height above mean sea level in mm
Definition: gps.h:67
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
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
Definition: state.h:651
API to get/set the generic vehicle states.
float baro_MS5534A_sigma2
Definition: sim_baro.c:14
float alt
in meters above WGS84 reference ellipsoid
struct GpsState gps
global GPS state
Definition: gps.c:33