32#include "generated/airframe.h"
33#include "generated/flight_plan.h"
37#ifndef GUIDANCE_PLANE_MAX_BANK
38#define GUIDANCE_PLANE_MAX_BANK RadOfDeg(45.f)
41#ifndef GUIDANCE_PLANE_MAX_PITCH
42#define GUIDANCE_PLANE_MAX_PITCH RadOfDeg(30.f)
45#ifndef GUIDANCE_PLANE_MIN_PITCH
46#define GUIDANCE_PLANE_MIN_PITCH RadOfDeg(-20.f)
49#ifndef GUIDANCE_PLANCE_COURSE_PRE_BANK
50#define GUIDANCE_PLANCE_COURSE_PRE_BANK 1.f
53#ifndef GUIDANCE_PLANE_MAX_CLIMB
54#define GUIDANCE_PLANE_MAX_CLIMB 2.f
57#ifndef GUIDANCE_PLANE_PITCH_OF_VZ
58#define GUIDANCE_PLANE_PITCH_OF_VZ RadOfDeg(5.f)
61#ifndef GUIDANCE_PLANE_PITCH_TRIM
62#define GUIDANCE_PLANE_PITCH_TRIM RadOfDeg(0.f)
65#ifndef GUIDANCE_PLANE_CLIMB_THROTTLE_INCREMENT
66#define GUIDANCE_PLANE_CLIMB_THROTTLE_INCREMENT 0.1f
80#define GUIDANCE_PLANE_PITCH_MAX_SUM_ERR (RadOfDeg(10.))
83#define GUIDANCE_PLANE_THROTTLE_MAX_SUM_ERR 0.4
121#if PERIODIC_TELEMETRY
void float_eulers_of_quat(struct FloatEulers *e, struct FloatQuat *q)
euler rotation 'ZYX'
#define POS_BFP_OF_REAL(_af)
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
#define GUIDANCE_PLANE_PITCH_TRIM
#define GUIDANCE_PLANCE_COURSE_PRE_BANK
struct GuidancePlane guidance_plane
Guidance PID structyre.
#define GUIDANCE_PLANE_MAX_PITCH
#define GUIDANCE_PLANE_MAX_BANK
#define GUIDANCE_PLANE_CLIMB_THROTTLE_INCREMENT
#define GUIDANCE_PLANE_PITCH_OF_VZ
void guidance_plane_enter(void)
#define GUIDANCE_PLANE_MAX_CLIMB
#define GUIDANCE_PLANE_THROTTLE_MAX_SUM_ERR
static void guidance_plane_set_pitch(bool in_flight)
void guidance_plane_init(void)
struct StabilizationSetpoint guidance_plane_attitude_from_nav(bool in_flight UNUSED)
run horizontal control loop for position and speed control
static float pitch_sum_err
#define GUIDANCE_PLANE_PITCH_MAX_SUM_ERR
static void guidance_plane_set_throttle(bool in_flight)
struct ThrustSetpoint guidance_plane_thrust_from_nav(bool in_flight)
run vertical control loop for position and speed control
#define GUIDANCE_PLANE_MIN_PITCH
static float throttle_sum_err
Guidance controller for planes in rotorcraft firmware using basic PID controller no airspeed control.
float course_pre_bank_correction
float climb_throttle_increment
float waypoint_get_x(uint8_t wp_id)
Get X/East coordinate of waypoint in meters.
float waypoint_get_y(uint8_t wp_id)
Get Y/North coordinate of waypoint in meters.
struct HorizontalGuidance guidance_h
struct HorizontalGuidanceSetpoint sp
setpoints
struct RotorcraftNavigation nav
Rotorcraft navigation functions.
#define NAV_SETPOINT_MODE_QUAT
struct EnuCoor_f speed
speed setpoint (in m/s)
uint32_t throttle
throttle command (in pprz_t)
float climb
climb setpoint (in m/s)
#define NAV_SETPOINT_MODE_SPEED
#define NAV_VERTICAL_MODE_CLIMB
#define NAV_VERTICAL_MODE_MANUAL
struct FloatQuat quat
quaternion setpoint
#define NAV_SETPOINT_MODE_ACCEL
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_HORIZONTAL_MODE_GUIDED
#define NAV_HORIZONTAL_MODE_ATTITUDE
float pitch
pitch angle (in radians)
#define NAV_HORIZONTAL_MODE_NONE
struct EnuCoor_f carrot
carrot position (also used for GCS display)
#define NAV_SETPOINT_MODE_POS
Nav setpoint modes these modes correspond to submodes defined by navigation routines to tell which se...
float roll
roll angle (in radians)
General stabilization interface for rotorcrafts.
struct StabilizationSetpoint stab_sp_from_eulers_f(struct FloatEulers *eulers)
struct ThrustSetpoint th_sp_from_thrust_i(int32_t thrust, uint8_t axis)
API to get/set the generic vehicle states.
struct Int32Vect2 pos
horizontal position setpoint in NED.
Thrust setpoint // TODO to a setpoint header Structure to store the desired thrust vector with differ...
Periodic telemetry system header (includes downlink utility and generated code).
int int32_t
Typedef defining 32 bit int type.