Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
airspeed_consistency.c File Reference
#include <stdio.h>
#include "modules/checks/airspeed_consistency.h"
#include "navigation.h"
#include "state.h"
#include "filters/low_pass_filter.h"
#include "generated/modules.h"
#include "modules/core/abi.h"
#include "modules/datalink/telemetry.h"
#include "modules/nav/nav_rotorcraft_base.h"
Include dependency graph for airspeed_consistency.c:

Go to the source code of this file.

Macros

#define AIRSPEED_CONSISTENCY_MIN_SAMPLES   20
#define AIRSPEED_CONSISTENCY_INTERVAL   10

Functions

static void save_speeds (void)
static void reset_speeds (void)
static enum CircFitStatus_t get_circle_from_speeds (struct circle_t *c, float *N, float *E)
void airspeed_consistency_init (void)
void airspeed_consistency_periodic (void)
void airspeed_consistency_reset (bool reset)

Variables

bool asc_reset = false
static struct asc_t asc = {0}
static Butterworth2LowPass tas_filt

Detailed Description

Author
Noah Wechtler noahw.nosp@m.echt.nosp@m.ler@t.nosp@m.udel.nosp@m.ft.nl Simple consistency check for airspeed measurements while flying circles

Definition in file airspeed_consistency.c.

Macro Definition Documentation

◆ AIRSPEED_CONSISTENCY_INTERVAL

#define AIRSPEED_CONSISTENCY_INTERVAL   10

Definition at line 42 of file airspeed_consistency.c.

Referenced by airspeed_consistency_periodic().

◆ AIRSPEED_CONSISTENCY_MIN_SAMPLES

#define AIRSPEED_CONSISTENCY_MIN_SAMPLES   20

Definition at line 38 of file airspeed_consistency.c.

Referenced by airspeed_consistency_periodic().

Function Documentation

◆ airspeed_consistency_init()

void airspeed_consistency_init ( void )

Definition at line 62 of file airspeed_consistency.c.

References init_butterworth_2_low_pass(), NAVIGATION_FREQUENCY, reset_speeds(), and tas_filt.

Here is the call graph for this function:

◆ airspeed_consistency_periodic()

◆ airspeed_consistency_reset()

void airspeed_consistency_reset ( bool reset)

Definition at line 139 of file airspeed_consistency.c.

References reset, and reset_speeds().

Here is the call graph for this function:

◆ get_circle_from_speeds()

enum CircFitStatus_t get_circle_from_speeds ( struct circle_t * c,
float * N,
float * E )
static

Definition at line 133 of file airspeed_consistency.c.

References AIRSPEED_CONSISTENCY_BUFFER_SIZE, asc, N, pprz_circfit_wei_float(), and status.

Referenced by airspeed_consistency_periodic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_speeds()

void reset_speeds ( void )
static

Definition at line 119 of file airspeed_consistency.c.

References AIRSPEED_CONSISTENCY_BUFFER_SIZE, asc, and CIRC_FIT_ERROR.

Referenced by airspeed_consistency_init(), airspeed_consistency_periodic(), and airspeed_consistency_reset().

Here is the caller graph for this function:

◆ save_speeds()

void save_speeds ( void )
static

Definition at line 103 of file airspeed_consistency.c.

References air_data, AIRSPEED_CONSISTENCY_BUFFER_SIZE, asc, FloatEulers::psi, stateGetNedToBodyEulers_f(), stateGetSpeedNed_f(), tas_filt, update_butterworth_2_low_pass(), NedCoor_f::x, and NedCoor_f::y.

Referenced by airspeed_consistency_periodic().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ asc

struct asc_t asc = {0}
static

◆ asc_reset

bool asc_reset = false

Definition at line 53 of file airspeed_consistency.c.

◆ tas_filt

Butterworth2LowPass tas_filt
static

Definition at line 60 of file airspeed_consistency.c.

Referenced by airspeed_consistency_init(), and save_speeds().