Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
guidance_hybrid.h File Reference

Guidance controllers (horizontal and vertical) for Hybrid UAV configurations. More...

+ Include dependency graph for guidance_hybrid.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void guidance_hybrid_init (void)
 Hybrid Guidance Initialization function.
 
struct StabilizationSetpoint guidance_hybrid_run (void)
 Runs the Hybrid Guidance main functions.
 
struct StabilizationSetpoint guidance_hybrid_h_run_pos (bool in_flight, struct HorizontalGuidance *gh)
 
struct StabilizationSetpoint guidance_hybrid_h_run_speed (bool in_flight, struct HorizontalGuidance *gh)
 
struct StabilizationSetpoint guidance_hybrid_h_run_accel (bool in_flight, struct HorizontalGuidance *gh)
 
struct ThrustSetpoint guidance_hybrid_v_run_pos (bool in_flight, struct VerticalGuidance *gv)
 
struct ThrustSetpoint guidance_hybrid_v_run_speed (bool in_flight, struct VerticalGuidance *gv)
 
struct ThrustSetpoint guidance_hybrid_v_run_accel (bool in_flight, struct VerticalGuidance *gv)
 
struct StabilizationSetpoint guidance_hybrid_set_cmd_i (struct Int32Eulers *sp_cmd)
 Creates the attitude set-points from an orientation vector.
 
void guidance_hybrid_airspeed_to_attitude (struct Int32Eulers *ypr_sp)
 Convert a required airspeed to a certain attitude for the Hybrid.
 
void guidance_hybrid_groundspeed_to_airspeed (void)
 Description.
 
void guidance_hybrid_determine_wind_estimate (void)
 Description.
 
struct ThrustSetpoint guidance_hybrid_vertical (struct ThrustSetpoint *th)
 Description.
 

Variables

int32_t guidance_hybrid_norm_ref_airspeed
 
int32_t max_airspeed
 
int32_t wind_gain
 
int32_t horizontal_speed_gain
 
float max_turn_bank
 
float turn_bank_gain
 
int32_t cruise_throttle
 
int32_t fwd_speed_p_gain
 
float fwd_alt_thrust_gain
 
float fwd_pid_div
 
float fwd_nominal_pitch
 
float fwd_pitch_gain
 
int32_t hover_p_gain
 
bool force_forward_flight
 

Detailed Description

Guidance controllers (horizontal and vertical) for Hybrid UAV configurations.

Definition in file guidance_hybrid.h.

Function Documentation

◆ guidance_hybrid_airspeed_to_attitude()

void guidance_hybrid_airspeed_to_attitude ( struct Int32Eulers ypr_sp)
extern

Convert a required airspeed to a certain attitude for the Hybrid.

Parameters
ypr_spAttitude set-point

Convert a required airspeed to a certain attitude for the Hybrid.

if required speed is lower than 4 m/s act like a rotorcraft

if required speed is higher than 4 m/s act like a fixedwing

Definition at line 206 of file guidance_hybrid.c.

References AIRSPEED_FORWARD, AIRSPEED_HOVER, airspeed_sp_heading_disp, ANGLE_BFP_OF_REAL, ANGLE_FLOAT_OF_BFP, FLOAT_ANGLE_NORMALIZE, FLOAT_OF_BFP, foo, fwd_nominal_pitch, guidance_hybrid_airspeed_sp, guidance_hybrid_norm_ref_airspeed, guidance_hybrid_norm_ref_airspeed_f, guidance_hybrid_ref_airspeed, heading_diff_disp, high_res_psi, hover_p_gain, INT32_ANGLE_FRAC, INT32_ANGLE_HIGH_RES_FRAC, INT32_ANGLE_HIGH_RES_NORMALIZE, INT32_ANGLE_PI, INT32_POS_FRAC, INT32_TRIG_FRAC, int32_vect2_norm(), max_turn_bank, norm_sp_airspeed_disp, omega_disp, POS_FLOAT_OF_BFP, PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, turn_bank_gain, v_control_pitch, Int32Vect2::x, and Int32Vect2::y.

Referenced by guidance_hybrid_run().

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

◆ guidance_hybrid_determine_wind_estimate()

void guidance_hybrid_determine_wind_estimate ( void  )
extern

Description.

Definition at line 385 of file guidance_hybrid.c.

References foo, guidance_hybrid_ref_airspeed, INT32_VECT2_RSHIFT, stateGetSpeedNed_i(), VECT2_DIFF, wind_estimate, wind_estimate_high_res, wind_gain, Int32Vect2::x, and Int32Vect2::y.

Referenced by guidance_hybrid_run().

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

◆ guidance_hybrid_groundspeed_to_airspeed()

void guidance_hybrid_groundspeed_to_airspeed ( void  )
extern

◆ guidance_hybrid_h_run_accel()

struct StabilizationSetpoint guidance_hybrid_h_run_accel ( bool  in_flight,
struct HorizontalGuidance gh 
)
extern

◆ guidance_hybrid_h_run_pos()

struct StabilizationSetpoint guidance_hybrid_h_run_pos ( bool  in_flight,
struct HorizontalGuidance gh 
)
extern

Definition at line 163 of file guidance_hybrid.c.

References foo, guidance_h_pos_err, guidance_hybrid_groundspeed_sp, guidance_hybrid_run(), horizontal_speed_gain, stateGetPositionNed_i(), VECT2_DIFF, and VECT2_SDIV.

+ Here is the call graph for this function:

◆ guidance_hybrid_h_run_speed()

struct StabilizationSetpoint guidance_hybrid_h_run_speed ( bool  in_flight,
struct HorizontalGuidance gh 
)
extern

Definition at line 172 of file guidance_hybrid.c.

References foo, guidance_hybrid_groundspeed_sp, guidance_hybrid_run(), and VECT2_COPY.

+ Here is the call graph for this function:

◆ guidance_hybrid_init()

◆ guidance_hybrid_run()

struct StabilizationSetpoint guidance_hybrid_run ( void  )
extern

Runs the Hybrid Guidance main functions.

Definition at line 155 of file guidance_hybrid.c.

References guidance_hybrid_airspeed_to_attitude(), guidance_hybrid_determine_wind_estimate(), guidance_hybrid_groundspeed_to_airspeed(), guidance_hybrid_set_cmd_i(), and guidance_hybrid_ypr_sp.

Referenced by guidance_hybrid_h_run_pos(), and guidance_hybrid_h_run_speed().

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

◆ guidance_hybrid_set_cmd_i()

struct StabilizationSetpoint guidance_hybrid_set_cmd_i ( struct Int32Eulers sp_cmd)
extern

Creates the attitude set-points from an orientation vector.

Parameters
sp_cmdThe orientation vector
Todo:
calc sp_quat in fixed-point

Definition at line 403 of file guidance_hybrid.c.

References ANGLE_FLOAT_OF_BFP, float_quat_of_orientation_vect(), foo, int32_quat_comp(), int32_quat_of_axis_angle(), QUAT_BFP_OF_REAL, stab_sp_from_quat_i(), FloatVect3::x, FloatVect3::y, and FloatVect3::z.

Referenced by guidance_hybrid_run().

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

◆ guidance_hybrid_v_run_accel()

struct ThrustSetpoint guidance_hybrid_v_run_accel ( bool  in_flight,
struct VerticalGuidance gv 
)
extern

Definition at line 198 of file guidance_hybrid.c.

References foo, guidance_hybrid_vertical(), and guidance_pid_v_run_accel().

+ Here is the call graph for this function:

◆ guidance_hybrid_v_run_pos()

struct ThrustSetpoint guidance_hybrid_v_run_pos ( bool  in_flight,
struct VerticalGuidance gv 
)
extern

Definition at line 186 of file guidance_hybrid.c.

References foo, guidance_hybrid_vertical(), and guidance_pid_v_run_pos().

+ Here is the call graph for this function:

◆ guidance_hybrid_v_run_speed()

struct ThrustSetpoint guidance_hybrid_v_run_speed ( bool  in_flight,
struct VerticalGuidance gv 
)
extern

Definition at line 192 of file guidance_hybrid.c.

References foo, guidance_hybrid_vertical(), and guidance_pid_v_run_speed().

+ Here is the call graph for this function:

◆ guidance_hybrid_vertical()

struct ThrustSetpoint guidance_hybrid_vertical ( struct ThrustSetpoint th)
extern

Description.

Change thurst command from standard hover loop to hybrid thrust command

Parameters
delta_toriginal thurst command
Returns
modified thrust command

Description.

Definition at line 436 of file guidance_hybrid.c.

References AIRSPEED_FORWARD, AIRSPEED_HOVER, ANGLE_BFP_OF_REAL, cruise_throttle, foo, fwd_alt_thrust_gain, fwd_pid_div, fwd_pitch_gain, fwd_speed_p_gain, guidance_hybrid_norm_ref_airspeed_f, guidance_pid, guidance_v, GuidancePID::kd, GuidancePID::ki, GuidancePID::kp, MAX_PPRZ, VerticalGuidance::nominal_throttle, th_sp_from_thrust_i(), th_sp_to_thrust_i(), THRUST_AXIS_Z, and v_control_pitch.

Referenced by guidance_hybrid_v_run_accel(), guidance_hybrid_v_run_pos(), and guidance_hybrid_v_run_speed().

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

Variable Documentation

◆ cruise_throttle

int32_t cruise_throttle
extern

Definition at line 72 of file guidance_hybrid.c.

Referenced by guidance_hybrid_vertical().

◆ force_forward_flight

bool force_forward_flight
extern

◆ fwd_alt_thrust_gain

float fwd_alt_thrust_gain
extern

Definition at line 74 of file guidance_hybrid.c.

Referenced by guidance_hybrid_vertical().

◆ fwd_nominal_pitch

float fwd_nominal_pitch
extern

Definition at line 76 of file guidance_hybrid.c.

Referenced by guidance_hybrid_airspeed_to_attitude().

◆ fwd_pid_div

float fwd_pid_div
extern

Definition at line 75 of file guidance_hybrid.c.

Referenced by guidance_hybrid_vertical().

◆ fwd_pitch_gain

float fwd_pitch_gain
extern

Definition at line 77 of file guidance_hybrid.c.

Referenced by guidance_hybrid_vertical().

◆ fwd_speed_p_gain

int32_t fwd_speed_p_gain
extern

Definition at line 73 of file guidance_hybrid.c.

Referenced by guidance_hybrid_vertical().

◆ guidance_hybrid_norm_ref_airspeed

int32_t guidance_hybrid_norm_ref_airspeed
extern

◆ horizontal_speed_gain

int32_t horizontal_speed_gain
extern

Definition at line 58 of file guidance_hybrid.c.

Referenced by guidance_hybrid_h_run_pos(), and guidance_hybrid_init().

◆ hover_p_gain

int32_t hover_p_gain
extern

Definition at line 78 of file guidance_hybrid.c.

Referenced by guidance_hybrid_airspeed_to_attitude().

◆ max_airspeed

int32_t max_airspeed
extern

◆ max_turn_bank

float max_turn_bank
extern

Definition at line 59 of file guidance_hybrid.c.

Referenced by guidance_hybrid_airspeed_to_attitude(), and guidance_hybrid_init().

◆ turn_bank_gain

float turn_bank_gain
extern

Definition at line 60 of file guidance_hybrid.c.

Referenced by guidance_hybrid_airspeed_to_attitude(), and guidance_hybrid_init().

◆ wind_gain

int32_t wind_gain
extern