Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
guidance_v.h File Reference

Vertical guidance for rotorcrafts. More...

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

Go to the source code of this file.

Data Structures

struct  VerticalGuidance
 

Macros

#define GUIDANCE_V_MODE_KILL   0
 
#define GUIDANCE_V_MODE_RC_DIRECT   1
 
#define GUIDANCE_V_MODE_RC_CLIMB   2
 
#define GUIDANCE_V_MODE_CLIMB   3
 
#define GUIDANCE_V_MODE_HOVER   4
 
#define GUIDANCE_V_MODE_NAV   5
 
#define GUIDANCE_V_MODE_MODULE   6
 
#define GUIDANCE_V_MODE_FLIP   7
 
#define GUIDANCE_V_MODE_GUIDED   8
 
#define GuidanceVSetRef   guidance_v_set_ref
 

Functions

void guidance_v_init (void)
 
void guidance_v_read_rc (void)
 
void guidance_v_mode_changed (uint8_t new_mode)
 
void guidance_v_notify_in_flight (bool in_flight)
 
void guidance_v_thrust_adapt (bool in_flight)
 
void guidance_v_update_ref (void)
 
void guidance_v_run (bool in_flight)
 
void guidance_v_z_enter (void)
 
void guidance_v_run_enter (void)
 
int32_t guidance_v_run_pos (bool in_flight, struct VerticalGuidance *gv)
 
int32_t guidance_v_run_speed (bool in_flight, struct VerticalGuidance *gv)
 
int32_t guidance_v_run_accel (bool in_flight, struct VerticalGuidance *gv)
 
void guidance_v_set_ref (int32_t pos, int32_t speed, int32_t accel)
 Set guidance ref parameters. More...
 
void guidance_v_from_nav (bool in_flight)
 Set guidance setpoint from NAV and run hover loop. More...
 
void guidance_v_guided_enter (void)
 Enter GUIDED mode control. More...
 
void guidance_v_guided_run (bool in_flight)
 Run GUIDED mode control. More...
 
void guidance_v_set_z (float z)
 Set z position setpoint. More...
 
void guidance_v_set_vz (float vz)
 Set z velocity setpoint. More...
 
void guidance_v_set_th (float th)
 Set throttle setpoint. More...
 

Variables

struct VerticalGuidance guidance_v
 

Detailed Description

Vertical guidance for rotorcrafts.

Definition in file guidance_v.h.


Data Structure Documentation

◆ VerticalGuidance

struct VerticalGuidance

Definition at line 44 of file guidance_v.h.

Data Fields
int32_t delta_t thrust command.

summation of feed-forward and feed-back commands, valid range 0 : MAX_PPRZ

uint8_t mode
float nominal_throttle nominal throttle for hover.

This is only used if GUIDANCE_V_NOMINAL_HOVER_THROTTLE is defined! Unit: factor of MAX_PPRZ with range 0.1 : 0.9

int32_t rc_delta_t Direct throttle from radio control.

range 0:MAX_PPRZ

int32_t rc_zd_sp Vertical speed setpoint from radio control.

fixed point representation: Q12.19 accuracy 0.0000019, range +/-4096

int32_t th_sp thrust setpoint.

valid range 0 : MAX_PPRZ

int32_t thrust_coeff
int32_t z_ref altitude reference in meters.

fixed point representation: Q23.8 accuracy 0.0039, range 8388km

int32_t z_sp altitude setpoint in meters (input).

fixed point representation: Q23.8 accuracy 0.0039, range 8388km

int32_t zd_ref vertical speed reference in meter/s.

fixed point representation: Q12.19 accuracy 0.0000038, range 4096

int32_t zd_sp vertical speed setpoint in meter/s (input).

fixed point representation: Q12.19 accuracy 0.0000019, range +/-4096

int32_t zdd_ref vertical acceleration reference in meter/s^2.

fixed point representation: Q21.10 accuracy 0.0009766, range 2097152

Macro Definition Documentation

◆ GUIDANCE_V_MODE_CLIMB

#define GUIDANCE_V_MODE_CLIMB   3

Definition at line 37 of file guidance_v.h.

◆ GUIDANCE_V_MODE_FLIP

#define GUIDANCE_V_MODE_FLIP   7

Definition at line 41 of file guidance_v.h.

◆ GUIDANCE_V_MODE_GUIDED

#define GUIDANCE_V_MODE_GUIDED   8

Definition at line 42 of file guidance_v.h.

◆ GUIDANCE_V_MODE_HOVER

#define GUIDANCE_V_MODE_HOVER   4

Definition at line 38 of file guidance_v.h.

◆ GUIDANCE_V_MODE_KILL

#define GUIDANCE_V_MODE_KILL   0

Definition at line 34 of file guidance_v.h.

◆ GUIDANCE_V_MODE_MODULE

#define GUIDANCE_V_MODE_MODULE   6

Definition at line 40 of file guidance_v.h.

◆ GUIDANCE_V_MODE_NAV

#define GUIDANCE_V_MODE_NAV   5

Definition at line 39 of file guidance_v.h.

◆ GUIDANCE_V_MODE_RC_CLIMB

#define GUIDANCE_V_MODE_RC_CLIMB   2

Definition at line 36 of file guidance_v.h.

◆ GUIDANCE_V_MODE_RC_DIRECT

#define GUIDANCE_V_MODE_RC_DIRECT   1

Definition at line 35 of file guidance_v.h.

◆ GuidanceVSetRef

#define GuidanceVSetRef   guidance_v_set_ref

Definition at line 128 of file guidance_v.h.

Function Documentation

◆ guidance_v_from_nav()

◆ guidance_v_guided_enter()

void guidance_v_guided_enter ( void  )

Enter GUIDED mode control.

Definition at line 349 of file guidance_v.c.

References guidance_v_run_enter(), guidance_v_set_z(), GuidanceVSetRef, stateGetPositionNed_f(), stateGetPositionNed_i(), and stateGetSpeedNed_i().

Referenced by guidance_v_mode_changed().

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

◆ guidance_v_guided_run()

◆ guidance_v_init()

◆ guidance_v_mode_changed()

◆ guidance_v_notify_in_flight()

void guidance_v_notify_in_flight ( bool  in_flight)

Definition at line 167 of file guidance_v.c.

References gv_adapt_init().

+ Here is the call graph for this function:

◆ guidance_v_read_rc()

◆ guidance_v_run()

◆ guidance_v_run_accel()

int32_t guidance_v_run_accel ( bool  in_flight,
struct VerticalGuidance gv 
)

Definition at line 76 of file guidance_oneloop.c.

◆ guidance_v_run_enter()

void guidance_v_run_enter ( void  )

Definition at line 39 of file guidance_oneloop.c.

Referenced by guidance_v_from_nav(), guidance_v_guided_enter(), guidance_v_mode_changed(), and guidance_v_z_enter().

+ Here is the caller graph for this function:

◆ guidance_v_run_pos()

int32_t guidance_v_run_pos ( bool  in_flight,
struct VerticalGuidance gv 
)

Definition at line 62 of file guidance_oneloop.c.

References _gv, _v_mode, and GUIDANCE_ONELOOP_V_POS.

Referenced by guidance_v_from_nav(), and guidance_v_guided_run().

+ Here is the caller graph for this function:

◆ guidance_v_run_speed()

int32_t guidance_v_run_speed ( bool  in_flight,
struct VerticalGuidance gv 
)

Definition at line 69 of file guidance_oneloop.c.

References _gv, _v_mode, and GUIDANCE_ONELOOP_V_SPEED.

Referenced by guidance_v_from_nav(), guidance_v_guided_run(), and guidance_v_run().

+ Here is the caller graph for this function:

◆ guidance_v_set_ref()

void guidance_v_set_ref ( int32_t  pos,
int32_t  speed,
int32_t  accel 
)

Set guidance ref parameters.

Definition at line 297 of file guidance_v.c.

References guidance_v, gv_set_ref(), VerticalGuidance::z_ref, VerticalGuidance::zd_ref, and VerticalGuidance::zdd_ref.

+ Here is the call graph for this function:

◆ guidance_v_set_th()

void guidance_v_set_th ( float  th)

Set throttle setpoint.

Parameters
thThrottle setpoint between 0. and 1.

Definition at line 411 of file guidance_v.c.

References guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_THROTTLE, GuidanceVSetRef, MAX_PPRZ, stateGetPositionNed_i(), stateGetSpeedNed_i(), and VerticalGuidance::th_sp.

+ Here is the call graph for this function:

◆ guidance_v_set_vz()

void guidance_v_set_vz ( float  vz)

Set z velocity setpoint.

Parameters
vzSetpoint (down is positive) in meters/second.

Definition at line 403 of file guidance_v.c.

References guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_CLIMB, SPEED_BFP_OF_REAL, and VerticalGuidance::zd_sp.

Referenced by autopilot_guided_move_ned(), autopilot_guided_update(), and autopilot_static_set_mode().

+ Here is the caller graph for this function:

◆ guidance_v_set_z()

void guidance_v_set_z ( float  z)

Set z position setpoint.

Parameters
zSetpoint (down is positive) in meters.

Definition at line 393 of file guidance_v.c.

References guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_ZHOLD, POS_BFP_OF_REAL, VerticalGuidance::z_sp, and VerticalGuidance::zd_sp.

Referenced by autopilot_guided_goto_ned(), autopilot_guided_update(), and guidance_v_guided_enter().

+ Here is the caller graph for this function:

◆ guidance_v_thrust_adapt()

void guidance_v_thrust_adapt ( bool  in_flight)

Definition at line 203 of file guidance_v.c.

References desired_zd_updated, get_vertical_thrust_coeff(), guidance_v, gv_adapt_init(), gv_adapt_run(), INT32_TRIG_FRAC, stabilization_cmd, stateGetAccelNed_i(), VerticalGuidance::thrust_coeff, and VerticalGuidance::zd_ref.

Referenced by guidance_v_run().

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

◆ guidance_v_update_ref()

◆ guidance_v_z_enter()

void guidance_v_z_enter ( void  )

Definition at line 284 of file guidance_v.c.

References guidance_v, guidance_v_run_enter(), GuidanceVSetRef, stateGetPositionNed_i(), NedCoor_i::z, VerticalGuidance::z_sp, and VerticalGuidance::zd_sp.

+ Here is the call graph for this function:

Variable Documentation

◆ guidance_v