Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
sys_id_doublet.c File Reference
#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"
+ Include dependency graph for sys_id_doublet.c:

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]
 

Detailed Description

Author
Alessandro Collicelli System identification doublet

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.

Macro Definition Documentation

◆ SYS_ID_DOUBLET_AXES

#define SYS_ID_DOUBLET_AXES   {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW,COMMAND_THRUST}

Definition at line 44 of file sys_id_doublet.c.

◆ SYS_ID_DOUBLET_ENABLED

#define SYS_ID_DOUBLET_ENABLED   TRUE

Definition at line 48 of file sys_id_doublet.c.

◆ SYS_ID_DOUBLET_NB_AXES

#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.

Function Documentation

◆ send_doublet()

static void send_doublet ( struct transport_tx *  trans,
struct link_device *  dev 
)
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().

+ Here is the caller graph for this function:

◆ set_current_doublet_values()

static void set_current_doublet_values ( void  )
static

◆ start_doublet()

static void start_doublet ( void  )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop_doublet()

static void stop_doublet ( void  )
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sys_id_doublet_activate_handler()

void sys_id_doublet_activate_handler ( uint8_t  activate)

◆ sys_id_doublet_add_values()

void sys_id_doublet_add_values ( bool UNUSED  motors_on,
bool UNUSED  override_on,
pprz_t UNUSED  in_cmd[] 
)

◆ sys_id_doublet_axis_handler()

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().

+ Here is the caller graph for this function:

◆ sys_id_doublet_init()

◆ sys_id_doublet_mod_handler()

void sys_id_doublet_mod_handler ( uint8_t  mode)

Definition at line 136 of file sys_id_doublet.c.

References doublet_mode, and mode.

◆ sys_id_doublet_run()

void sys_id_doublet_run ( void  )

◆ sys_id_doublet_running()

uint8_t sys_id_doublet_running ( void  )

Definition at line 107 of file sys_id_doublet.c.

References doublet_active.

Variable Documentation

◆ current_doublet_values

◆ doublet

◆ doublet_active

◆ doublet_amplitude

◆ doublet_axis

uint8_t doublet_axis = 0

◆ doublet_extra_waiting_time_s

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().

◆ doublet_length_s

float doublet_length_s = 0.5f

◆ doublet_mode

◆ SYS_ID_ACTIVE_DOUBLET_AXES

const int8_t SYS_ID_ACTIVE_DOUBLET_AXES[] = SYS_ID_DOUBLET_AXES
static

Definition at line 70 of file sys_id_doublet.c.

Referenced by sys_id_doublet_add_values().