Paparazzi UAS  v6.2.0_stable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 DOUBLET_AXES   {COMMAND_ROLL,COMMAND_PITCH,COMMAND_YAW,COMMAND_THRUST}
 
#define DOUBLET_ENABLED   TRUE
 
#define DOUBLET_NB_AXES   sizeof ACTIVE_DOUBLET_AXES / sizeof 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_mod3211_handler (uint8_t mode)
 
void sys_id_doublet_init (void)
 
void sys_id_doublet_run (void)
 
void sys_id_doublet_add_values (bool motors_on, bool override_on, pprz_t in_cmd[])
 

Variables

static struct doublet_t doublet
 
uint8_t doublet_active = false
 
uint8_t doublet_mode_3211 = false
 
uint8_t doublet_axis = 0
 
pprz_t doublet_amplitude = 4500
 
float doublet_length_s = 20.0f
 
float doublet_extra_waiting_time_s = 0.0f
 
static const int8_t ACTIVE_DOUBLET_AXES [] = DOUBLET_AXES
 
static pprz_t current_doublet_values [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

◆ DOUBLET_AXES

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

Definition at line 44 of file sys_id_doublet.c.

◆ DOUBLET_ENABLED

#define DOUBLET_ENABLED   TRUE

Definition at line 48 of file sys_id_doublet.c.

◆ DOUBLET_NB_AXES

#define DOUBLET_NB_AXES   sizeof ACTIVE_DOUBLET_AXES / sizeof ACTIVE_DOUBLET_AXES[0]

Definition at line 67 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 83 of file sys_id_doublet.c.

References current_doublet_values, dev, doublet_active, doublet_amplitude, doublet_axis, and doublet_mode_3211.

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 89 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 96 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  motors_on,
bool  override_on,
pprz_t  in_cmd[] 
)

◆ sys_id_doublet_axis_handler()

void sys_id_doublet_axis_handler ( uint8_t  axis)

Definition at line 118 of file sys_id_doublet.c.

References doublet_axis, and DOUBLET_NB_AXES.

◆ sys_id_doublet_init()

◆ sys_id_doublet_mod3211_handler()

void sys_id_doublet_mod3211_handler ( uint8_t  mode)

Definition at line 125 of file sys_id_doublet.c.

References doublet_mode_3211, and mode.

◆ sys_id_doublet_run()

void sys_id_doublet_run ( void  )

Definition at line 141 of file sys_id_doublet.c.

References doublet, doublet_active, doublet_is_running(), doublet_update(), get_sys_time_float(), set_current_doublet_values(), and stop_doublet().

+ Here is the call graph for this function:

◆ sys_id_doublet_running()

uint8_t sys_id_doublet_running ( void  )

Definition at line 103 of file sys_id_doublet.c.

References doublet_active.

Variable Documentation

◆ ACTIVE_DOUBLET_AXES

const int8_t ACTIVE_DOUBLET_AXES[] = DOUBLET_AXES
static

Definition at line 66 of file sys_id_doublet.c.

Referenced by sys_id_doublet_add_values().

◆ current_doublet_values

pprz_t current_doublet_values[DOUBLET_NB_AXES]
static

◆ doublet

◆ doublet_active

◆ doublet_amplitude

pprz_t doublet_amplitude = 4500

Definition at line 60 of file sys_id_doublet.c.

Referenced by send_doublet(), and set_current_doublet_values().

◆ doublet_axis

uint8_t doublet_axis = 0

◆ doublet_extra_waiting_time_s

float doublet_extra_waiting_time_s = 0.0f

Definition at line 62 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 = 20.0f

Definition at line 61 of file sys_id_doublet.c.

Referenced by sys_id_doublet_activate_handler(), and sys_id_doublet_init().

◆ doublet_mode_3211