Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
autopilot_utils.h File Reference

Utility functions and includes for autopilots. More...

#include "std.h"
#include "generated/airframe.h"
Include dependency graph for autopilot_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AP_MODE_OF_PULSE(pprz)
 Get mode from pulse.
#define STICK_PUSHED(pprz)
 Stick pushed.
#define FLOAT_OF_PPRZ(pprz, center, travel)
 pprz_t to float with saturation
#define THROTTLE_THRESHOLD_TAKEOFF   (pprz_t)(MAX_PPRZ * 0.9)
 Takeoff detection threshold from throttle.
#define THRESHOLD_MANUAL_PPRZ   (MIN_PPRZ / 2)
 Threshold for RC mode detection.
#define THRESHOLD1   THRESHOLD_MANUAL_PPRZ
#define THRESHOLD2   (MAX_PPRZ/2)
#define AP_COMMAND_SET_ROLL(_roll)
 AP command setter macros for usual commands.
#define AP_COMMAND_SET_PITCH(_pitch)
#define AP_COMMAND_SET_YAW(_yaw)
#define AP_COMMAND_SET_THROTTLE(_throttle)
#define AP_COMMAND_SET_CL(_cl)
#define AP_SETPOINT_ROLL(_roll, _max)
#define AP_SETPOINT_PITCH(_pitch, _max)
#define AP_SETPOINT_YAW_RATE(_yaw, _max)
#define AP_SETPOINT_THROTTLE(_throttle)

Detailed Description

Utility functions and includes for autopilots.

Definition in file autopilot_utils.h.

Macro Definition Documentation

◆ AP_COMMAND_SET_CL

#define AP_COMMAND_SET_CL ( _cl)
Value:
{}

Definition at line 85 of file autopilot_utils.h.

Referenced by attitude_loop().

◆ AP_COMMAND_SET_PITCH

#define AP_COMMAND_SET_PITCH ( _pitch)
Value:
{ command_set(COMMAND_PITCH, _pitch); }
#define COMMAND_PITCH

Definition at line 66 of file autopilot_utils.h.

Referenced by attitude_loop().

◆ AP_COMMAND_SET_ROLL

#define AP_COMMAND_SET_ROLL ( _roll)
Value:
{ command_set(COMMAND_ROLL, _roll); }
#define COMMAND_ROLL

AP command setter macros for usual commands.

Definition at line 63 of file autopilot_utils.h.

Referenced by attitude_loop().

◆ AP_COMMAND_SET_THROTTLE

#define AP_COMMAND_SET_THROTTLE ( _throttle)
Value:
{ \
command_set(COMMAND_THROTTLE, _throttle); \
autopilot.throttle = _throttle; \
}
struct pprz_autopilot autopilot
Global autopilot structure.
Definition autopilot.c:50

Definition at line 76 of file autopilot_utils.h.

Referenced by attitude_loop().

◆ AP_COMMAND_SET_YAW

#define AP_COMMAND_SET_YAW ( _yaw)
Value:
{}

Definition at line 72 of file autopilot_utils.h.

Referenced by attitude_loop().

◆ AP_MODE_OF_PULSE

#define AP_MODE_OF_PULSE ( pprz)
Value:
(pprz > THRESHOLD2 ? AP_MODE_AUTO2 : \
#define AP_MODE_MANUAL
AP modes.
#define AP_MODE_AUTO2
#define AP_MODE_AUTO1
#define THRESHOLD2
#define THRESHOLD1

Get mode from pulse.

Definition at line 37 of file autopilot_utils.h.

Referenced by pprz_mode_update().

◆ AP_SETPOINT_PITCH

#define AP_SETPOINT_PITCH ( _pitch,
_max )
Value:
{ \
}
#define FLOAT_OF_PPRZ(pprz, center, travel)
pprz_t to float with saturation
static pprz_t radio_control_get(uint8_t idx)
Get a radio control channel value.

Definition at line 94 of file autopilot_utils.h.

◆ AP_SETPOINT_ROLL

#define AP_SETPOINT_ROLL ( _roll,
_max )
Value:
{ \
}

Definition at line 89 of file autopilot_utils.h.

◆ AP_SETPOINT_THROTTLE

#define AP_SETPOINT_THROTTLE ( _throttle)
Value:
{ \
}

Definition at line 108 of file autopilot_utils.h.

◆ AP_SETPOINT_YAW_RATE

#define AP_SETPOINT_YAW_RATE ( _yaw,
_max )
Value:
{}

Definition at line 104 of file autopilot_utils.h.

◆ FLOAT_OF_PPRZ

#define FLOAT_OF_PPRZ ( pprz,
center,
travel )
Value:
((float)pprz / (float)MAX_PPRZ * travel + center)
#define MAX_PPRZ
Definition paparazzi.h:8

pprz_t to float with saturation

Definition at line 47 of file autopilot_utils.h.

Referenced by autopilot_static_on_rc_frame().

◆ STICK_PUSHED

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

Stick pushed.

Definition at line 43 of file autopilot_utils.h.

◆ THRESHOLD1

#define THRESHOLD1   THRESHOLD_MANUAL_PPRZ

Definition at line 56 of file autopilot_utils.h.

◆ THRESHOLD2

#define THRESHOLD2   (MAX_PPRZ/2)

Definition at line 57 of file autopilot_utils.h.

Referenced by pprz_mode_update().

◆ THRESHOLD_MANUAL_PPRZ

#define THRESHOLD_MANUAL_PPRZ   (MIN_PPRZ / 2)

Threshold for RC mode detection.

Definition at line 55 of file autopilot_utils.h.

◆ THROTTLE_THRESHOLD_TAKEOFF

#define THROTTLE_THRESHOLD_TAKEOFF   (pprz_t)(MAX_PPRZ * 0.9)

Takeoff detection threshold from throttle.

Definition at line 51 of file autopilot_utils.h.

Referenced by autopilot_failsafe_checks().