Paparazzi UAS  v5.15_devel-81-gd13dafb
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
autopilot_firmware.c File Reference
#include "firmwares/rotorcraft/autopilot_firmware.h"
#include "generated/modules.h"
#include <stdint.h>
#include "subsystems/electrical.h"
#include "subsystems/datalink/telemetry.h"
#include "subsystems/radio_control.h"
#include "subsystems/gps.h"
#include "modules/nav/nav_geofence.h"
+ Include dependency graph for autopilot_firmware.c:

Go to the source code of this file.

Macros

#define AUTOPILOT_IN_FLIGHT_TIME   20
 time steps for in_flight detection (at 20Hz, so 20=1second) More...
 
#define AUTOPILOT_IN_FLIGHT_MIN_SPEED   0.2
 minimum vertical speed for in_flight condition in m/s More...
 
#define AUTOPILOT_IN_FLIGHT_MIN_ACCEL   2.0
 minimum vertical acceleration for in_flight condition in m/s^2 More...
 
#define AUTOPILOT_IN_FLIGHT_MIN_THRUST   500
 minimum thrust for in_flight condition in pprz_t units (max = 9600) More...
 
#define THRESHOLD_GROUND_DETECT   25.0
 Z-acceleration threshold to detect ground in m/s^2. More...
 

Functions

static void send_status (struct transport_tx *trans, struct link_device *dev)
 
static void send_energy (struct transport_tx *trans, struct link_device *dev)
 
static void send_fp (struct transport_tx *trans, struct link_device *dev)
 
static void send_fp_min (struct transport_tx *trans, struct link_device *dev)
 
static void send_rotorcraft_rc (struct transport_tx *trans, struct link_device *dev)
 
static void send_rotorcraft_cmd (struct transport_tx *trans, struct link_device *dev)
 
void autopilot_firmware_init (void)
 Init function. More...
 
void autopilot_event (void)
 autopilot event function More...
 
void autopilot_reset_in_flight_counter (void)
 reset in_flight counter More...
 
void autopilot_check_in_flight (bool motors_on)
 in flight check utility function More...
 

Variables

uint8_t autopilot_mode_auto2
 
static uint32_t autopilot_in_flight_counter
 

Macro Definition Documentation

#define AUTOPILOT_IN_FLIGHT_MIN_ACCEL   2.0

minimum vertical acceleration for in_flight condition in m/s^2

Definition at line 67 of file autopilot_firmware.c.

Referenced by autopilot_check_in_flight().

#define AUTOPILOT_IN_FLIGHT_MIN_SPEED   0.2

minimum vertical speed for in_flight condition in m/s

Definition at line 62 of file autopilot_firmware.c.

Referenced by autopilot_check_in_flight().

#define AUTOPILOT_IN_FLIGHT_MIN_THRUST   500

minimum thrust for in_flight condition in pprz_t units (max = 9600)

Definition at line 72 of file autopilot_firmware.c.

Referenced by autopilot_check_in_flight().

#define AUTOPILOT_IN_FLIGHT_TIME   20

time steps for in_flight detection (at 20Hz, so 20=1second)

Definition at line 57 of file autopilot_firmware.c.

Referenced by autopilot_check_in_flight().

#define THRESHOLD_GROUND_DETECT   25.0

Z-acceleration threshold to detect ground in m/s^2.

Definition at line 77 of file autopilot_firmware.c.

Referenced by autopilot_event().

Function Documentation

void autopilot_check_in_flight ( bool  motors_on)
void autopilot_event ( void  )

autopilot event function

Autopilot event check function.

used for automatic ground detection

Definition at line 204 of file autopilot_firmware.c.

References AP_MODE_FAILSAFE, autopilot, pprz_autopilot::detect_ground_once, pprz_autopilot::ground_detected, pprz_autopilot::mode, stateGetAccelNed_f(), THRESHOLD_GROUND_DETECT, and NedCoor_f::z.

+ Here is the call graph for this function:

void autopilot_firmware_init ( void  )
void autopilot_reset_in_flight_counter ( void  )

reset in_flight counter

reset in_flight counter actual implementation is firmware dependent

Definition at line 222 of file autopilot_firmware.c.

References autopilot_in_flight_counter.

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

Definition at line 109 of file autopilot_firmware.c.

References autopilot, Electrical::charge, Electrical::current, electrical, Electrical::energy, MAX_PPRZ, pprz_autopilot::throttle, and Electrical::vsupply.

Referenced by autopilot_firmware_init().

+ Here is the caller graph for this function:

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

Definition at line 140 of file autopilot_firmware.c.

References gps, GpsState::gspeed, stateGetHorizontalSpeedNorm_f(), and stateGetPositionEnu_i().

Referenced by autopilot_firmware_init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 174 of file autopilot_firmware.c.

References stabilization_cmd.

Referenced by autopilot_firmware_init().

+ Here is the caller graph for this function:

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

Definition at line 156 of file autopilot_firmware.c.

References radio_control, RADIO_KILL_SWITCH, RADIO_MODE, RADIO_PITCH, RADIO_ROLL, RADIO_THROTTLE, RADIO_YAW, RadioControl::status, and RadioControl::values.

Referenced by autopilot_firmware_init().

+ Here is the caller graph for this function:

Variable Documentation

uint32_t autopilot_in_flight_counter
static
uint8_t autopilot_mode_auto2