29#include "navigation.h"
32#include "generated/modules.h"
37#ifndef AIRSPEED_CONSISTENCY_MIN_SAMPLES
38#define AIRSPEED_CONSISTENCY_MIN_SAMPLES 20
41#ifndef AIRSPEED_CONSISTENCY_INTERVAL
42#define AIRSPEED_CONSISTENCY_INTERVAL 10
45#if AIRSPEED_CONSISTENCY_BUFFER_SIZE < AIRSPEED_CONSISTENCY_MIN_SAMPLES
46#error "AIRSPEED_CONSISTENCY_BUFFER_SIZE must be larger than or equal to AIRSPEED_CONSISTENCY_MIN_SAMPLES"
49#if AIRSPEED_CONSISTENCY_BUFFER_SIZE > UINT16_MAX
50#error "AIRSPEED_CONSISTENCY_BUFFER_SIZE must be less than or equal to UINT16_MAX"
64 float tau = 1.0 / (2.0 * M_PI);
94 int rc = snprintf(error_msg,
sizeof(error_msg),
"ASC: ratio squared = %.4f",
asc.ratio);
96#if FLIGHTRECORDER_SDLOG
97 pprz_msg_send_INFO_MSG(&
pprzlog_tp.trans_tx, &flightrecorder_sdlog.device, AC_ID, rc, error_msg);
Main include for ABI (AirBorneInterface).
struct AirData air_data
global AirData state Statically initialized, the persistent settings are loaded before air_data_init(...
#define AIRSPEED_CONSISTENCY_INTERVAL
static void save_speeds(void)
static enum CircFitStatus_t get_circle_from_speeds(struct circle_t *c, float *N, float *E)
#define AIRSPEED_CONSISTENCY_MIN_SAMPLES
void airspeed_consistency_init(void)
static Butterworth2LowPass tas_filt
void airspeed_consistency_reset(bool reset)
void airspeed_consistency_periodic(void)
static void reset_speeds(void)
#define AIRSPEED_CONSISTENCY_BUFFER_SIZE
static float float_vect2_norm(const struct FloatVect2 *v)
#define VECT2_DIFF(_c, _a, _b)
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
Simple first order low pass filter with bilinear transform.
struct SecondOrderLowPass Butterworth2LowPass
Second order Butterworth low pass filter.
static void init_butterworth_2_low_pass(Butterworth2LowPass *filter, const float tau, const float sample_time, const float value)
Init a second order Butterworth filter.
static float update_butterworth_2_low_pass(Butterworth2LowPass *filter, const float value)
Update second order Butterworth low pass filter state with a new value.
#define NAVIGATION_FREQUENCY
Default fixedwing navigation frequency.
struct NavBase_t nav_rotorcraft_base
Basic Nav struct.
enum CircFitStatus_t pprz_circfit_wei_float(struct circle_t *c, const float *x, const float *y, uint16_t n, struct circle_t *g)
struct pprzlog_transport pprzlog_tp
PPRZLOG transport structure.
struct RotorcraftNavigation nav
#define NAV_HORIZONTAL_MODE_CIRCLE
#define ARRIVED_AT_WAYPOINT
minimum horizontal distance to waypoint to mark as arrived
API to get/set the generic vehicle states.
Periodic telemetry system header (includes downlink utility and generated code).
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.