28#include "generated/modules.h"
41#ifndef CMH_TILT_FORWARD
42#define CMH_TILT_FORWARD 0
46#ifndef CMH_TILT_VERTICAL
47#define CMH_TILT_VERTICAL 8700
51#ifndef CMH_TILT_DIFF_MAX
52#define CMH_TILT_DIFF_MAX (MAX_PPRZ-CMH_TILT_VERTICAL)
57#define CMH_MOTOR_IDLE 800
61#ifndef CMH_TRANSITION_TIME
62#define CMH_TRANSITION_TIME 4.f
66#ifndef CMH_TRANSITION_AIRSPEED
67#define CMH_TRANSITION_AIRSPEED 10.f
70#define TRANSITION_TO_HOVER false
71#define TRANSITION_TO_FORWARD true
struct pprz_autopilot autopilot
Global autopilot structure.
bool autopilot_get_motors_on(void)
get motors status
bool autopilot_in_flight(void)
get in_flight flag
Core autopilot interface common to all firmwares.
pprz_t throttle
throttle level as will be displayed in GCS
Hardware independent code for commands handling.
void control_mixing_heewing_nav_enter(void)
void control_mixing_heewing_nav_run(void)
void stabilization_indi_set_wls_settings(void)
Function that sets the u_min, u_max and u_pref if function not elsewhere defined.
static float transition_ratio
void control_mixing_heewing_manual(void)
Direct manual control in plane style flight.
void control_mixing_heewing_attitude_plane(void)
void control_mixing_heewing_init(void)
#define CMH_TILT_VERTICAL
void control_mixing_heewing_attitude_direct(void)
Stabilization in attitude direct mode.
void control_mixing_heewing_attitude_plane_enter(void)
static int32_t command_from_transition(int32_t hover_cmd, int32_t forward_cmd)
#define CMH_TRANSITION_AIRSPEED
static const float transition_increment
#define CMH_TRANSITION_TIME
#define CMH_TILT_DIFF_MAX
#define TRANSITION_TO_FORWARD
#define TRANSITION_TO_HOVER
static void transition_run(bool to_forward)
void control_mixing_heewing_attitude_direct_enter(void)
#define CMH_ACT_MOTOR_RIGHT
#define CMH_ACT_MOTOR_TAIL
#define CMH_ACT_MOTOR_LEFT
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static bool stateIsAirspeedValid(void)
test if air speed is available.
static float stateGetAirspeed_f(void)
Get airspeed (float).
struct GuidancePlane guidance_plane
Guidance PID structyre.
struct StabilizationSetpoint guidance_plane_attitude_from_nav(bool in_flight UNUSED)
run horizontal control loop for position and speed control
struct ThrustSetpoint guidance_plane_thrust_from_nav(bool in_flight)
run vertical control loop for position and speed control
Guidance controller for planes in rotorcraft firmware using basic PID controller no airspeed control.
Hardware independent API for actuators (servos, motor controllers).
Generic interface for radio control modules.
static pprz_t radio_control_get(uint8_t idx)
Get a radio control channel value.
#define RADIO_ROLL
Redefining RADIO_* Do not use with radio.h (ppm rc)
void guidance_h_mode_changed(uint8_t new_mode)
struct StabilizationSetpoint guidance_h_run(bool in_flight)
#define GUIDANCE_H_MODE_NAV
#define GUIDANCE_H_MODE_NONE
void guidance_v_mode_changed(uint8_t new_mode)
struct ThrustSetpoint guidance_v_run(bool in_flight)
Guidance vertical run functions.
#define GUIDANCE_V_MODE_RC_DIRECT
#define GUIDANCE_V_MODE_NAV
struct RotorcraftNavigation nav
Rotorcraft navigation functions.
#define NAV_HORIZONTAL_MODE_CIRCLE
#define NAV_HORIZONTAL_MODE_ROUTE
float heading
heading setpoint (in radians)
static const ShellCommand commands[]
struct Stabilization stabilization
void stabilization_mode_changed(uint8_t new_mode, uint8_t submode)
Check mode change.
void stabilization_run(bool in_flight, struct StabilizationSetpoint *sp, struct ThrustSetpoint *thrust, int32_t *cmd)
Call default stabilization control.
struct StabilizationSetpoint stab_sp_from_eulers_f(struct FloatEulers *eulers)
struct ThrustSetpoint th_sp_from_thrust_i(int32_t thrust, uint8_t axis)
General stabilization interface for rotorcrafts.
#define STABILIZATION_MODE_ATTITUDE
#define STABILIZATION_ATT_SUBMODE_HEADING
Stabilization sub-modes for attitude.
struct StabilizationSetpoint rc_sp
Keep it ? FIXME.
int32_t cmd[COMMANDS_NB]
output command vector, range from [-MAX_PPRZ:MAX_PPRZ] (store for messages)
#define STABILIZATION_MODE_NONE
Stabilization modes.
void stabilization_attitude_plane_pid_run(bool in_flight, struct StabilizationSetpoint *sp, struct ThrustSetpoint *thrust, int32_t *cmd)
void stabilization_attitude_plane_pid_enter(void)
Basic fixed-wing attitude stabilization in euler float version.
float act_pref[INDI_NUM_ACT]
API to get/set the generic vehicle states.
Thrust setpoint // TODO to a setpoint header Structure to store the desired thrust vector with differ...
int int32_t
Typedef defining 32 bit int type.
float u_pref[WLS_N_U_MAX]