55 PRINT_CONFIG_MSG_VALUE(
"USE_BARO_BOARD is TRUE, reading onboard baro: ",
BARO_BOARD)
63 #include "generated/flight_plan.h"
66 #if PERIODIC_TELEMETRY
72 #include "generated/modules.h"
73 #include "generated/settings.h"
74 #if defined RADIO_CONTROL || defined RADIO_CONTROL_AUTO1
86 #ifndef COMMAND_ROLL_TRIM
87 #define COMMAND_ROLL_TRIM 0
90 #ifndef COMMAND_PITCH_TRIM
91 #define COMMAND_PITCH_TRIM 0
94 #ifndef COMMAND_YAW_TRIM
95 #define COMMAND_YAW_TRIM 0
99 PRINT_CONFIG_VAR(PERIODIC_FREQUENCY)
100 #if !USE_GENERATED_AUTOPILOT
108 #ifndef TELEMETRY_FREQUENCY
109 #define TELEMETRY_FREQUENCY 60
116 PRINT_CONFIG_VAR(MODULES_FREQUENCY)
127 #ifdef AHRS_PROPAGATE_FREQUENCY
128 #if (AHRS_PROPAGATE_FREQUENCY > PERIODIC_FREQUENCY)
129 #warning "PERIODIC_FREQUENCY should be least equal or greater than AHRS_PROPAGATE_FREQUENCY"
130 INFO_VALUE(
"it is recommended to configure in your airframe PERIODIC_FREQUENCY to at least ",
AHRS_PROPAGATE_FREQUENCY)
140 #if !USE_GENERATED_AUTOPILOT
158 #if defined(PPRZ_TRIG_INT_COMPR_FLASH)
159 pprz_trig_int_init();
177 #if defined MCU_SPI_LINK || defined MCU_UART_LINK || defined MCU_CAN_LINK
188 #if USE_GENERATED_AUTOPILOT
198 #if !USE_GENERATED_AUTOPILOT
242 #if USE_GENERATED_AUTOPILOT
252 #ifndef AHRS_TRIGGERED_ATTITUDE_LOOP
261 modules_periodic_task();
297 #if PERIODIC_TELEMETRY
309 #if USE_AHRS && defined SITL && !USE_NPS
314 #ifdef LOW_BATTERY_KILL_DELAY
315 #warning LOW_BATTERY_KILL_DELAY has been renamed to CATASTROPHIC_BAT_KILL_DELAY, please update your airframe file!
319 #ifndef CATASTROPHIC_BAT_KILL_DELAY
320 #define CATASTROPHIC_BAT_KILL_DELAY 5
324 #ifndef KILL_MODE_DISTANCE
325 #define KILL_MODE_DISTANCE (1.5*MAX_DIST_FROM_HOME)
329 #ifndef MIN_SPEED_FOR_TAKEOFF
330 #define MIN_SPEED_FOR_TAKEOFF 5.
339 #if defined DATALINK || defined SITL
349 #if !USE_GENERATED_AUTOPILOT
382 modules_event_task();
384 #if defined MCU_SPI_LINK || defined MCU_UART_LINK
bool launch
request launch
Communication between fbw and ap processes.
Dispatcher to register actual AHRS implementations.
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
Common barometric sensor implementation.
tid_t attitude_tid
id for attitude_loop() timer
#define AHRS_PROPAGATE_FREQUENCY
Variable setting though the radio control.
Periodic telemetry system header (includes downlink utility and generated code).
tid_t sensors_tid
id for sensors_task() timer
#define MIN_SPEED_FOR_TAKEOFF
Default minimal speed for takeoff in m/s.
void autopilot_generated_init(void)
Main include for ABI (AirBorneInterface).
#define PPRZ_MUTEX_LOCK(_mtx)
tid_t monitor_tid
id for monitor_task() timer
uint16_t flight_time
flight time in seconds
void navigation_task(void)
Compute desired_course.
#define CONTROL_FREQUENCY
float vsupply
supply voltage in V
void autopilot_init(void)
Autopilot initialization function.
struct Imu imu
global IMU state
#define CATASTROPHIC_BAT_KILL_DELAY
Maximum time allowed for catastrophic battery level before going into kill mode.
float dist2_to_home
squared distance to home waypoint
void ahrs_init(void)
AHRS initialization.
void link_mcu_event_task(void)
struct pprz_autopilot autopilot
Global autopilot structure.
struct ap_state * ap_state
tid_t navigation_tid
id for navigation_task() timer
Common transport functions for the communication between FBW and AP.
Architecture independent timing functions.
Device independent GPS code (interface)
#define COMMAND_ROLL_TRIM
#define NAVIGATION_FREQUENCY
void update_ahrs_from_sim(void)
int8_t tid_t
sys_time timer id type
#define DefaultPeriodic
Set default periodic telemetry.
#define TELEMETRY_FREQUENCY
void WEAK autopilot_event(void)
AP event call.
Inertial Measurement Unit interface.
struct OrientationReps body_to_imu
rotation from body to imu frame
#define KILL_MODE_DISTANCE
Maximum distance from HOME waypoint before going into kill mode.
void autopilot_static_init(void)
Static autopilot API.
Core autopilot interface common to all firmwares.
volatile bool inter_mcu_received_fbw
tid_t telemetry_tid
id for telemetry_periodic() timer
#define COMMAND_PITCH_TRIM
Arch independent mcu ( Micro Controller Unit ) utilities.
API to get/set the generic vehicle states.
Persistent settings interface.
static bool sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
volatile uint32_t nb_sec
full seconds since startup
#define BARO_PERIODIC_FREQUENCY
void autopilot_periodic(void)
AP periodic call.
void reporting_task(void)
Send a series of initialisation messages followed by a stream of periodic ones.
void handle_periodic_tasks_ap(void)
void autopilot_on_rc_frame(void)
RC frame handler.
arch independent LED (Light Emitting Diodes) API
void monitor_task(void)
monitor stuff run at 1Hz
void sensors_task(void)
Run at PERIODIC_FREQUENCY (60Hz if not defined)
void mcu_event(void)
MCU event functions.
bool kill_throttle
allow autopilot to use throttle
Fixedwing Navigation library.
struct Electrical ap_electrical
void autopilot_send_version(void)
send autopilot version
tid_t modules_tid
id for modules_periodic_task() timer
#define PPRZ_MUTEX_UNLOCK(_mtx)
AP ( AutoPilot ) process API.
tid_t sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
static struct FloatQuat * orientationGetQuat_f(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (float).