|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
47 #include "pprzlink/messages.h"
51 #ifndef USE_AIRSPEED_ETS
53 #define USE_AIRSPEED_ETS TRUE
58 #if !USE_AIRSPEED_ETS && !AIRSPEED_ETS_SYNC_SEND
59 #warning either set USE_AIRSPEED_ETS or AIRSPEED_ETS_SYNC_SEND to use airspeed_ets
62 #define AIRSPEED_ETS_ADDR 0xEA
63 #ifndef AIRSPEED_ETS_SCALE
64 #define AIRSPEED_ETS_SCALE 1.8
66 #ifndef AIRSPEED_ETS_OFFSET
67 #define AIRSPEED_ETS_OFFSET 0
69 #define AIRSPEED_ETS_OFFSET_MAX 1750
70 #define AIRSPEED_ETS_OFFSET_MIN 1450
71 #define AIRSPEED_ETS_OFFSET_NBSAMPLES_INIT 40
72 #define AIRSPEED_ETS_OFFSET_NBSAMPLES_AVRG 60
73 #define AIRSPEED_ETS_NBSAMPLES_AVRG 10
75 #ifndef AIRSPEED_ETS_I2C_DEV
76 #define AIRSPEED_ETS_I2C_DEV i2c0
81 #ifndef AIRSPEED_ETS_START_DELAY
82 #define AIRSPEED_ETS_START_DELAY 0.2
87 #if AIRSPEED_ETS_SDLOG
90 bool log_airspeed_ets_started;
136 #if AIRSPEED_ETS_SDLOG
137 log_airspeed_ets_started =
false;
152 #elif !defined USE_NPS
161 float airspeed_tmp = 0.0;
174 #if !AIRSPEED_ETS_3RD_PARTY_MODE
197 #ifdef AIRSPEED_ETS_REVERSE
212 #endif //AIRSPEED_ETS_3RD_PARTY_MODE
215 if (airspeed_tmp < 0.0) {
231 #if AIRSPEED_ETS_SYNC_SEND
239 #if AIRSPEED_ETS_SDLOG
242 if (!log_airspeed_ets_started) {
243 sdLogWriteLog(
pprzLogFile,
"AIRSPEED_ETS: raw offset airspeed(m/s) GPS_fix TOW(ms) Week Lat(1e7deg) Lon(1e7deg) HMSL(mm) gpseed(cm/s) course(1e7rad) climb(cm/s)\n");
244 log_airspeed_ets_started =
true;
246 sdLogWriteLog(
pprzLogFile,
"airspeed_ets: %d %d %8.4f %d %d %d %d %d %d %d %d %d\n",
static void stateSetAirspeed_f(float airspeed)
Set airspeed (float).
int32_t lon
in degrees*1e7
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
#define AIRSPEED_ETS_NBSAMPLES_AVRG
uint16_t airspeed_ets_raw
uint32_t tow
GPS time of week in ms.
bool airspeed_ets_delay_done
#define AIRSPEED_ETS_SCALE
uint16_t airspeed_ets_cnt
void airspeed_ets_init(void)
struct NedCoor_i ned_vel
speed NED in cm/s
#define AIRSPEED_ETS_OFFSET_MIN
int32_t lat
in degrees*1e7
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define AIRSPEED_ETS_I2C_DEV
Device independent GPS code (interface)
bool airspeed_ets_offset_init
void airspeed_ets_read_periodic(void)
#define AIRSPEED_ETS_ADDR
#define AIRSPEED_ETS_OFFSET_NBSAMPLES_AVRG
Architecture independent timing functions.
uint16_t gspeed
norm of 2d ground speed in cm/s
#define AIRSPEED_ETS_OFFSET
enum I2CTransactionStatus status
Transaction status.
I2C transaction structure.
Common code for AP and FBW telemetry.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
int32_t course
GPS course over ground in rad*1e7, [0, 2*Pi]*1e7 (CW/north)
int airspeed_ets_buffer_idx
#define AIRSPEED_ETS_START_DELAY
delay in seconds until sensor is read after startup
struct LlaCoor_i lla_pos
position in LLA (lat,lon: deg*1e7; alt: mm over ellipsoid)
volatile bool airspeed_ets_i2c_done
uint32_t airspeed_ets_delay_time
int32_t hmsl
height above mean sea level (MSL) in mm
@ I2CTransDone
transaction set to done by user level
#define AIRSPEED_ETS_OFFSET_MAX
struct i2c_transaction airspeed_ets_i2c_trans
uint16_t airspeed_ets_offset
#define AIRSPEED_ETS_OFFSET_NBSAMPLES_INIT
float airspeed_ets_buffer[AIRSPEED_ETS_NBSAMPLES_AVRG]
#define SysTimeTimerStart(_t)
struct GpsState gps
global GPS state
void airspeed_ets_read_event(void)
bool i2c_receive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint16_t len)
Submit a read only transaction.
uint32_t airspeed_ets_offset_tmp