58 PRINT_CONFIG_MSG_VALUE(
"USE_BARO_BOARD is TRUE, reading onboard baro: ",
BARO_BOARD)
81 #include "nps_autopilot.h"
84 #include "generated/modules.h"
98 PRINT_CONFIG_VAR(MODULES_FREQUENCY)
100 #ifndef BARO_PERIODIC_FREQUENCY
101 #define BARO_PERIODIC_FREQUENCY 50
105 #if USE_AHRS && USE_IMU && (defined AHRS_PROPAGATE_FREQUENCY)
106 #if (AHRS_PROPAGATE_FREQUENCY > PERIODIC_FREQUENCY)
107 #warning "PERIODIC_FREQUENCY should be least equal or greater than AHRS_PROPAGATE_FREQUENCY"
108 INFO_VALUE(
"it is recommended to configure in your airframe PERIODIC_FREQUENCY to at least ",
AHRS_PROPAGATE_FREQUENCY)
127 #if LIMIT_EVENT_POLLING
163 #if defined(PPRZ_TRIG_INT_COMPR_FLASH)
164 pprz_trig_int_init();
247 modules_periodic_task();
294 #if defined DATALINK || defined SITL
314 #if PERIODIC_TELEMETRY
322 #define RC_LOST_MODE AP_MODE_FAILSAFE
335 #if FAILSAFE_ON_BAT_CRITICAL
346 #
if NO_GPS_LOST_WITH_RC_VALID
378 TODO(
"calling InsEvent, remove me..")
390 #if FAILSAFE_GROUND_DETECT || KILL_ON_GROUND_DETECT
394 modules_event_task();
Interface to align the AHRS via low-passed measurements at startup.
void mcu_init(void)
Microcontroller peripherals initialization.
Dispatcher to register actual AHRS implementations.
Common barometric sensor implementation.
STATIC_INLINE void telemetry_periodic(void)
void send_autopilot_version(struct transport_tx *trans, struct link_device *dev)
#define AHRS_PROPAGATE_FREQUENCY
void autopilot_init(void)
Autopilot inititalization.
Periodic telemetry system header (includes downlink utility and generated code).
bool_t autopilot_motors_on
uint16_t autopilot_flight_time
flight time in seconds.
Handling of messages coming from ground and other A/Cs.
Main include for ABI (AirBorneInterface).
uint8_t tid_t
sys_time timer id type
STATIC_INLINE void main_init(void)
void imu_periodic(void)
optional.
Integrated Navigation System interface.
STATIC_INLINE void handle_periodic_tasks(void)
tid_t modules_tid
id for modules_periodic_task() timer
bool_t bat_critical
battery critical status
void ahrs_init(void)
AHRS initialization.
void radio_control_init(void)
static uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void autopilot_check_in_flight(bool_t motors_on)
#define RadioControlEvent(_received_frame_handler)
tid_t radio_control_tid
id for radio_control_periodic_task() timer
Hardware independent API for actuators (servos, motor controllers).
void electrical_init(void)
tid_t telemetry_tid
id for telemetry_periodic() timer
Interface for electrical status: supply voltage, current, battery status, etc.
Architecture independent timing functions.
void motor_mixing_init(void)
void radio_control_periodic_task(void)
Device independent GPS code (interface)
bool_t autopilot_in_flight
struct Imu imu
global IMU state
void ins_init(void)
INS initialization.
STATIC_INLINE void main_event(void)
#define DefaultPeriodic
Set default periodic telemetry.
void autopilot_on_rc_frame(void)
Get autopilot mode from two 2way switches.
Hardware independent code for commands handling.
struct RadioControl radio_control
tid_t failsafe_tid
id for failsafe_check() timer
Inertial Measurement Unit interface.
int sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
static bool_t sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
struct OrientationReps body_to_imu
rotation from body to imu frame
void autopilot_periodic(void)
void electrical_periodic(void)
#define DefaultChannel
SITL.
tid_t main_periodic_tid
id for main_periodic() timer
static void sys_time_usleep(uint32_t us)
Arch independent mcu ( Micro Controller Unit ) utilities.
pprz_t commands[COMMANDS_NB]
Storage of intermediate command values.
API to get/set the generic vehicle states.
Persistent settings interface.
void gps_periodic_check(void)
Periodic GPS check.
General stabilization interface for rotorcrafts.
#define TELEMETRY_FREQUENCY
Common code for AP and FBW telemetry.
#define PERIODIC_FREQUENCY
arch independent LED (Light Emitting Diodes) API
STATIC_INLINE void main_periodic(void)
void mcu_event(void)
MCU event functions.
struct Electrical electrical
void intermcu_set_actuators(pprz_t *command_values, uint8_t ap_mode)
STATIC_INLINE void failsafe_check(void)
#define BARO_PERIODIC_FREQUENCY
void autopilot_set_mode(uint8_t new_autopilot_mode)
void ahrs_aligner_init(void)
static void DetectGroundEvent(void)
Ground detection based on vertical acceleration.
void gps_init(void)
initialize the global GPS state
static struct FloatQuat * orientationGetQuat_f(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (float).
tid_t electrical_tid
id for electrical_periodic() timer
#define RC_LOST_MODE
mode to enter when RC is lost while using a mode with RC input (not AP_MODE_NAV)