32 #include "generated/airframe.h"
38 #ifndef SYS_ID_CHIRP_AXES
39 #define SYS_ID_CHIRP_AXES {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW,COMMAND_THRUST}
42 #ifndef SYS_ID_CHIRP_ENABLED
43 #define SYS_ID_CHIRP_ENABLED TRUE
46 #ifndef SYS_ID_CHIRP_USE_NOISE
47 #define SYS_ID_CHIRP_USE_NOISE TRUE
50 #ifdef SYS_ID_CHIRP_RADIO_CHANNEL
52 pprz_t previous_radio_value_chirp = 0;
79 #define SYS_ID_CHIRP_NB_AXES sizeof SYS_ID_ACTIVE_CHIRP_AXES / sizeof SYS_ID_ACTIVE_CHIRP_AXES[0]
96 #if SYS_ID_CHIRP_USE_NOISE
98 float amplitude, noise;
140 #ifdef SYS_ID_CHIRP_RADIO_CHANNEL
194 #if SYS_ID_CHIRP_USE_NOISE
215 #if SYS_ID_CHIRP_ENABLED
217 #ifdef SYS_ID_CHIRP_RADIO_CHANNEL
219 if (previous_radio_value_chirp < 1750)
228 if (previous_radio_value_chirp > 1750)
254 #if SYS_ID_CHIRP_ENABLED
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)
struct RadioControl radio_control
Generic interface for radio control modules.
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
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
#define SYS_ID_CHIRP_AXES
void sys_id_chirp_add_values(bool UNUSED motors_on, bool UNUSED override_on, pprz_t UNUSED in_cmd[])
void sys_id_chirp_activate_handler(uint8_t activate)
void sys_id_chirp_exponential_activate_handler(uint8_t exponential)
void sys_id_chirp_run(void)
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 pprz_t current_chirp_values[SYS_ID_CHIRP_NB_AXES]
static void set_current_chirp_values(void)
static struct FirstOrderLowPass filters[SYS_ID_CHIRP_NB_AXES]
uint8_t sys_id_chirp_running(void)
static const int8_t SYS_ID_ACTIVE_CHIRP_AXES[]
static void start_chirp(void)
#define SYS_ID_CHIRP_NB_AXES
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.