Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
stabilization_indi.h File Reference
+ Include dependency graph for stabilization_indi.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Indi_gains
 

Macros

#define INDI_G_SCALING   1000.0
 

Functions

void stabilization_indi_init (void)
 Function that initializes important values upon engaging INDI. More...
 
void stabilization_indi_enter (void)
 Function that resets important values upon engaging INDI. More...
 
void stabilization_indi_set_failsafe_setpoint (void)
 Function that calculates the failsafe setpoint. More...
 
void stabilization_indi_set_rpy_setpoint_i (struct Int32Eulers *rpy)
 Set attitude quaternion setpoint from rpy. More...
 
void stabilization_indi_set_quat_setpoint_i (struct Int32Quat *quat)
 
void stabilization_indi_set_earth_cmd_i (struct Int32Vect2 *cmd, int32_t heading)
 Set attitude setpoint from command in earth axes. More...
 
void stabilization_indi_set_stab_sp (struct StabilizationSetpoint *sp)
 Set attitude setpoint from stabilization setpoint struct. More...
 
void stabilization_indi_rate_run (struct FloatRates rate_ref, bool in_flight)
 Does the INDI calculations. More...
 
void stabilization_indi_set_wls_settings (void)
 Function that sets the du_min, du_max and du_pref if function not elsewhere defined. More...
 
void stabilization_indi_attitude_run (struct Int32Quat quat_sp, bool in_flight)
 runs stabilization indi More...
 
void stabilization_indi_read_rc (bool in_flight, bool in_carefree, bool coordinated_turn)
 This function reads rc commands. More...
 

Variables

struct Int32Quat stab_att_sp_quat
 with INT32_QUAT_FRAC More...
 
struct Int32Eulers stab_att_sp_euler
 with INT32_ANGLE_FRAC More...
 
float g1g2 [INDI_OUTPUTS][INDI_NUM_ACT]
 
float actuator_state_filt_vect [INDI_NUM_ACT]
 
bool act_is_servo [INDI_NUM_ACT]
 
bool indi_use_adaptive
 
float u_min_stab_indi [INDI_NUM_ACT]
 
float u_max_stab_indi [INDI_NUM_ACT]
 
float u_pref_stab_indi [INDI_NUM_ACT]
 
float * Bwls [INDI_OUTPUTS]
 
float thrust_bx_eff
 
float thrust_bx_act_dyn
 
float actuator_thrust_bx_pprz
 
float thrust_bx_state_filt
 
float act_pref [INDI_NUM_ACT]
 
float indi_Wu [INDI_NUM_ACT]
 Weighting of different actuators in the cost function. More...
 
float stablization_indi_yaw_dist_limit
 Limit the maximum specific moment that can be compensated (units rad/s^2) More...
 
struct Indi_gains indi_gains
 

Data Structure Documentation

◆ Indi_gains

struct Indi_gains

Definition at line 55 of file stabilization_indi.h.

+ Collaboration diagram for Indi_gains:
Data Fields
struct FloatRates att
struct FloatRates rate

Macro Definition Documentation

◆ INDI_G_SCALING

#define INDI_G_SCALING   1000.0

Definition at line 31 of file stabilization_indi.h.

Function Documentation

◆ stabilization_indi_attitude_run()

void stabilization_indi_attitude_run ( struct Int32Quat  quat_sp,
bool  in_flight 
)

runs stabilization indi

Parameters
enable_integrator
rate_controlboolean that determines if we are in rate control or attitude control

Function that should be called to run the INDI controller

Parameters
in_flightnot used
rate_controlrate control enabled, otherwise attitude control

Definition at line 786 of file stabilization_indi.c.

◆ stabilization_indi_enter()

void stabilization_indi_enter ( void  )

Function that resets important values upon engaging INDI.

Don't reset inputs and filters, because it is unlikely to switch stabilization in flight, and there are multiple modes that use (the same) stabilization. Resetting the controller is not so nice when you are flying. FIXME: Ideally we should detect when coming from something that is not INDI

Definition at line 432 of file stabilization_indi.c.

◆ stabilization_indi_init()

void stabilization_indi_init ( void  )

Function that initializes important values upon engaging INDI.

Definition at line 359 of file stabilization_indi.c.

◆ stabilization_indi_rate_run()

void stabilization_indi_rate_run ( struct FloatRates  rate_sp,
bool  in_flight 
)

Does the INDI calculations.

Parameters
att_errattitude error
rate_controlboolean that states if we are in rate control or attitude control
in_flightboolean that states if the UAV is in flight or not

Function that calculates the INDI commands

Parameters
indi_commands[]Array of commands that the function will write to
att_errquaternion attitude error

Definition at line 565 of file stabilization_indi.c.

◆ stabilization_indi_read_rc()

void stabilization_indi_read_rc ( bool  in_flight,
bool  in_carefree,
bool  coordinated_turn 
)

This function reads rc commands.

Parameters
in_flightboolean that states if the UAV is in flight or not

Definition at line 838 of file stabilization_indi.c.

◆ stabilization_indi_set_earth_cmd_i()

void stabilization_indi_set_earth_cmd_i ( struct Int32Vect2 cmd,
int32_t  heading 
)

Set attitude setpoint from command in earth axes.

Parameters
cmd2D command in North East axes
headingHeading of the setpoint

Function that calculates the setpoint quaternion from a command in earth axes

Parameters
cmdThe command in earth axes (North East)
headingThe desired heading

Definition at line 528 of file stabilization_indi.c.

◆ stabilization_indi_set_failsafe_setpoint()

void stabilization_indi_set_failsafe_setpoint ( void  )

Function that calculates the failsafe setpoint.

Definition at line 488 of file stabilization_indi.c.

◆ stabilization_indi_set_quat_setpoint_i()

void stabilization_indi_set_quat_setpoint_i ( struct Int32Quat quat)
Parameters
quatquaternion setpoint

Definition at line 515 of file stabilization_indi.c.

◆ stabilization_indi_set_rpy_setpoint_i()

void stabilization_indi_set_rpy_setpoint_i ( struct Int32Eulers rpy)

Set attitude quaternion setpoint from rpy.

Parameters
rpyrpy from which to calculate quaternion setpoint

Function that calculates the setpoint quaternion from rpy

Parameters
rpyroll pitch yaw input

Definition at line 503 of file stabilization_indi.c.

◆ stabilization_indi_set_stab_sp()

void stabilization_indi_set_stab_sp ( struct StabilizationSetpoint sp)

Set attitude setpoint from stabilization setpoint struct.

Parameters
spStabilization setpoint structure

Definition at line 551 of file stabilization_indi.c.

◆ stabilization_indi_set_wls_settings()

void stabilization_indi_set_wls_settings ( void  )

Function that sets the du_min, du_max and du_pref if function not elsewhere defined.

Definition at line 756 of file stabilization_indi.c.

References act_is_servo, act_pref, actuator_state_filt_vect, guidance_h, GUIDANCE_H_MODE_HOVER, GUIDANCE_H_MODE_NAV, MAX_PPRZ, HorizontalGuidance::mode, STABILIZATION_INDI_THROTTLE_LIMIT_AIRSPEED_FWD, stateGetAirspeed_f(), u_max_stab_indi, u_min_stab_indi, and u_pref_stab_indi.

Referenced by stabilization_indi_rate_run().

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

Variable Documentation

◆ act_is_servo

◆ act_pref

float act_pref[INDI_NUM_ACT]
extern

◆ actuator_state_filt_vect

◆ actuator_thrust_bx_pprz

float actuator_thrust_bx_pprz
extern

◆ Bwls

float* Bwls[INDI_OUTPUTS]
extern

◆ g1g2

◆ indi_gains

◆ indi_use_adaptive

bool indi_use_adaptive
extern

Definition at line 141 of file stabilization_indi.c.

Referenced by stabilization_indi_rate_run().

◆ indi_Wu

float indi_Wu[INDI_NUM_ACT]
extern

Weighting of different actuators in the cost function.

Definition at line 197 of file stabilization_indi.c.

Referenced by schdule_control_effectiveness(), and stabilization_indi_rate_run().

◆ stab_att_sp_euler

struct Int32Eulers stab_att_sp_euler
extern

with INT32_ANGLE_FRAC

Definition at line 1 of file stabilization_attitude_euler_float.c.

◆ stab_att_sp_quat

struct Int32Quat stab_att_sp_quat
extern

with INT32_QUAT_FRAC

Definition at line 1 of file stabilization_attitude_heli_indi.c.

◆ stablization_indi_yaw_dist_limit

float stablization_indi_yaw_dist_limit
extern

Limit the maximum specific moment that can be compensated (units rad/s^2)

Definition at line 206 of file stabilization_indi.c.

Referenced by stabilization_indi_rate_run().

◆ thrust_bx_act_dyn

float thrust_bx_act_dyn
extern

◆ thrust_bx_eff

float thrust_bx_eff
extern

◆ thrust_bx_state_filt

float thrust_bx_state_filt
extern

◆ u_max_stab_indi

float u_max_stab_indi[INDI_NUM_ACT]
extern

◆ u_min_stab_indi

float u_min_stab_indi[INDI_NUM_ACT]
extern

◆ u_pref_stab_indi

float u_pref_stab_indi[INDI_NUM_ACT]
extern