32 #include "generated/airframe.h"
39 #define CHIRP_AXES {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW,COMMAND_THRUST}
43 #define CHIRP_ENABLED TRUE
46 #ifndef CHIRP_USE_NOISE
47 #define CHIRP_USE_NOISE TRUE
74 #define CHIRP_NB_AXES sizeof ACTIVE_CHIRP_AXES / sizeof ACTIVE_CHIRP_AXES[0]
93 float amplitude, noise;
Simple first order low pass filter with bilinear transform.
static float update_first_order_low_pass(struct FirstOrderLowPass *filter, float value)
Update first order low pass filter state with a new value.
static void init_first_order_low_pass(struct FirstOrderLowPass *filter, float tau, float sample_time, float value)
Init first order low pass filter.
First order low pass filter structure.
bool chirp_is_running(struct chirp_t *chirp, float current_time_s)
Return if the current_time is within the chirp manoeuvre.
void chirp_init(struct chirp_t *chirp, float f0_hz, float f1_hz, float length_s, float current_time_s, bool exponential_chirp, bool fade_in)
Allocate and initialize a new chirp struct.
float chirp_update(struct chirp_t *chirp, float current_time_s)
Calculate the value at current_time_s and update the struct with current frequency and value.
void chirp_reset(struct chirp_t *chirp, float current_time_s)
Reset the time of the chirp.
float current_frequency_hz
Initialize with chirp_init.
double rand_gaussian(void)
static const struct usb_device_descriptor dev
void sys_id_chirp_fstart_handler(float fstart)
static struct chirp_t chirp
float chirp_noise_stdv_onaxis_ratio
void sys_id_chirp_activate_handler(uint8_t activate)
void sys_id_chirp_exponential_activate_handler(uint8_t exponential)
static pprz_t current_chirp_values[CHIRP_NB_AXES]
void sys_id_chirp_run(void)
static const int8_t ACTIVE_CHIRP_AXES[]
float chirp_noise_stdv_offaxis
static void stop_chirp(void)
void sys_id_chirp_axis_handler(uint8_t axis)
static void send_chirp(struct transport_tx *trans, struct link_device *dev)
uint8_t chirp_exponential
static struct FirstOrderLowPass filters[CHIRP_NB_AXES]
static void set_current_chirp_values(void)
uint8_t sys_id_chirp_running(void)
static void start_chirp(void)
void sys_id_chirp_add_values(bool motors_on, bool override_on, pprz_t in_cmd[])
void sys_id_chirp_fstop_handler(float fstop)
void sys_id_chirp_init(void)
void sys_id_chirp_fade_in_activate_handler(uint8_t fade_in)
Architecture independent timing functions.
static float get_sys_time_float(void)
Get the time in seconds since startup.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
signed char int8_t
Typedef defining 8 bit char type.