Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "std.h"
#include "sys_id_doublet.h"
#include "pprz_doublet.h"
#include "modules/datalink/telemetry.h"
#include "generated/airframe.h"
#include "mcu_periph/sys_time.h"
Go to the source code of this file.
Macros | |
#define | SYS_ID_DOUBLET_AXES {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW,COMMAND_THRUST} |
#define | SYS_ID_DOUBLET_ENABLED TRUE |
#define | SYS_ID_DOUBLET_NB_AXES sizeof SYS_ID_ACTIVE_DOUBLET_AXES / sizeof SYS_ID_ACTIVE_DOUBLET_AXES[0] |
Functions | |
static void | set_current_doublet_values (void) |
static void | send_doublet (struct transport_tx *trans, struct link_device *dev) |
static void | start_doublet (void) |
static void | stop_doublet (void) |
uint8_t | sys_id_doublet_running (void) |
void | sys_id_doublet_activate_handler (uint8_t activate) |
void | sys_id_doublet_axis_handler (uint8_t axis) |
void | sys_id_doublet_mod_handler (uint8_t mode) |
void | sys_id_doublet_init (void) |
void | sys_id_doublet_run (void) |
void | sys_id_doublet_add_values (bool UNUSED motors_on, bool UNUSED override_on, pprz_t UNUSED in_cmd[]) |
Variables | |
static struct doublet_t | doublet |
uint8_t | doublet_active = false |
uint8_t | doublet_mode = 0 |
uint8_t | doublet_axis = 0 |
pprz_t | doublet_amplitude = 0 |
float | doublet_length_s = 0.5f |
float | doublet_extra_waiting_time_s = 0.0f |
static const int8_t | SYS_ID_ACTIVE_DOUBLET_AXES [] = SYS_ID_DOUBLET_AXES |
static pprz_t | current_doublet_values [SYS_ID_DOUBLET_NB_AXES] |
This is the module implementation for the doublet maneuver. Use sys_id_chirp 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_doublet_add_values(autopilot_get_motors_on(),FALSE,values)">
In the GCS you can then start and stop the doublet, change type of doublet maneuvre. Documentation of the specific options can be found in the module xml file.
Definition in file sys_id_doublet.c.
#define SYS_ID_DOUBLET_AXES {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW,COMMAND_THRUST} |
Definition at line 44 of file sys_id_doublet.c.
#define SYS_ID_DOUBLET_ENABLED TRUE |
Definition at line 48 of file sys_id_doublet.c.
#define SYS_ID_DOUBLET_NB_AXES sizeof SYS_ID_ACTIVE_DOUBLET_AXES / sizeof SYS_ID_ACTIVE_DOUBLET_AXES[0] |
Definition at line 71 of file sys_id_doublet.c.
|
static |
Definition at line 87 of file sys_id_doublet.c.
References current_doublet_values, dev, doublet_active, doublet_amplitude, doublet_axis, and doublet_mode.
Referenced by sys_id_doublet_init().
|
static |
Definition at line 75 of file sys_id_doublet.c.
References current_doublet_values, doublet_t::current_value, doublet, doublet_active, doublet_amplitude, doublet_axis, and SYS_ID_DOUBLET_NB_AXES.
Referenced by start_doublet(), stop_doublet(), sys_id_doublet_init(), and sys_id_doublet_run().
|
static |
Definition at line 93 of file sys_id_doublet.c.
References doublet, doublet_active, doublet_reset(), get_sys_time_float(), and set_current_doublet_values().
Referenced by sys_id_doublet_activate_handler().
|
static |
Definition at line 100 of file sys_id_doublet.c.
References doublet, doublet_active, doublet_reset(), get_sys_time_float(), and set_current_doublet_values().
Referenced by sys_id_doublet_activate_handler(), and sys_id_doublet_run().
void sys_id_doublet_activate_handler | ( | uint8_t | activate | ) |
Definition at line 111 of file sys_id_doublet.c.
References doublet, doublet_active, doublet_extra_waiting_time_s, doublet_init(), doublet_length_s, doublet_mode, get_sys_time_float(), radio_control, start_doublet(), stop_doublet(), and RadioControl::values.
Referenced by perform_sys_id_auto_doublets(), sys_id_auto_doublets_on_deactivation(), and sys_id_doublet_run().
void sys_id_doublet_add_values | ( | bool UNUSED | motors_on, |
bool UNUSED | override_on, | ||
pprz_t UNUSED | in_cmd[] | ||
) |
Definition at line 187 of file sys_id_doublet.c.
References current_doublet_values, MAX_PPRZ, SYS_ID_ACTIVE_DOUBLET_AXES, and SYS_ID_DOUBLET_NB_AXES.
void sys_id_doublet_axis_handler | ( | uint8_t | axis | ) |
Definition at line 129 of file sys_id_doublet.c.
References doublet_axis, and SYS_ID_DOUBLET_NB_AXES.
Referenced by perform_sys_id_auto_doublets().
void sys_id_doublet_init | ( | void | ) |
Definition at line 140 of file sys_id_doublet.c.
References current_doublet_values, DefaultPeriodic, doublet, doublet_extra_waiting_time_s, doublet_init(), doublet_length_s, doublet_mode, get_sys_time_float(), register_periodic_telemetry(), send_doublet(), set_current_doublet_values(), and SYS_ID_DOUBLET_NB_AXES.
void sys_id_doublet_mod_handler | ( | uint8_t | mode | ) |
Definition at line 136 of file sys_id_doublet.c.
References doublet_mode, and mode.
void sys_id_doublet_run | ( | void | ) |
Definition at line 152 of file sys_id_doublet.c.
References doublet, doublet_active, doublet_is_running(), doublet_update(), get_sys_time_float(), radio_control, set_current_doublet_values(), stop_doublet(), sys_id_doublet_activate_handler(), and RadioControl::values.
uint8_t sys_id_doublet_running | ( | void | ) |
Definition at line 107 of file sys_id_doublet.c.
References doublet_active.
|
static |
Definition at line 73 of file sys_id_doublet.c.
Referenced by send_doublet(), set_current_doublet_values(), sys_id_doublet_add_values(), and sys_id_doublet_init().
|
static |
Definition at line 1 of file sys_id_doublet.c.
Referenced by doublet_init(), doublet_is_running(), doublet_reset(), doublet_update(), set_current_doublet_values(), start_doublet(), stop_doublet(), sys_id_doublet_activate_handler(), sys_id_doublet_init(), and sys_id_doublet_run().
Definition at line 59 of file sys_id_doublet.c.
Referenced by send_doublet(), set_current_doublet_values(), start_doublet(), stop_doublet(), sys_id_doublet_activate_handler(), sys_id_doublet_run(), and sys_id_doublet_running().
pprz_t doublet_amplitude = 0 |
Definition at line 64 of file sys_id_doublet.c.
Referenced by perform_sys_id_auto_doublets(), send_doublet(), set_current_doublet_values(), and sys_id_auto_doublets_on_deactivation().
uint8_t doublet_axis = 0 |
Definition at line 62 of file sys_id_doublet.c.
Referenced by send_doublet(), set_current_doublet_values(), and sys_id_doublet_axis_handler().
float doublet_extra_waiting_time_s = 0.0f |
Definition at line 66 of file sys_id_doublet.c.
Referenced by sys_id_doublet_activate_handler(), and sys_id_doublet_init().
float doublet_length_s = 0.5f |
Definition at line 65 of file sys_id_doublet.c.
Referenced by perform_sys_id_auto_doublets(), sys_id_doublet_activate_handler(), and sys_id_doublet_init().
uint8_t doublet_mode = 0 |
Definition at line 60 of file sys_id_doublet.c.
Referenced by send_doublet(), sys_id_doublet_activate_handler(), sys_id_doublet_init(), and sys_id_doublet_mod_handler().
|
static |
Definition at line 70 of file sys_id_doublet.c.
Referenced by sys_id_doublet_add_values().