Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
main_ap.c File Reference
#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

◆ ABI_C

#define ABI_C

Definition at line 33 of file main_ap.c.

◆ CATASTROPHIC_BAT_KILL_DELAY

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

◆ COMMAND_PITCH_TRIM

#define COMMAND_PITCH_TRIM   0

Definition at line 91 of file main_ap.c.

◆ COMMAND_ROLL_TRIM

#define COMMAND_ROLL_TRIM   0

Definition at line 87 of file main_ap.c.

◆ COMMAND_YAW_TRIM

#define COMMAND_YAW_TRIM   0

Definition at line 95 of file main_ap.c.

◆ KILL_MODE_DISTANCE

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

◆ MIN_SPEED_FOR_TAKEOFF

#define MIN_SPEED_FOR_TAKEOFF   5.

Default minimal speed for takeoff in m/s.

Definition at line 330 of file main_ap.c.

◆ MODULES_C

#define MODULES_C

Definition at line 31 of file main_ap.c.

◆ TELEMETRY_FREQUENCY

#define TELEMETRY_FREQUENCY   60

Definition at line 109 of file main_ap.c.

Function Documentation

◆ event_task_ap()

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:

◆ handle_periodic_tasks_ap()

void handle_periodic_tasks_ap ( void  )

◆ init_ap()

◆ monitor_task()

void monitor_task ( void  )

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ attitude_tid

tid_t attitude_tid

id for attitude_loop() timer

Definition at line 139 of file main_ap.c.

Referenced by handle_periodic_tasks_ap(), and init_ap().

◆ modules_tid

tid_t modules_tid

id for modules_periodic_task() timer

Definition at line 136 of file main_ap.c.

Referenced by handle_periodic_tasks(), handle_periodic_tasks_ap(), init_ap(), and main_init().

◆ monitor_tid

tid_t monitor_tid

id for monitor_task() timer

Definition at line 143 of file main_ap.c.

Referenced by handle_periodic_tasks_ap(), and init_ap().

◆ navigation_tid

tid_t navigation_tid

id for navigation_task() timer

Definition at line 141 of file main_ap.c.

Referenced by handle_periodic_tasks_ap(), and init_ap().

◆ sensors_tid

tid_t sensors_tid

id for sensors_task() timer

Definition at line 138 of file main_ap.c.

Referenced by handle_periodic_tasks_ap(), and init_ap().

◆ telemetry_tid

tid_t telemetry_tid

id for telemetry_periodic() timer

Definition at line 137 of file main_ap.c.

Referenced by handle_periodic_tasks(), handle_periodic_tasks_ap(), init_ap(), and main_init().