 |
Paparazzi UAS
v6.1.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
44 #include "generated/modules.h"
48 PRINT_CONFIG_VAR(PERIODIC_FREQUENCY)
50 #if !(SYS_TIME_FREQUENCY/PERIODIC_FREQUENCY*PERIODIC_FREQUENCY == SYS_TIME_FREQUENCY)
51 #warning "The SYS_TIME_FREQUENCY can not be divided by PERIODIC_FREQUENCY. Make sure this is the case for correct timing."
59 #if USE_AHRS && USE_IMU && (defined AHRS_PROPAGATE_FREQUENCY)
60 #if (AHRS_PROPAGATE_FREQUENCY > PERIODIC_FREQUENCY)
61 #warning "PERIODIC_FREQUENCY should be least equal or greater than AHRS_PROPAGATE_FREQUENCY"
62 INFO_VALUE(
"it is recommended to configure in your airframe PERIODIC_FREQUENCY to at least ",
AHRS_PROPAGATE_FREQUENCY)
76 #define SYS_PERIOD (1.f / PERIODIC_FREQUENCY)
77 #define SENSORS_PERIOD (1.f / PERIODIC_FREQUENCY)
78 #define DATALINK_PERIOD (1.f / TELEMETRY_FREQUENCY)
84 modules_sensors_init();
85 modules_estimation_init();
90 modules_control_init();
91 modules_actuators_init();
92 modules_datalink_init();
93 modules_default_init();
131 modules_sensors_periodic_task();
136 modules_radio_control_periodic_task();
140 modules_estimation_periodic_task();
141 modules_control_periodic_task();
142 modules_default_periodic_task();
143 #if USE_THROTTLE_CURVES
151 modules_actuators_periodic_task();
158 modules_mcu_periodic_task();
159 modules_core_periodic_task();
165 modules_datalink_periodic_task();
166 #if defined DATALINK || defined SITL
190 #if PERIODIC_TELEMETRY
198 #define RC_LOST_MODE AP_MODE_FAILSAFE
203 #if !USE_GENERATED_AUTOPILOT
215 #if FAILSAFE_ON_BAT_CRITICAL
225 #
if NO_GPS_LOST_WITH_RC_VALID
228 #ifdef NO_GPS_LOST_WITH_DATALINK_TIME
241 #endif // !USE_GENERATED_AUTOPILOT
248 modules_mcu_event_task();
249 modules_core_event_task();
250 modules_sensors_event_task();
251 modules_estimation_event_task();
252 modules_radio_control_event_task();
256 modules_control_event_task();
257 modules_actuators_event_task();
258 modules_datalink_event_task();
259 modules_default_event_task();
bool autopilot_get_motors_on(void)
get motors status
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
void radio_control_periodic_task(void)
tid_t sys_time_register_timer_offset(tid_t timer, float offset, sys_time_cb cb)
Register a new system timer with an fixed offset from another one.
uint16_t flight_time
flight time in seconds
struct OrientationReps body_to_imu
rotation from body to imu frame
bool use_rc
enable/disable RC input
#define RC_LOST_MODE
mode to enter when RC is lost while using a mode with RC input (not AP_MODE_NAV)
#define AP_MODE_KILL
Static autopilot modes.
tid_t modules_radio_control_tid
bool autopilot_in_flight(void)
get in_flight flag
void autopilot_send_version(void)
send autopilot version
struct pprz_autopilot autopilot
Global autopilot structure.
static struct FloatQuat * orientationGetQuat_f(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (float).
void telemetry_periodic(void)
int8_t tid_t
sys_time timer id type
void handle_periodic_tasks(void)
arch independent LED (Light Emitting Diodes) API
struct Imu imu
global IMU state
void radio_control_init(void)
uint16_t f
Camera baseline, in meters (i.e. horizontal distance between the two cameras of the stereo setup)
#define TELEMETRY_FREQUENCY
static const ShellCommand commands[]
#define RadioControlEvent(_received_frame_handler)
void throttle_curve_run(pprz_t cmds[], uint8_t ap_mode)
Run the throttle curve and generate the output throttle and pitch This depends on the FMODE(flight mo...
bool bat_critical
battery critical status
void intermcu_set_actuators(pprz_t *command_values, uint8_t ap_mode)
bool autopilot_set_mode(uint8_t new_autopilot_mode)
set autopilot mode
tid_t modules_mcu_core_tid
IDs for timers.
tid_t sys_time_register_timer(float duration, sys_time_cb cb)
Register a new system timer.
void WEAK autopilot_check_in_flight(bool motors_on)
in flight check utility function actual implementation is firmware dependent
#define AHRS_PROPAGATE_FREQUENCY
struct Electrical electrical
uint8_t autopilot_get_mode(void)
get autopilot mode
void autopilot_on_rc_frame(void)
RC frame handler.
void failsafe_check(void)
tid_t modules_sensors_tid
tid_t modules_datalink_tid
tid_t failsafe_tid
id for failsafe_check() timer FIXME
#define DefaultPeriodic
Set default periodic telemetry.
static bool sys_time_check_and_ack_timer(tid_t id)
Check if timer has elapsed.
struct RadioControl radio_control