27 #include "generated/airframe.h"
42 #ifndef GUIDANCE_V_NOMINAL_HOVER_THROTTLE
43 #define GUIDANCE_V_NOMINAL_HOVER_THROTTLE 0.4
48 #ifndef GUIDANCE_V_CLIMB_RC_DEADBAND
49 #define GUIDANCE_V_CLIMB_RC_DEADBAND MAX_PPRZ/10
52 #ifndef GUIDANCE_V_MAX_RC_CLIMB_SPEED
53 #define GUIDANCE_V_MAX_RC_CLIMB_SPEED GUIDANCE_V_REF_MIN_ZD
56 #ifndef GUIDANCE_V_MAX_RC_DESCENT_SPEED
57 #define GUIDANCE_V_MAX_RC_DESCENT_SPEED GUIDANCE_V_REF_MAX_ZD
64 #define GUIDANCE_V_GUIDED_MODE_ZHOLD 0
65 #define GUIDANCE_V_GUIDED_MODE_CLIMB 1
66 #define GUIDANCE_V_GUIDED_MODE_THROTTLE 2
70 #ifndef GUIDANCE_V_RC_ID
71 #define GUIDANCE_V_RC_ID ABI_BROADCAST
78 #if PERIODIC_TELEMETRY
83 pprz_msg_send_TUNE_VERT(trans,
dev, AC_ID,
106 #if PERIODIC_TELEMETRY
192 if (coef < max_bank_coef) {
193 coef = max_bank_coef;
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
#define BFP_OF_REAL(_vr, _frac)
#define POS_BFP_OF_REAL(_af)
#define SPEED_BFP_OF_REAL(_af)
static struct NedCoor_i * stateGetAccelNed_i(void)
Get acceleration in NED coordinates (int).
static struct Int32RMat * stateGetNedToBodyRMat_i(void)
Get vehicle body attitude rotation matrix (int).
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
static struct NedCoor_i * stateGetPositionNed_i(void)
Get position in local NED coordinates (int).
static struct NedCoor_i * stateGetSpeedNed_i(void)
Get ground speed in local NED coordinates (int).
Guidance controllers (horizontal and vertical) for Hybrid UAV configurations.
Guidance in a module file.
void guidance_v_run_enter(void)
struct ThrustSetpoint guidance_v_run_pos(bool in_flight UNUSED, struct VerticalGuidance *gv)
struct ThrustSetpoint guidance_v_run_speed(bool in_flight UNUSED, struct VerticalGuidance *gv)
void gv_adapt_run(int32_t zdd_meas, int32_t thrust_applied, int32_t zd_ref)
Adaptation function.
int32_t gv_zdd_ref
reference model vertical accel in meters/s^2 (output) fixed point representation with GV_ZDD_REF_FRAC...
int64_t gv_z_ref
reference model altitude in meters (output) fixed point representation with GV_Z_REF_FRAC Q37....
void gv_set_ref(int32_t alt, int32_t speed, int32_t accel)
void gv_update_ref_from_z_sp(int32_t z_sp)
void gv_update_ref_from_zd_sp(int32_t zd_sp, int32_t z_pos)
update vertical reference from speed setpoint.
int32_t gv_zd_ref
reference model vertical speed in meters/sec (output) fixed point representation with GV_ZD_REF_FRAC ...
#define GV_ZD_REF_FRAC
number of bits for the fractional part of gv_zd_ref
#define GV_Z_REF_FRAC
number of bits for the fractional part of gv_z_ref
#define GV_ZDD_REF_FRAC
number of bits for the fractional part of gv_zdd_ref
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
Paparazzi fixed point algebra.
Generic interface for radio control modules.
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
static void send_tune_vert(struct transport_tx *trans, struct link_device *dev)
void guidance_v_thrust_adapt(bool in_flight)
#define GUIDANCE_V_MAX_RC_DESCENT_SPEED
void guidance_v_set_vz(float vz)
Set z velocity setpoint.
void guidance_v_z_enter(void)
void guidance_v_notify_in_flight(bool in_flight)
struct ThrustSetpoint guidance_v_from_nav(bool in_flight)
Set guidance setpoint from NAV and run hover loop.
static void rc_cb(uint8_t sender_id UNUSED, struct RadioControl *rc)
#define GUIDANCE_V_MAX_RC_CLIMB_SPEED
static bool desired_zd_updated
#define GUIDANCE_V_NOMINAL_HOVER_THROTTLE
#define GUIDANCE_V_GUIDED_MODE_ZHOLD
void guidance_v_set_z(float z)
Set z position setpoint.
void guidance_v_guided_enter(void)
Enter GUIDED mode control.
#define GUIDANCE_V_GUIDED_MODE_THROTTLE
static int32_t get_vertical_thrust_coeff(void)
get the cosine of the angle between thrust vector and gravity vector
void guidance_v_set_ref(int32_t pos, int32_t speed, int32_t accel)
Set guidance ref parameters.
#define GUIDANCE_V_GUIDED_MODE_CLIMB
void guidance_v_set_th(float th)
Set throttle setpoint.
struct ThrustSetpoint guidance_v_guided_run(bool in_flight)
Run GUIDED mode control.
void guidance_v_mode_changed(uint8_t new_mode)
struct VerticalGuidance guidance_v
#define GUIDANCE_V_CLIMB_RC_DEADBAND
void guidance_v_update_ref(void)
void guidance_v_init(void)
static int guidance_v_guided_mode
struct ThrustSetpoint guidance_v_run(bool in_flight)
Guidance vertical run functions.
Vertical guidance for rotorcrafts.
float nominal_throttle
nominal throttle for hover.
int32_t z_sp
altitude setpoint in meters (input).
int32_t zd_sp
vertical speed setpoint in meter/s (input).
struct ThrustSetpoint thrust
Final thrust setpoint summation of feed-forward and feed-back commands, can be a total thrust or incr...
int32_t z_ref
altitude reference in meters.
#define GUIDANCE_V_MODE_CLIMB
#define GUIDANCE_V_MODE_RC_CLIMB
int32_t zd_ref
vertical speed reference in meter/s.
#define GUIDANCE_V_MODE_KILL
int32_t th_sp
input thrust setpoint.
int32_t rc_zd_sp
Vertical speed setpoint from radio control.
#define GUIDANCE_V_MODE_RC_DIRECT
#define GUIDANCE_V_MODE_NAV
#define GUIDANCE_V_MODE_HOVER
int32_t zdd_ref
vertical acceleration reference in meter/s^2.
#define GUIDANCE_V_MODE_GUIDED
int32_t rc_delta_t
Direct throttle from radio control.
struct RotorcraftNavigation nav
Rotorcraft navigation functions.
uint32_t throttle
throttle command (in pprz_t)
float climb
climb setpoint (in m/s)
#define NAV_VERTICAL_MODE_CLIMB
#define NAV_VERTICAL_MODE_MANUAL
float nav_altitude
current altitude setpoint (in meters): might differ from fp_altitude depending on altitude shift from...
#define NAV_VERTICAL_MODE_ALT
#define NAV_VERTICAL_MODE_GUIDED
struct Stabilization stabilization
struct ThrustSetpoint th_sp_from_thrust_i(int32_t thrust, uint8_t axis)
General stabilization interface for rotorcrafts.
#define THRUST_SP_SET_ZERO(_sp)
int32_t cmd[COMMANDS_NB]
output command vector, range from [-MAX_PPRZ:MAX_PPRZ] (store for messages)
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
Thrust setpoint // TODO to a setpoint header Structure to store the desired thrust vector with differ...
union ThrustSetpoint::@284 sp
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.