Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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 "mcu_periph/sys_time.h"
#include "generated/airframe.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...
 

Variables

uint8_t pprz_mode
 
bool_t kill_throttle
 
uint16_t autopilot_flight_time
 flight time in seconds. More...
 
uint8_t lateral_mode
 
uint16_t vsupply
 Supply voltage in deciVolt. More...
 
float energy
 Fuel consumption (mAh) TODO: move to electrical subsystem. More...
 
bool_t launch
 
bool_t gps_lost
 
bool_t 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:37
bool_t launch
Definition: sim_ap.c:40
#define FALSE
Definition: imu_chimu.h:141

Definition at line 68 of file autopilot.h.

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

Definition at line 118 of file autopilot.h.

#define CONTROL_FREQUENCY   60

Definition at line 130 of file autopilot.h.

Referenced by init_ap().

#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(), and nav_without_gps().

#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: imu_chimu.h:141
#define TRUE
Definition: imu_chimu.h:144
unsigned char uint8_t
Definition: types.h:14

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

Definition at line 102 of file autopilot.h.

Referenced by pprz_mode_update().

#define NAVIGATION_FREQUENCY   4

Definition at line 135 of file autopilot.h.

Referenced by init_ap().

#define PPRZ_MODE_AUTO1   1

Definition at line 52 of file autopilot.h.

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

#define PPRZ_MODE_AUTO2   2
#define PPRZ_MODE_GPS_OUT_OF_ORDER   4

Definition at line 55 of file autopilot.h.

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

#define PPRZ_MODE_HOME   3

Definition at line 54 of file autopilot.h.

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

#define PPRZ_MODE_MANUAL   0
#define PPRZ_MODE_NB   5

Definition at line 56 of file autopilot.h.

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

Definition at line 58 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 46 of file autopilot.h.

#define THRESHOLD2   (MAX_PPRZ/2)

Definition at line 47 of file autopilot.h.

Referenced by pprz_mode_update().

#define THRESHOLD_MANUAL_PPRZ   (MIN_PPRZ / 2)

Threshold for RC mode detection.

Definition at line 45 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

void autopilot_init ( void  )

Autopilot inititalization.

Definition at line 48 of file autopilot.c.

Variable Documentation

uint16_t autopilot_flight_time

flight time in seconds.

Definition at line 37 of file autopilot.c.

float energy

Fuel consumption (mAh) TODO: move to electrical subsystem.

Definition at line 42 of file autopilot.c.

Referenced by generic_com_periodic(), and navigation_task().

bool_t gps_lost

Definition at line 44 of file autopilot.c.

Referenced by autopilot_init(), and navigation_task().

bool_t kill_throttle

Definition at line 32 of file autopilot.c.

uint8_t lateral_mode

Definition at line 39 of file autopilot.c.

Referenced by autopilot_init(), fly_to_xy(), nav_without_gps(), and navigation_task().

bool_t power_switch

Power switch control.

Definition at line 46 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 41 of file autopilot.c.

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