35#include "generated/flight_plan.h"
50#define RC_LOST_MODE AP_MODE_HOME
55#ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
59static void new_att_cb(
uint8_t sender_id __attribute__((unused)),
60 uint32_t stamp __attribute__((unused)),
61 struct Int32Rates *gyro __attribute__((unused)))
87#ifdef AHRS_TRIGGERED_ATTITUDE_LOOP
103#ifdef SetAutoCommandsFromRC
105#elif defined RADIO_YAW && defined COMMAND_YAW
109#if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
119#if H_CTL_YAW_LOOP && defined RADIO_YAW
142 if (new_autopilot_mode !=
autopilot.mode) {
179#if DOWNLINK && !defined PERIOD_NAVIGATION_Ap_0
193#ifdef H_CTL_RATE_LOOP
218#if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
222#if defined RADIO_CALIB && defined RADIO_CONTROL_SETTINGS
224 bool calib_mode_changed = RcSettingsModeUpdate(
radio_control.values);
225 rc_settings(calib_mode_changed || pprz_mode_changed);
244#ifdef RADIO_KILL_SWITCH
262#if USE_GPS && (defined FAILSAFE_DELAY_WITHOUT_GPS)
266 static bool gps_lost =
false;
279 }
else if (gps_lost) {
303#if CTRL_VERTICAL_LANDING
316#if CTRL_VERTICAL_LANDING
320#if defined V_CTL_THROTTLE_IDLE
324#ifdef V_CTL_POWER_CTL_BAT_NOMINAL
355#if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
364#ifndef RADIO_AUTO_MODE
370 INFO(
"Using RADIO_AUTO_MODE to switch between AUTO1 and AUTO2.")
Main include for ABI (AirBorneInterface).
struct abi_struct abi_event
#define ABI_BROADCAST
Broadcast address.
void WEAK autopilot_event(void)
AP event call.
bool autopilot_set_mode(uint8_t new_autopilot_mode)
set autopilot mode
uint8_t autopilot_get_mode(void)
get autopilot mode
struct pprz_autopilot autopilot
Global autopilot structure.
void autopilot_set_kill_throttle(bool kill)
set kill throttle Kill always kills, also when motors_on is already false (fixedwing in flight).
Core autopilot interface common to all firmwares.
void common_nav_periodic_task()
Common code for AP and FBW telemetry.
struct Electrical electrical
pprz_t v_ctl_throttle_setpoint
void v_ctl_climb_loop(void)
Auto-throttle inner loop.
float v_ctl_pitch_setpoint
void v_ctl_throttle_slew(void)
Computes slewed throttle from throttle setpoint called at 20Hz.
pprz_t v_ctl_throttle_slewed
void v_ctl_altitude_loop(void)
outer loop
#define LATERAL_MODE_MANUAL
#define LATERAL_MODE_COURSE
void autopilot_static_init(void)
Static autopilot API.
void navigation_task(void)
Compute desired_course.
void autopilot_static_periodic(void)
static uint8_t pprz_mode_update(void)
Update paparazzi mode from RC.
void autopilot_static_SetModeHandler(float new_autopilot_mode)
void autopilot_static_set_motors_on(bool motors_on)
#define RC_LOST_MODE
mode to enter when RC is lost in AP_MODE_MANUAL or AP_MODE_AUTO1
void autopilot_failsafe_checks(void)
Failsafe checks.
void autopilot_static_on_rc_frame(void)
Function to be called when a message from FBW is available.
void autopilot_static_set_mode(uint8_t new_autopilot_mode)
Fixedwing autopilot modes (static implementation).
#define AP_MODE_MANUAL
AP modes.
#define AP_MODE_GPS_OUT_OF_ORDER
#define AP_COMMAND_SET_THROTTLE(_throttle)
#define AP_COMMAND_SET_CL(_cl)
#define AP_COMMAND_SET_PITCH(_pitch)
#define THROTTLE_THRESHOLD_TAKEOFF
Takeoff detection threshold from throttle.
#define AP_COMMAND_SET_ROLL(_roll)
AP command setter macros for usual commands.
#define FLOAT_OF_PPRZ(pprz, center, travel)
pprz_t to float with saturation
#define AP_COMMAND_SET_YAW(_yaw)
#define AP_MODE_OF_PULSE(pprz)
Get mode from pulse.
Fixed wing horizontal control.
struct GpsState gps
global GPS state
Device independent GPS code (interface).
void v_ctl_landing_loop(void)
#define V_CTL_MODE_AUTO_THROTTLE
#define V_CTL_MODE_LANDING
#define V_CTL_MODE_AUTO_ALT
#define V_CTL_MODE_AUTO_CLIMB
volatile uint8_t new_ins_attitude
void nav_home(void)
Home mode navigation (circle around HOME).
pprz_t nav_throttle_setpoint
void nav_without_gps(void)
Failsafe navigation without position estimation.
void nav_periodic_task(void)
Navigation main: call to the code generated from the XML flight plan.
Fixedwing Navigation library.
#define SEND_NAVIGATION(_trans, _dev)
Optional exceptions triggeringg HOME_MODE 1) GEOFENCE_DATALINK_LOST_TIME: go to HOME mode if datalink...
static bool higher_than_max_altitude(void)
static bool datalink_lost(void)
struct RadioControl radio_control
#define RadioControlIsLost()
static pprz_t radio_control_get(uint8_t idx)
Get a radio control channel value.
#define RADIO_KILL_SWITCH
#define RADIO_ROLL
Redefining RADIO_* Do not use with radio.h (ppm rc).
void rc_settings(bool mode_changed)
Includes generated code from tuning_rc.xml.
#define UNLOCKED_HOME_MODE
static const ShellCommand commands[]
void h_ctl_course_loop(void)
float h_ctl_pitch_setpoint
pprz_t h_ctl_elevator_setpoint
float h_ctl_roll_setpoint
pprz_t h_ctl_aileron_setpoint
void h_ctl_attitude_loop(void)
API to get/set the generic vehicle states.
volatile uint32_t nb_sec
full seconds since startup
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.