|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Vertical guidance for rotorcrafts. More...
#include "std.h"#include "firmwares/rotorcraft/guidance/guidance_v_ref.h"#include "firmwares/rotorcraft/guidance/guidance_v_adapt.h"#include "firmwares/rotorcraft/stabilization.h"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_GUIDED 6 |
| #define | GuidanceVSetRef guidance_v_set_ref |
Functions | |
| void | guidance_v_init (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_z_enter (void) |
| void | guidance_v_run_enter (void) |
| struct ThrustSetpoint | guidance_v_run (bool in_flight) |
| Guidance vertical run functions. | |
| struct ThrustSetpoint | guidance_v_run_pos (bool in_flight, struct VerticalGuidance *gv) |
| struct ThrustSetpoint | guidance_v_run_speed (bool in_flight, struct VerticalGuidance *gv) |
| struct ThrustSetpoint | 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. | |
| struct ThrustSetpoint | guidance_v_from_nav (bool in_flight) |
| Set guidance setpoint from NAV and run hover loop. | |
| void | guidance_v_guided_enter (void) |
| Enter GUIDED mode control. | |
| struct ThrustSetpoint | guidance_v_guided_run (bool in_flight) |
| Run GUIDED mode control. | |
| void | guidance_v_set_z (float z) |
| Set z position setpoint. | |
| void | guidance_v_set_vz (float vz) |
| Set z velocity setpoint. | |
| void | guidance_v_set_th (float th) |
| Set throttle setpoint. | |
| void | guidance_v_set_all (float z, float vz, float az) |
| Set z position, velocity and acceleration setpoint. | |
Variables | |
| struct VerticalGuidance | guidance_v |
Vertical guidance for rotorcrafts.
Definition in file guidance_v.h.
| struct VerticalGuidance |
Definition at line 43 of file guidance_v.h.
| Data Fields | ||
|---|---|---|
| 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 |
input thrust setpoint. valid range 0 : MAX_PPRZ |
| struct ThrustSetpoint | thrust | Final thrust setpoint summation of feed-forward and feed-back commands, can be a total thrust or increment, float or int. |
| 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 |
| int32_t | zdd_sp |
vertical acceleration setpoint in meter/s^2. fixed point representation: Q21.10 accuracy 0.0009766, range 2097152 |
| #define GUIDANCE_V_MODE_CLIMB 3 |
Definition at line 38 of file guidance_v.h.
Referenced by autopilot_static_set_mode(), guidance_v_mode_changed(), and guidance_v_run().
| #define GUIDANCE_V_MODE_GUIDED 6 |
Definition at line 41 of file guidance_v.h.
Referenced by autopilot_static_set_mode(), guidance_v_mode_changed(), and guidance_v_run().
| #define GUIDANCE_V_MODE_HOVER 4 |
Definition at line 39 of file guidance_v.h.
Referenced by autopilot_static_set_mode(), guidance_module_enter(), guidance_v_mode_changed(), and guidance_v_run().
| #define GUIDANCE_V_MODE_KILL 0 |
Definition at line 35 of file guidance_v.h.
Referenced by autopilot_static_set_mode(), and guidance_v_init().
| #define GUIDANCE_V_MODE_NAV 5 |
Definition at line 40 of file guidance_v.h.
Referenced by autopilot_static_set_mode(), control_mixing_heewing_nav_enter(), guidance_v_mode_changed(), and guidance_v_run().
| #define GUIDANCE_V_MODE_RC_CLIMB 2 |
Definition at line 37 of file guidance_v.h.
Referenced by autopilot_static_set_mode(), guidance_v_mode_changed(), and guidance_v_run().
| #define GUIDANCE_V_MODE_RC_DIRECT 1 |
Definition at line 36 of file guidance_v.h.
Referenced by autopilot_static_set_mode(), control_mixing_heewing_attitude_direct_enter(), control_mixing_heewing_attitude_plane_enter(), and guidance_v_run().
| #define GuidanceVSetRef guidance_v_set_ref |
Definition at line 135 of file guidance_v.h.
Referenced by guidance_v_from_nav(), guidance_v_guided_enter(), guidance_v_mode_changed(), guidance_v_set_th(), and guidance_v_z_enter().
|
extern |
Set guidance setpoint from NAV and run hover loop.
Definition at line 303 of file guidance_v.c.
References guidance_v, guidance_v_from_nav(), guidance_v_guided_run(), guidance_v_run_enter(), guidance_v_run_pos(), guidance_v_run_speed(), guidance_v_update_ref(), GuidanceVSetRef, gv_update_ref_from_z_sp(), gv_update_ref_from_zd_sp(), nav, NAV_VERTICAL_MODE_ALT, NAV_VERTICAL_MODE_CLIMB, NAV_VERTICAL_MODE_GUIDED, NAV_VERTICAL_MODE_MANUAL, POS_BFP_OF_REAL, ThrustSetpoint::sp, SPEED_BFP_OF_REAL, stateGetPositionNed_i(), stateGetSpeedNed_i(), th_sp_from_thrust_i(), THRUST_AXIS_Z, THRUST_SP_SET_ZERO, and NedCoor_i::z.
Referenced by guidance_v_from_nav(), and guidance_v_run().
|
extern |
Enter GUIDED mode control.
Definition at line 334 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().
|
extern |
Run GUIDED mode control.
Definition at line 344 of file guidance_v.c.
References guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_ALL, GUIDANCE_V_GUIDED_MODE_CLIMB, GUIDANCE_V_GUIDED_MODE_THROTTLE, GUIDANCE_V_GUIDED_MODE_ZHOLD, guidance_v_guided_run(), guidance_v_run_pos(), guidance_v_run_speed(), guidance_v_set_ref(), guidance_v_update_ref(), gv_update_ref_from_z_sp(), gv_update_ref_from_zd_sp(), ThrustSetpoint::sp, stateGetPositionNed_i(), th_sp_from_thrust_i(), THRUST_AXIS_Z, THRUST_SP_SET_ZERO, and NedCoor_i::z.
Referenced by guidance_v_from_nav(), guidance_v_guided_run(), and guidance_v_run().
|
extern |
Definition at line 92 of file guidance_v.c.
References BFP_OF_REAL, DefaultPeriodic, desired_zd_updated, guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_ZHOLD, GUIDANCE_V_MODE_KILL, GUIDANCE_V_NOMINAL_HOVER_THROTTLE, GUIDANCE_V_RC_ID, gv_adapt_init(), INT32_TRIG_FRAC, rc_cb(), rc_ev, register_periodic_telemetry(), and send_tune_vert().
|
extern |
Definition at line 133 of file guidance_v.c.
References guidance_v, guidance_v_guided_enter(), GUIDANCE_V_MODE_CLIMB, GUIDANCE_V_MODE_GUIDED, GUIDANCE_V_MODE_HOVER, GUIDANCE_V_MODE_NAV, GUIDANCE_V_MODE_RC_CLIMB, guidance_v_run_enter(), GuidanceVSetRef, stateGetPositionNed_i(), and stateGetSpeedNed_i().
Referenced by autopilot_static_set_mode(), control_mixing_heewing_attitude_direct_enter(), control_mixing_heewing_attitude_plane_enter(), control_mixing_heewing_nav_enter(), and guidance_module_enter().
|
extern |
Definition at line 165 of file guidance_v.c.
References gv_adapt_init().
|
extern |
Guidance vertical run functions.
Definition at line 223 of file guidance_v.c.
References desired_zd_updated, guidance_v, guidance_v_from_nav(), guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_ZHOLD, guidance_v_guided_run(), GUIDANCE_V_MODE_CLIMB, GUIDANCE_V_MODE_GUIDED, GUIDANCE_V_MODE_HOVER, GUIDANCE_V_MODE_NAV, GUIDANCE_V_MODE_RC_CLIMB, GUIDANCE_V_MODE_RC_DIRECT, guidance_v_run(), guidance_v_run_speed(), guidance_v_thrust_adapt(), gv_update_ref_from_zd_sp(), stateGetPositionNed_i(), th_sp_from_thrust_i(), THRUST_AXIS_Z, THRUST_SP_SET_ZERO, and NedCoor_i::z.
Referenced by autopilot_static_periodic(), control_mixing_heewing_attitude_direct(), control_mixing_heewing_attitude_plane(), control_mixing_heewing_nav_run(), guidance_module_run(), and guidance_v_run().
|
extern |
Definition at line 77 of file guidance_oneloop.c.
References _gv, _v_mode, GUIDANCE_ONELOOP_V_ACCEL, guidance_v_run_accel(), thrust_sp, and UNUSED.
Referenced by guidance_v_run_accel().
|
extern |
Definition at line 40 of file guidance_oneloop.c.
Referenced by guidance_v_from_nav(), guidance_v_guided_enter(), guidance_v_mode_changed(), and guidance_v_z_enter().
|
extern |
Definition at line 63 of file guidance_oneloop.c.
References _gv, _v_mode, GUIDANCE_ONELOOP_V_POS, guidance_v_run_pos(), thrust_sp, and UNUSED.
Referenced by guidance_v_from_nav(), guidance_v_guided_run(), and guidance_v_run_pos().
|
extern |
Definition at line 70 of file guidance_oneloop.c.
References _gv, _v_mode, GUIDANCE_ONELOOP_V_SPEED, guidance_v_run_speed(), thrust_sp, and UNUSED.
Referenced by guidance_v_from_nav(), guidance_v_guided_run(), guidance_v_run(), and guidance_v_run_speed().
|
extern |
Set z position, velocity and acceleration setpoint.
| z | Setpoint (down is positive) in meters. |
| vz | Setpoint (down is positive) in meters/second. |
| az | Setpoint (down is positive) in meters/second². |
Definition at line 411 of file guidance_v.c.
References ACCEL_BFP_OF_REAL, guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_ZHOLD, POS_BFP_OF_REAL, and SPEED_BFP_OF_REAL.
Set guidance ref parameters.
Definition at line 283 of file guidance_v.c.
References guidance_v, and gv_set_ref().
Referenced by guidance_v_guided_run().
|
extern |
Set throttle setpoint.
| th | Throttle setpoint between 0. and 1. |
Definition at line 400 of file guidance_v.c.
References guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_THROTTLE, GuidanceVSetRef, MAX_PPRZ, stateGetPositionNed_i(), and stateGetSpeedNed_i().
|
extern |
Set z velocity setpoint.
| vz | Setpoint (down is positive) in meters/second. |
Definition at line 390 of file guidance_v.c.
References guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_CLIMB, and SPEED_BFP_OF_REAL.
Referenced by autopilot_static_set_mode().
|
extern |
Set z position setpoint.
| z | Setpoint (down is positive) in meters. |
Definition at line 379 of file guidance_v.c.
References guidance_v, guidance_v_guided_mode, GUIDANCE_V_GUIDED_MODE_ZHOLD, and POS_BFP_OF_REAL.
Referenced by guidance_v_guided_enter(), and wedgebug_periodic().
|
extern |
Definition at line 201 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, and stateGetAccelNed_i().
Referenced by guidance_v_run().
|
extern |
Definition at line 292 of file guidance_v.c.
References desired_zd_updated, guidance_v, gv_z_ref, GV_Z_REF_FRAC, gv_zd_ref, GV_ZD_REF_FRAC, gv_zdd_ref, GV_ZDD_REF_FRAC, INT32_ACCEL_FRAC, INT32_POS_FRAC, and INT32_SPEED_FRAC.
Referenced by guidance_v_from_nav(), and guidance_v_guided_run().
|
extern |
Definition at line 269 of file guidance_v.c.
References guidance_v, guidance_v_run_enter(), GuidanceVSetRef, stateGetPositionNed_i(), and NedCoor_i::z.
|
extern |
Definition at line 60 of file guidance_v.c.
Referenced by guidance_hybrid_vertical(), guidance_pid_h_run(), guidance_v_from_nav(), guidance_v_guided_run(), guidance_v_init(), guidance_v_mode_changed(), guidance_v_run(), guidance_v_set_all(), guidance_v_set_ref(), guidance_v_set_th(), guidance_v_set_vz(), guidance_v_set_z(), guidance_v_thrust_adapt(), guidance_v_update_ref(), guidance_v_z_enter(), optical_flow_landing_init(), rc_cb(), send_fp(), send_status(), send_tune_vert(), and send_vert_loop().