|  | Paparazzi UAS v7.0_unstable
    Paparazzi is a free software Unmanned Aircraft System. | 
#include "std.h"#include "math.h"#include "pprz_wave.h"#include "sys_id_wave.h"#include "modules/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_wave.c:
 Include dependency graph for sys_id_wave.c:Go to the source code of this file.
| Macros | |
| #define | WAVE_AXES {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW,COMMAND_THRUST} | 
| #define | WAVE_ENABLED TRUE | 
| #define | WAVE_NB_AXES sizeof ACTIVE_WAVE_AXES / sizeof ACTIVE_WAVE_AXES[0] | 
| Functions | |
| static void | set_current_wave_values (void) | 
| static void | send_wave (struct transport_tx *trans, struct link_device *dev) | 
| static void | start_wave (void) | 
| static void | stop_wave (void) | 
| void | sys_id_wave_activate_handler (uint8_t activate) | 
| void | sys_id_wave_axis_handler (uint8_t axis) | 
| uint8_t | sys_id_wave_running (void) | 
| void | sys_id_wave_frequency_hz_set (float frequency_hz_set) | 
| void | sys_id_wave_lag_rad_set (float lag_rad_set) | 
| void | sys_id_wave_init (void) | 
| void | sys_id_wave_run (void) | 
| void | sys_id_wave_add_values (bool motors_on, bool override_on, pprz_t in_cmd[]) | 
| Variables | |
| static struct wave_t | wave_s | 
| uint8_t | wave_active = false | 
| uint8_t | wave_axis = 0 | 
| pprz_t | wave_amplitude = 0 | 
| float | frequency_hz_ = 0.0f | 
| float | lag_rad_ = 0.0f | 
| static const int8_t | ACTIVE_WAVE_AXES [] = WAVE_AXES | 
| static pprz_t | current_wave_values [WAVE_NB_AXES] | 
This is the module implementation for the a sine wave input. Use sys_id_wave by adding the module to your airframe file and adding the following line to the top of the <command_laws> section of your airframe file:
<call fun="sys_id_wave_add_values(autopilot_get_motors_on(),FALSE,values)">
In the GCS you can then start and stop the wave, change wave frequency. Documentation of the specific options can be found in the module xml file.
Definition in file sys_id_wave.c.
| #define WAVE_AXES {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW,COMMAND_THRUST} | 
Definition at line 47 of file sys_id_wave.c.
Definition at line 51 of file sys_id_wave.c.
| #define WAVE_NB_AXES sizeof ACTIVE_WAVE_AXES / sizeof ACTIVE_WAVE_AXES[0] | 
Definition at line 64 of file sys_id_wave.c.
| 
 | static | 
Definition at line 81 of file sys_id_wave.c.
References current_wave_values, dev, foo, wave_t::frequency_hz, wave_t::lag_rad, wave_active, wave_amplitude, wave_axis, and wave_s.
Referenced by sys_id_wave_init().
 Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 69 of file sys_id_wave.c.
References wave_t::current_value, current_wave_values, wave_t::is_running, wave_active, wave_amplitude, wave_axis, WAVE_NB_AXES, and wave_s.
Referenced by start_wave(), stop_wave(), sys_id_wave_init(), and sys_id_wave_run().
 Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 86 of file sys_id_wave.c.
References get_sys_time_float(), set_current_wave_values(), wave_active, wave_reset(), and wave_s.
Referenced by sys_id_wave_activate_handler().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 93 of file sys_id_wave.c.
References get_sys_time_float(), set_current_wave_values(), wave_active, wave_reset(), and wave_s.
Referenced by sys_id_wave_activate_handler(), and sys_id_wave_run().
 Here is the call graph for this function:
 Here is the call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:Definition at line 100 of file sys_id_wave.c.
References foo, frequency_hz_, get_sys_time_float(), lag_rad_, start_wave(), stop_wave(), wave_active, wave_init(), and wave_s.
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 159 of file sys_id_wave.c.
References ACTIVE_WAVE_AXES, current_wave_values, foo, MAX_PPRZ, and WAVE_NB_AXES.
Definition at line 110 of file sys_id_wave.c.
References foo, wave_axis, and WAVE_NB_AXES.
Definition at line 123 of file sys_id_wave.c.
References foo, frequency_hz_, get_sys_time_float(), lag_rad_, wave_init(), and wave_s.
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 136 of file sys_id_wave.c.
References DefaultPeriodic, foo, frequency_hz_, get_sys_time_float(), lag_rad_, register_periodic_telemetry(), send_wave(), set_current_wave_values(), wave_init(), and wave_s.
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 129 of file sys_id_wave.c.
References foo, frequency_hz_, get_sys_time_float(), lag_rad_, wave_init(), and wave_s.
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 144 of file sys_id_wave.c.
References get_sys_time_float(), set_current_wave_values(), stop_wave(), wave_active, wave_is_running(), wave_s, and wave_update().
 Here is the call graph for this function:
 Here is the call graph for this function:Definition at line 118 of file sys_id_wave.c.
References wave_active.
Definition at line 63 of file sys_id_wave.c.
Referenced by sys_id_wave_add_values().
| 
 | static | 
Definition at line 67 of file sys_id_wave.c.
Referenced by send_wave(), set_current_wave_values(), and sys_id_wave_add_values().
| float frequency_hz_ = 0.0f | 
Definition at line 60 of file sys_id_wave.c.
Referenced by sys_id_wave_activate_handler(), sys_id_wave_frequency_hz_set(), sys_id_wave_init(), and sys_id_wave_lag_rad_set().
| float lag_rad_ = 0.0f | 
Definition at line 61 of file sys_id_wave.c.
Referenced by sys_id_wave_activate_handler(), sys_id_wave_frequency_hz_set(), sys_id_wave_init(), and sys_id_wave_lag_rad_set().
Definition at line 57 of file sys_id_wave.c.
Referenced by send_wave(), set_current_wave_values(), start_wave(), stop_wave(), sys_id_wave_activate_handler(), sys_id_wave_run(), and sys_id_wave_running().
| pprz_t wave_amplitude = 0 | 
Definition at line 59 of file sys_id_wave.c.
Referenced by send_wave(), and set_current_wave_values().
| uint8_t wave_axis = 0 | 
Definition at line 58 of file sys_id_wave.c.
Referenced by send_wave(), set_current_wave_values(), and sys_id_wave_axis_handler().
| 
 | static | 
Definition at line 56 of file sys_id_wave.c.
Referenced by send_wave(), set_current_wave_values(), start_wave(), stop_wave(), sys_id_wave_activate_handler(), sys_id_wave_frequency_hz_set(), sys_id_wave_init(), sys_id_wave_lag_rad_set(), and sys_id_wave_run().