Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
main_ap.c File Reference

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"
+ Include dependency graph for main_ap.c:

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...
 

Detailed Description

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.

Macro Definition Documentation

#define ABI_C

Definition at line 33 of 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 COMMAND_PITCH_TRIM   0

Definition at line 91 of file main_ap.c.

Referenced by init_ap().

#define COMMAND_ROLL_TRIM   0

Definition at line 87 of file main_ap.c.

Referenced by init_ap().

#define COMMAND_YAW_TRIM   0

Definition at line 95 of file main_ap.c.

Referenced by init_ap().

#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 MODULES_C

Definition at line 31 of file main_ap.c.

#define TELEMETRY_FREQUENCY   60

Definition at line 109 of file main_ap.c.

Referenced by init_ap(), and main_init().

Function Documentation

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void handle_periodic_tasks_ap ( void  )
void init_ap ( void  )
void monitor_task ( void  )
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

tid_t attitude_tid

id for attitude_loop() timer

Definition at line 139 of file main_ap.c.

tid_t modules_tid

id for modules_periodic_task() timer

Definition at line 136 of file main_ap.c.

tid_t monitor_tid

id for monitor_task() timer

Definition at line 143 of file main_ap.c.

tid_t navigation_tid

id for navigation_task() timer

Definition at line 141 of file main_ap.c.

tid_t sensors_tid

id for sensors_task() timer

Definition at line 138 of file main_ap.c.

tid_t telemetry_tid

id for telemetry_periodic() timer

Definition at line 137 of file main_ap.c.