Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
main_fbw.c File Reference

FBW ( FlyByWire ) process. More...

#include "firmwares/fixedwing/main_fbw.h"
#include "generated/airframe.h"
#include "mcu.h"
#include "mcu_periph/sys_time.h"
#include "subsystems/commands.h"
#include "subsystems/actuators.h"
#include "subsystems/electrical.h"
#include "subsystems/radio_control.h"
#include "firmwares/fixedwing/autopilot.h"
#include "paparazzi.h"
#include "mcu_periph/i2c.h"
#include "mcu_periph/uart.h"
#include "subsystems/datalink/telemetry.h"
#include "inter_mcu.h"
#include "link_mcu.h"
+ Include dependency graph for main_fbw.c:

Go to the source code of this file.

Functions

void radio_lost_mode (void)
 Defines behavior when the RC is lost, default goes to AUTO. More...
 
static void handle_rc_frame (void)
 
void radio_control_event (void)
 
void radio_control_periodic_handle (void)
 
void fbw_datalink_periodic_handle (void)
 
void fbw_datalink_event_handle (void)
 
void update_actuators (void)
 
void inter_mcu_periodic_handle (void)
 
void inter_mcu_event_handle (void)
 
static void send_commands (struct transport_tx *trans, struct link_device *dev)
 
static void send_fbw_status (struct transport_tx *trans, struct link_device *dev)
 
static void send_rc (struct transport_tx *trans, struct link_device *dev)
 
void periodic_telemetry_handle (void)
 
void init_fbw (void)
 
void event_task_fbw (void)
 
void periodic_task_fbw (void)
 
void handle_periodic_tasks_fbw (void)
 

Variables

uint8_t fbw_mode
 
pprz_t command_roll_trim
 Trim commands for roll, pitch and yaw. More...
 
pprz_t command_pitch_trim
 
pprz_t command_yaw_trim
 
volatile uint8_t fbw_new_actuators = 0
 
uint8_t ap_has_been_ok = false
 
tid_t fbw_periodic_tid
 id for periodic_task_fbw() timer More...
 
tid_t electrical_tid
 id for electrical_periodic() timer More...
 

Detailed Description

FBW ( FlyByWire ) process.

This process is responsible for decoding radio control, generating actuators signals either from the radio control or from the commands provided by the AP (autopilot) process. It also performs a telemetry task and a low level monitoring ( for parameters like the supply )

Definition in file main_fbw.c.

Function Documentation

void event_task_fbw ( void  )

Definition at line 422 of file main_fbw.c.

References fbw_datalink_event_handle(), inter_mcu_event_handle(), mcu_event(), and radio_control_event().

Referenced by sim_periodic_task().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void fbw_datalink_event_handle ( void  )

Definition at line 150 of file main_fbw.c.

Referenced by event_task_fbw().

+ Here is the caller graph for this function:

void fbw_datalink_periodic_handle ( void  )

Definition at line 149 of file main_fbw.c.

Referenced by periodic_task_fbw().

+ Here is the caller graph for this function:

void handle_periodic_tasks_fbw ( void  )

Definition at line 446 of file main_fbw.c.

References electrical_periodic(), electrical_tid, fbw_periodic_tid, periodic_task_fbw(), and sys_time_check_and_ack_timer().

+ Here is the call graph for this function:

static void handle_rc_frame ( void  )
inlinestatic

Definition at line 112 of file main_fbw.c.

References commands, fbw_mode, FBW_MODE_MANUAL, FBW_MODE_OF_PPRZ, fbw_new_actuators, radio_control, RADIO_MODE, and RadioControl::values.

Referenced by radio_control_event().

+ Here is the caller graph for this function:

void inter_mcu_event_handle ( void  )

Definition at line 315 of file main_fbw.c.

Referenced by event_task_fbw().

+ Here is the caller graph for this function:

void inter_mcu_periodic_handle ( void  )

Definition at line 314 of file main_fbw.c.

Referenced by periodic_task_fbw().

+ Here is the caller graph for this function:

void periodic_task_fbw ( void  )

Definition at line 435 of file main_fbw.c.

References fbw_datalink_periodic_handle(), inter_mcu_periodic_handle(), periodic_telemetry_handle(), and radio_control_periodic_handle().

Referenced by handle_periodic_tasks_fbw(), and sim_periodic_task().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void periodic_telemetry_handle ( void  )

Definition at line 353 of file main_fbw.c.

References DefaultChannel, DefaultDevice, and DefaultPeriodic.

Referenced by periodic_task_fbw().

+ Here is the caller graph for this function:

void radio_control_event ( void  )

Definition at line 121 of file main_fbw.c.

References handle_rc_frame(), and RadioControlEvent.

Referenced by event_task_fbw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void radio_control_periodic_handle ( void  )

Definition at line 126 of file main_fbw.c.

References fbw_mode, FBW_MODE_MANUAL, radio_control, radio_control_periodic_task(), radio_lost_mode(), RC_REALLY_LOST, and RadioControl::status.

Referenced by periodic_task_fbw().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void radio_lost_mode ( void  )

Defines behavior when the RC is lost, default goes to AUTO.

Definition at line 88 of file main_fbw.c.

References fbw_mode, and FBW_MODE_AUTO.

Referenced by radio_control_periodic_handle().

+ Here is the caller graph for this function:

static void send_commands ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 320 of file main_fbw.c.

References commands.

Referenced by init_fbw().

+ Here is the caller graph for this function:

static void send_fbw_status ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 326 of file main_fbw.c.

References Electrical::current, electrical, fbw_mode, RadioControl::frame_rate, radio_control, RadioControl::status, and Electrical::vsupply.

Referenced by init_fbw(), and link_mcu_init().

+ Here is the caller graph for this function:

static void send_rc ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 332 of file main_fbw.c.

References radio_control, RADIO_CONTROL_NB_CHANNEL, and RadioControl::values.

Referenced by init_fbw().

+ Here is the caller graph for this function:

void update_actuators ( void  )

Definition at line 181 of file main_fbw.c.

Variable Documentation

uint8_t ap_has_been_ok = false

Definition at line 74 of file main_fbw.c.

pprz_t command_pitch_trim

Definition at line 69 of file main_fbw.c.

pprz_t command_roll_trim

Trim commands for roll, pitch and yaw.

These are updated from the trim commands in ap_state via inter_mcu

Definition at line 68 of file main_fbw.c.

pprz_t command_yaw_trim

Definition at line 70 of file main_fbw.c.

tid_t electrical_tid

id for electrical_periodic() timer

Definition at line 77 of file main_fbw.c.

Referenced by handle_periodic_tasks(), handle_periodic_tasks_fbw(), init_fbw(), and main_init().

volatile uint8_t fbw_new_actuators = 0

Definition at line 72 of file main_fbw.c.

Referenced by handle_rc_frame(), and init_fbw().

tid_t fbw_periodic_tid

id for periodic_task_fbw() timer

Definition at line 76 of file main_fbw.c.

Referenced by handle_periodic_tasks_fbw(), and init_fbw().