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
autopilot.h File Reference

Fixedwing autopilot modes. More...

#include <inttypes.h>
#include "std.h"
#include "paparazzi.h"
#include "generated/airframe.h"
#include "subsystems/settings.h"
#include "pprzlink/pprzlink_transport.h"
+ Include dependency graph for autopilot.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define THRESHOLD_MANUAL_PPRZ   (MIN_PPRZ / 2)
 Threshold for RC mode detection. More...
 
#define THRESHOLD1   THRESHOLD_MANUAL_PPRZ
 
#define THRESHOLD2   (MAX_PPRZ/2)
 
#define PPRZ_MODE_MANUAL   0
 AP modes. More...
 
#define PPRZ_MODE_AUTO1   1
 
#define PPRZ_MODE_AUTO2   2
 
#define PPRZ_MODE_HOME   3
 
#define PPRZ_MODE_GPS_OUT_OF_ORDER   4
 
#define PPRZ_MODE_NB   5
 
#define PPRZ_MODE_OF_PULSE(pprz)
 
#define autopilot_ResetFlightTimeAndLaunch(_)
 
#define LATERAL_MODE_MANUAL   0
 
#define LATERAL_MODE_ROLL_RATE   1
 
#define LATERAL_MODE_ROLL   2
 
#define LATERAL_MODE_COURSE   3
 
#define LATERAL_MODE_NB   4
 
#define STICK_PUSHED(pprz)   (pprz < THRESHOLD1 || pprz > THRESHOLD2)
 
#define FLOAT_OF_PPRZ(pprz, center, travel)   ((float)pprz / (float)MAX_PPRZ * travel + center)
 
#define THROTTLE_THRESHOLD_TAKEOFF   (pprz_t)(MAX_PPRZ * 0.9)
 
#define ModeUpdate(_mode, _value)
 Assignment, returning _old_value != _value Using GCC expression statements. More...
 
#define autopilot_SetPowerSwitch(_x)   { power_switch = _x; }
 
#define CONTROL_FREQUENCY   60
 
#define NAVIGATION_FREQUENCY   4
 

Functions

void autopilot_init (void)
 Autopilot inititalization. More...
 
void autopilot_send_mode (void)
 Send mode over telemetry. More...
 
static void autopilot_StoreSettings (float store)
 
static void autopilot_ClearSettings (float clear)
 
void send_autopilot_version (struct transport_tx *trans, struct link_device *dev)
 

Variables

uint8_t pprz_mode
 
bool kill_throttle
 
uint8_t mcu1_status
 
uint16_t autopilot_flight_time
 flight time in seconds. More...
 
uint8_t lateral_mode
 
uint16_t vsupply
 Supply voltage in deciVolt. More...
 
int32_t current
 Supply current in milliAmpere. More...
 
float energy
 Energy consumption (mAh) This is the ap copy of the measurement from fbw. More...
 
bool launch
 
bool gps_lost
 
bool power_switch
 Power switch control. More...
 

Detailed Description

Fixedwing autopilot modes.

Definition in file autopilot.h.

Macro Definition Documentation

#define autopilot_ResetFlightTimeAndLaunch (   _)
Value:
{ \
}
uint16_t autopilot_flight_time
flight time in seconds.
Definition: autopilot.c:48
bool launch
Definition: sim_ap.c:38

Definition at line 68 of file autopilot.h.

#define autopilot_SetPowerSwitch (   _x)    { power_switch = _x; }

Definition at line 128 of file autopilot.h.

#define CONTROL_FREQUENCY   60

Definition at line 140 of file autopilot.h.

Referenced by init_ap(), and v_ctl_landing_loop().

#define FLOAT_OF_PPRZ (   pprz,
  center,
  travel 
)    ((float)pprz / (float)MAX_PPRZ * travel + center)

Definition at line 82 of file autopilot.h.

Referenced by telecommand_task().

#define LATERAL_MODE_COURSE   3

Definition at line 77 of file autopilot.h.

Referenced by fly_to_xy(), and navigation_task().

#define LATERAL_MODE_MANUAL   0

Definition at line 74 of file autopilot.h.

Referenced by autopilot_init().

#define LATERAL_MODE_NB   4

Definition at line 78 of file autopilot.h.

#define LATERAL_MODE_ROLL   2

Definition at line 76 of file autopilot.h.

Referenced by fly_to_xy(), nav_without_gps(), and v_ctl_landing_loop().

#define LATERAL_MODE_ROLL_RATE   1

Definition at line 75 of file autopilot.h.

#define ModeUpdate (   _mode,
  _value 
)
Value:
({ \
uint8_t new_mode = _value; \
(_mode != new_mode ? _mode = new_mode, TRUE : FALSE); \
})
#define FALSE
Definition: std.h:5
#define TRUE
Definition: std.h:4
unsigned char uint8_t
Definition: types.h:14

Assignment, returning _old_value != _value Using GCC expression statements.

Definition at line 107 of file autopilot.h.

Referenced by pprz_mode_update().

#define NAVIGATION_FREQUENCY   4

Definition at line 145 of file autopilot.h.

Referenced by init_ap().

#define PPRZ_MODE_AUTO1   1
#define PPRZ_MODE_GPS_OUT_OF_ORDER   4

Definition at line 54 of file autopilot.h.

Referenced by navigation_task(), pprz_mode_update(), and telecommand_task().

#define PPRZ_MODE_HOME   3
#define PPRZ_MODE_MANUAL   0
#define PPRZ_MODE_NB   5

Definition at line 55 of file autopilot.h.

#define PPRZ_MODE_OF_PULSE (   pprz)
Value:
#define THRESHOLD1
Definition: autopilot.h:45
#define PPRZ_MODE_AUTO2
Definition: autopilot.h:52
#define PPRZ_MODE_AUTO1
Definition: autopilot.h:51
#define PPRZ_MODE_MANUAL
AP modes.
Definition: autopilot.h:50
#define THRESHOLD2
Definition: autopilot.h:46

Definition at line 57 of file autopilot.h.

Referenced by pprz_mode_update().

#define STICK_PUSHED (   pprz)    (pprz < THRESHOLD1 || pprz > THRESHOLD2)

Definition at line 81 of file autopilot.h.

#define THRESHOLD1   THRESHOLD_MANUAL_PPRZ

Definition at line 45 of file autopilot.h.

#define THRESHOLD2   (MAX_PPRZ/2)

Definition at line 46 of file autopilot.h.

Referenced by pprz_mode_update().

#define THRESHOLD_MANUAL_PPRZ   (MIN_PPRZ / 2)

Threshold for RC mode detection.

Definition at line 44 of file autopilot.h.

#define THROTTLE_THRESHOLD_TAKEOFF   (pprz_t)(MAX_PPRZ * 0.9)

Definition at line 84 of file autopilot.h.

Referenced by telecommand_task().

Function Documentation

static void autopilot_ClearSettings ( float  clear)
inlinestatic

Definition at line 159 of file autopilot.h.

References kill_throttle, settings_clear(), and settings_clear_flag.

+ Here is the call graph for this function:

void autopilot_init ( void  )

Autopilot inititalization.

Definition at line 175 of file autopilot.c.

void autopilot_send_mode ( void  )

Send mode over telemetry.

Definition at line 167 of file autopilot.c.

References DefaultChannel, DefaultDevice, and send_mode().

Referenced by navigation_task(), and telecommand_task().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void autopilot_StoreSettings ( float  store)
inlinestatic

Definition at line 151 of file autopilot.h.

References kill_throttle, settings_store(), and settings_store_flag.

+ Here is the call graph for this function:

void send_autopilot_version ( struct transport_tx *  trans,
struct link_device *  dev 
)

Definition at line 64 of file autopilot.c.

Variable Documentation

uint16_t autopilot_flight_time

flight time in seconds.

Definition at line 48 of file autopilot.c.

int32_t current

Supply current in milliAmpere.

This the ap copy of the measurement from fbw

Definition at line 53 of file autopilot.c.

Referenced by send_bat(), send_energy(), and telecommand_task().

float energy

Energy consumption (mAh) This is the ap copy of the measurement from fbw.

Definition at line 54 of file autopilot.c.

Referenced by generic_com_periodic(), send_bat(), send_energy(), and telecommand_task().

bool gps_lost

Definition at line 56 of file autopilot.c.

Referenced by autopilot_init(), and navigation_task().

bool kill_throttle

Definition at line 42 of file autopilot.c.

Referenced by autopilot_ClearSettings(), and autopilot_StoreSettings().

uint8_t lateral_mode
uint8_t mcu1_status

Definition at line 43 of file autopilot.c.

Referenced by mcu1_status_update(), and send_mode().

bool power_switch

Power switch control.

Definition at line 58 of file autopilot.c.

Referenced by autopilot_init().

uint16_t vsupply

Supply voltage in deciVolt.

This the ap copy of the measurement from fbw

Definition at line 52 of file autopilot.c.

Referenced by attitude_loop(), gsm_send_report_continue(), monitor_task(), send_bat(), send_energy(), and telecommand_task().