Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
AP ( AutoPilot ) tasks. More...
#include <math.h>
#include "firmwares/fixedwing/main_ap.h"
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "inter_mcu.h"
#include "link_mcu.h"
#include "subsystems/gps.h"
#include "subsystems/imu.h"
#include "subsystems/ahrs.h"
#include "state.h"
#include "autopilot.h"
#include "firmwares/fixedwing/nav.h"
#include "generated/flight_plan.h"
#include "subsystems/datalink/telemetry.h"
#include "subsystems/settings.h"
#include "generated/modules.h"
#include "generated/settings.h"
#include "modules/settings/rc_settings.h"
#include "subsystems/abi.h"
#include "led.h"
Go to the source code of this file.
Macros | |
#define | MODULES_C |
#define | ABI_C |
#define | COMMAND_ROLL_TRIM 0 |
#define | COMMAND_PITCH_TRIM 0 |
#define | COMMAND_YAW_TRIM 0 |
#define | TELEMETRY_FREQUENCY 60 |
#define | CATASTROPHIC_BAT_KILL_DELAY 5 |
Maximum time allowed for catastrophic battery level before going into kill mode. More... | |
#define | KILL_MODE_DISTANCE (1.5*MAX_DIST_FROM_HOME) |
Maximum distance from HOME waypoint before going into kill mode. More... | |
#define | MIN_SPEED_FOR_TAKEOFF 5. |
Default minimal speed for takeoff in m/s. More... | |
Functions | |
void | init_ap (void) |
void | handle_periodic_tasks_ap (void) |
void | reporting_task (void) |
Send a series of initialisation messages followed by a stream of periodic ones. More... | |
void | sensors_task (void) |
Run at PERIODIC_FREQUENCY (60Hz if not defined) More... | |
void | monitor_task (void) |
monitor stuff run at 1Hz More... | |
void | event_task_ap (void) |
Variables | |
tid_t | modules_tid |
id for modules_periodic_task() timer More... | |
tid_t | telemetry_tid |
id for telemetry_periodic() timer More... | |
tid_t | sensors_tid |
id for sensors_task() timer More... | |
tid_t | attitude_tid |
id for attitude_loop() timer More... | |
tid_t | navigation_tid |
id for navigation_task() timer More... | |
tid_t | monitor_tid |
id for monitor_task() timer More... | |
AP ( AutoPilot ) tasks.
This process is reponsible for the collecting the different sensors data, calling the appropriate estimation algorithms and running the different control loops.
Definition in file main_ap.c.
#define CATASTROPHIC_BAT_KILL_DELAY 5 |
Maximum time allowed for catastrophic battery level before going into kill mode.
Definition at line 320 of file main_ap.c.
Referenced by monitor_task().
#define KILL_MODE_DISTANCE (1.5*MAX_DIST_FROM_HOME) |
Maximum distance from HOME waypoint before going into kill mode.
Definition at line 325 of file main_ap.c.
Referenced by monitor_task().
#define MIN_SPEED_FOR_TAKEOFF 5. |
Default minimal speed for takeoff in m/s.
Definition at line 330 of file main_ap.c.
Referenced by monitor_task().
#define TELEMETRY_FREQUENCY 60 |
Definition at line 109 of file main_ap.c.
Referenced by init_ap(), and main_init().
void event_task_ap | ( | void | ) |
Definition at line 369 of file main_ap.c.
References autopilot_event(), autopilot_on_rc_frame(), BaroEvent, inter_mcu_received_fbw, link_mcu_event_task(), and mcu_event().
Referenced by sim_periodic_task().
void handle_periodic_tasks_ap | ( | void | ) |
Definition at line 229 of file main_ap.c.
References attitude_loop(), autopilot_periodic(), baro_periodic(), LED_PERIODIC, monitor_task(), navigation_task(), reporting_task(), sensors_task(), and sys_time_check_and_ack_timer().
void init_ap | ( | void | ) |
init done in main_fbw in single MCU
Definition at line 149 of file main_ap.c.
References ahrs_init(), ap_state, autopilot_generated_init(), autopilot_init(), autopilot_static_init(), baro_init(), BARO_PERIODIC_FREQUENCY, Imu::body_to_imu, COMMAND_PITCH_TRIM, COMMAND_ROLL_TRIM, COMMAND_YAW_TRIM, CONTROL_FREQUENCY, downlink_init(), imu, link_mcu_init(), mcu_int_enable, NAVIGATION_FREQUENCY, orientationGetQuat_f(), PPRZ_MUTEX_LOCK, PPRZ_MUTEX_UNLOCK, settings_init(), stateInit(), sys_time_register_timer(), and TELEMETRY_FREQUENCY.
Referenced by sim_init().
void monitor_task | ( | void | ) |
monitor stuff run at 1Hz
Definition at line 334 of file main_ap.c.
References ap_electrical, autopilot, CATASTROPHIC_BAT_KILL_DELAY, datalink_time, DefaultChannel, DefaultDevice, dist2_to_home, pprz_autopilot::flight_time, KILL_MODE_DISTANCE, pprz_autopilot::kill_throttle, pprz_autopilot::launch, MIN_SPEED_FOR_TAKEOFF, sys_time::nb_sec, Square, stateGetHorizontalSpeedNorm_f(), and Electrical::vsupply.
Referenced by handle_periodic_tasks_ap(), and sim_monitor_task().
void reporting_task | ( | void | ) |
Send a series of initialisation messages followed by a stream of periodic ones.
Called at 60Hz.
Definition at line 283 of file main_ap.c.
References autopilot_send_version(), DefaultChannel, DefaultDevice, and DefaultPeriodic.
Referenced by handle_periodic_tasks_ap(), and sim_periodic_task().
void sensors_task | ( | void | ) |
Run at PERIODIC_FREQUENCY (60Hz if not defined)
Definition at line 306 of file main_ap.c.
References update_ahrs_from_sim().
Referenced by handle_periodic_tasks_ap(), and sim_periodic_task().
tid_t attitude_tid |
id for attitude_loop() timer
tid_t monitor_tid |
id for monitor_task() timer
tid_t navigation_tid |
id for navigation_task() timer
tid_t sensors_tid |
id for sensors_task() timer
tid_t telemetry_tid |
id for telemetry_periodic() timer