Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
wind_estimation_quadrotor.c File Reference
#include "modules/meteo/wind_estimation_quadrotor.h"
#include "filters/linear_kalman_filter.h"
#include "math/pprz_isa.h"
#include "state.h"
#include "generated/airframe.h"
#include "modules/datalink/downlink.h"
#include "generated/modules.h"
#include "modules/core/abi.h"
#include "mcu_periph/sys_time.h"
#include "modules/air_data/air_data.h"
#include "modules/datalink/telemetry.h"
Include dependency graph for wind_estimation_quadrotor.c:

Go to the source code of this file.

Data Structures

struct  wind_estimation_quadrotor

Macros

#define WE_QUAD_STATUS_IDLE   0
#define WE_QUAD_STATUS_RUN   1
#define WE_QUAD_STATE_SIZE   4
#define WE_QUAD_CMD_SIZE   2
#define WE_QUAD_MEAS_SIZE   2
#define WE_QUAD_VA_X   0
#define WE_QUAD_W_X   1
#define WE_QUAD_VA_Y   2
#define WE_QUAD_W_Y   3
#define WE_QUAD_P0_VA   1.f
#define WE_QUAD_P0_W   1.f
#define WE_QUAD_Q_VA   .05f
#define WE_QUAD_Q_W   .001f
#define WE_QUAD_R   .5f
#define WE_QUAD_UPDATE_STATE   TRUE

Functions

static void send_wind (struct transport_tx *trans, struct link_device *dev)
static void wind_estimation_quadrotor_reset (void)
void wind_estimation_quadrotor_init (void)
void wind_estimation_quadrotor_periodic (void)
void wind_estimation_quadrotor_stop (void)
void wind_estimation_quadrotor_start (void)
float wind_estimation_quadrotor_SetQva (float Q_va)
float wind_estimation_quadrotor_SetQw (float Q_w)
float wind_estimation_quadrotor_SetR (float R)
void wind_estimation_quadrotor_report (void)

Variables

static const float we_dt = WIND_ESTIMATION_QUADROTOR_PERIODIC_PERIOD
static struct wind_estimation_quadrotor we_quad
struct wind_estimation_quadrotor_params we_quad_params

Detailed Description

Author
Gautier Hattenberger gauti.nosp@m.er.h.nosp@m.atten.nosp@m.berg.nosp@m.er@en.nosp@m.ac.f.nosp@m.r Wind estimation from quadrotor motion

Definition in file wind_estimation_quadrotor.c.


Data Structure Documentation

◆ wind_estimation_quadrotor

struct wind_estimation_quadrotor

Definition at line 82 of file wind_estimation_quadrotor.c.

Collaboration diagram for wind_estimation_quadrotor:
Data Fields
struct linear_kalman_filter filter
uint8_t status

Macro Definition Documentation

◆ WE_QUAD_CMD_SIZE

#define WE_QUAD_CMD_SIZE   2

◆ WE_QUAD_MEAS_SIZE

#define WE_QUAD_MEAS_SIZE   2

◆ WE_QUAD_P0_VA

#define WE_QUAD_P0_VA   1.f

Definition at line 54 of file wind_estimation_quadrotor.c.

Referenced by wind_estimation_quadrotor_reset().

◆ WE_QUAD_P0_W

#define WE_QUAD_P0_W   1.f

Definition at line 58 of file wind_estimation_quadrotor.c.

Referenced by wind_estimation_quadrotor_reset().

◆ WE_QUAD_Q_VA

#define WE_QUAD_Q_VA   .05f

Definition at line 62 of file wind_estimation_quadrotor.c.

Referenced by wind_estimation_quadrotor_init().

◆ WE_QUAD_Q_W

#define WE_QUAD_Q_W   .001f

Definition at line 66 of file wind_estimation_quadrotor.c.

Referenced by wind_estimation_quadrotor_init().

◆ WE_QUAD_R

#define WE_QUAD_R   .5f

Definition at line 70 of file wind_estimation_quadrotor.c.

Referenced by wind_estimation_quadrotor_init().

◆ WE_QUAD_STATE_SIZE

#define WE_QUAD_STATE_SIZE   4

◆ WE_QUAD_STATUS_IDLE

#define WE_QUAD_STATUS_IDLE   0

◆ WE_QUAD_STATUS_RUN

#define WE_QUAD_STATUS_RUN   1

Definition at line 42 of file wind_estimation_quadrotor.c.

Referenced by wind_estimation_quadrotor_start().

◆ WE_QUAD_UPDATE_STATE

#define WE_QUAD_UPDATE_STATE   TRUE

Definition at line 75 of file wind_estimation_quadrotor.c.

◆ WE_QUAD_VA_X

#define WE_QUAD_VA_X   0

Definition at line 48 of file wind_estimation_quadrotor.c.

Referenced by send_wind(), and wind_estimation_quadrotor_periodic().

◆ WE_QUAD_VA_Y

#define WE_QUAD_VA_Y   2

Definition at line 50 of file wind_estimation_quadrotor.c.

Referenced by send_wind(), and wind_estimation_quadrotor_periodic().

◆ WE_QUAD_W_X

#define WE_QUAD_W_X   1

Definition at line 49 of file wind_estimation_quadrotor.c.

Referenced by send_wind(), and wind_estimation_quadrotor_periodic().

◆ WE_QUAD_W_Y

#define WE_QUAD_W_Y   3

Definition at line 51 of file wind_estimation_quadrotor.c.

Referenced by send_wind(), and wind_estimation_quadrotor_periodic().

Function Documentation

◆ send_wind()

void send_wind ( struct transport_tx * trans,
struct link_device * dev )
static

Definition at line 214 of file wind_estimation_quadrotor.c.

References dev, float_vect2_norm(), we_quad, WE_QUAD_VA_X, WE_QUAD_VA_Y, WE_QUAD_W_X, and WE_QUAD_W_Y.

Here is the call graph for this function:

◆ wind_estimation_quadrotor_init()

◆ wind_estimation_quadrotor_periodic()

◆ wind_estimation_quadrotor_report()

void wind_estimation_quadrotor_report ( void )

◆ wind_estimation_quadrotor_reset()

void wind_estimation_quadrotor_reset ( void )
static

Definition at line 90 of file wind_estimation_quadrotor.c.

References float_vect_zero(), we_quad, WE_QUAD_P0_VA, WE_QUAD_P0_W, and WE_QUAD_STATE_SIZE.

Referenced by wind_estimation_quadrotor_init(), and wind_estimation_quadrotor_start().

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

◆ wind_estimation_quadrotor_SetQva()

float wind_estimation_quadrotor_SetQva ( float Q_va)

Definition at line 185 of file wind_estimation_quadrotor.c.

References we_quad, and we_quad_params.

◆ wind_estimation_quadrotor_SetQw()

float wind_estimation_quadrotor_SetQw ( float Q_w)

Definition at line 193 of file wind_estimation_quadrotor.c.

References we_quad, and we_quad_params.

◆ wind_estimation_quadrotor_SetR()

float wind_estimation_quadrotor_SetR ( float R)

Definition at line 201 of file wind_estimation_quadrotor.c.

References we_quad, and we_quad_params.

◆ wind_estimation_quadrotor_start()

void wind_estimation_quadrotor_start ( void )

Definition at line 179 of file wind_estimation_quadrotor.c.

References we_quad, WE_QUAD_STATUS_RUN, and wind_estimation_quadrotor_reset().

Here is the call graph for this function:

◆ wind_estimation_quadrotor_stop()

void wind_estimation_quadrotor_stop ( void )

Definition at line 170 of file wind_estimation_quadrotor.c.

References stateSetHorizontalWindspeed_f(), we_quad, and WE_QUAD_STATUS_IDLE.

Here is the call graph for this function:

Variable Documentation

◆ we_dt

const float we_dt = WIND_ESTIMATION_QUADROTOR_PERIODIC_PERIOD
static

Definition at line 78 of file wind_estimation_quadrotor.c.

Referenced by wind_estimation_quadrotor_init().

◆ we_quad

◆ we_quad_params