Paparazzi UAS  v5.17_devel-24-g2ae834f
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
sys_id_chirp.c File Reference
#include "std.h"
#include "sys_id_chirp.h"
#include "pprz_chirp.h"
#include "subsystems/datalink/telemetry.h"
#include "generated/airframe.h"
#include "mcu_periph/sys_time.h"
#include "filters/low_pass_filter.h"
#include "math/pprz_random.h"
+ Include dependency graph for sys_id_chirp.c:

Go to the source code of this file.

Macros

#define CHIRP_AXES   {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW}
 
#define CHIRP_ENABLED   TRUE
 
#define CHIRP_USE_NOISE   TRUE
 
#define CHIRP_EXPONENTIAL   TRUE
 
#define CHIRP_FADEIN   TRUE
 
#define CHIRP_NB_AXES   sizeof ACTIVE_CHIRP_AXES / sizeof ACTIVE_CHIRP_AXES[0]
 

Functions

static void set_current_chirp_values (void)
 
static void send_chirp (struct transport_tx *trans, struct link_device *dev)
 
static void start_chirp (void)
 
static void stop_chirp (void)
 
void sys_id_chirp_activate_handler (uint8_t activate)
 
void sys_id_chirp_axis_handler (uint8_t axis)
 
void sys_id_chirp_fstart_handler (float fstart)
 
void sys_id_chirp_fstop_handler (float fstop)
 
void sys_id_chirp_init (void)
 
void sys_id_chirp_run (void)
 
void sys_id_chirp_add_values (bool motors_on, bool override_on, pprz_t in_cmd[])
 

Variables

static struct chirp_t chirp
 
uint8_t chirp_active = false
 
uint8_t chirp_axis = 0
 
pprz_t chirp_amplitude = 0
 
float chirp_noise_stdv_onaxis_ratio = 0.1
 
float chirp_noise_stdv_offaxis = 200
 
float chirp_fstart_hz = 1.0f
 
float chirp_fstop_hz = 5.0f
 
float chirp_length_s = 20
 
static const int8_t ACTIVE_CHIRP_AXES [] = CHIRP_AXES
 
static struct FirstOrderLowPass filters [CHIRP_NB_AXES]
 
static pprz_t current_chirp_values [CHIRP_NB_AXES]
 

Detailed Description

Author
Joost Meulenbeld System identification chirp

Definition in file sys_id_chirp.c.

Macro Definition Documentation

#define CHIRP_AXES   {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW}

Definition at line 39 of file sys_id_chirp.c.

#define CHIRP_ENABLED   TRUE

Definition at line 43 of file sys_id_chirp.c.

#define CHIRP_EXPONENTIAL   TRUE

Definition at line 51 of file sys_id_chirp.c.

Referenced by sys_id_chirp_activate_handler(), and sys_id_chirp_init().

#define CHIRP_FADEIN   TRUE

Definition at line 55 of file sys_id_chirp.c.

Referenced by sys_id_chirp_activate_handler(), and sys_id_chirp_init().

#define CHIRP_NB_AXES   sizeof ACTIVE_CHIRP_AXES / sizeof ACTIVE_CHIRP_AXES[0]
#define CHIRP_USE_NOISE   TRUE

Definition at line 47 of file sys_id_chirp.c.

Function Documentation

static void send_chirp ( struct transport_tx *  trans,
struct link_device *  dev 
)
static
static void set_current_chirp_values ( void  )
static
static void start_chirp ( void  )
static

Definition at line 108 of file sys_id_chirp.c.

References chirp, chirp_active, chirp_reset(), get_sys_time_float(), and set_current_chirp_values().

Referenced by sys_id_chirp_activate_handler().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void stop_chirp ( void  )
static

Definition at line 115 of file sys_id_chirp.c.

References chirp, chirp_active, chirp_reset(), get_sys_time_float(), and set_current_chirp_values().

Referenced by sys_id_chirp_activate_handler(), and sys_id_chirp_run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void sys_id_chirp_activate_handler ( uint8_t  activate)

Definition at line 122 of file sys_id_chirp.c.

References chirp, chirp_active, CHIRP_EXPONENTIAL, CHIRP_FADEIN, chirp_fstart_hz, chirp_fstop_hz, chirp_init(), chirp_length_s, get_sys_time_float(), start_chirp(), and stop_chirp().

+ Here is the call graph for this function:

void sys_id_chirp_add_values ( bool  motors_on,
bool  override_on,
pprz_t  in_cmd[] 
)

Definition at line 194 of file sys_id_chirp.c.

References ACTIVE_CHIRP_AXES, CHIRP_NB_AXES, current_chirp_values, and MAX_PPRZ.

void sys_id_chirp_axis_handler ( uint8_t  axis)

Definition at line 134 of file sys_id_chirp.c.

References chirp_axis, and CHIRP_NB_AXES.

void sys_id_chirp_fstart_handler ( float  fstart)

Definition at line 141 of file sys_id_chirp.c.

References chirp_fstart_hz, and chirp_fstop_hz.

void sys_id_chirp_fstop_handler ( float  fstop)

Definition at line 148 of file sys_id_chirp.c.

References chirp_fstart_hz, and chirp_fstop_hz.

void sys_id_chirp_run ( void  )

Definition at line 178 of file sys_id_chirp.c.

References chirp, chirp_active, chirp_is_running(), chirp_update(), get_sys_time_float(), set_current_chirp_values(), and stop_chirp().

+ Here is the call graph for this function:

Variable Documentation

const int8_t ACTIVE_CHIRP_AXES[] = CHIRP_AXES
static

Definition at line 70 of file sys_id_chirp.c.

Referenced by sys_id_chirp_add_values().

pprz_t chirp_amplitude = 0

Definition at line 62 of file sys_id_chirp.c.

Referenced by send_chirp(), and set_current_chirp_values().

uint8_t chirp_axis = 0

Definition at line 61 of file sys_id_chirp.c.

Referenced by send_chirp(), set_current_chirp_values(), and sys_id_chirp_axis_handler().

float chirp_length_s = 20

Definition at line 67 of file sys_id_chirp.c.

Referenced by sys_id_chirp_activate_handler(), and sys_id_chirp_init().

float chirp_noise_stdv_offaxis = 200

Definition at line 64 of file sys_id_chirp.c.

Referenced by send_chirp(), and set_current_chirp_values().

float chirp_noise_stdv_onaxis_ratio = 0.1

Definition at line 63 of file sys_id_chirp.c.

Referenced by send_chirp(), and set_current_chirp_values().

pprz_t current_chirp_values[CHIRP_NB_AXES]
static
struct FirstOrderLowPass filters[CHIRP_NB_AXES]
static

Definition at line 74 of file sys_id_chirp.c.

Referenced by set_current_chirp_values(), and sys_id_chirp_init().