Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
autopilot_utils.h File Reference
#include "std.h"
#include "inter_mcu.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. More...
 
#define STICK_PUSHED(pprz)   (pprz < THRESHOLD1 || pprz > THRESHOLD2)
 Stick pushed. More...
 
#define FLOAT_OF_PPRZ(pprz, center, travel)   ((float)pprz / (float)MAX_PPRZ * travel + center)
 pprz_t to float with saturation More...
 
#define THROTTLE_THRESHOLD_TAKEOFF   (pprz_t)(MAX_PPRZ * 0.9)
 Takeoff detection threshold from throttle. More...
 
#define THRESHOLD_MANUAL_PPRZ   (MIN_PPRZ / 2)
 Threshold for RC mode detection. More...
 
#define THRESHOLD1   THRESHOLD_MANUAL_PPRZ
 
#define THRESHOLD2   (MAX_PPRZ/2)
 
#define AP_COMMAND_SET_ROLL(_roll)   { ap_state->commands[COMMAND_ROLL] = _roll; }
 AP command setter macros for usual commands. More...
 
#define AP_COMMAND_SET_PITCH(_pitch)   { ap_state->commands[COMMAND_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)    {}

Definition at line 86 of file autopilot_utils.h.

◆ AP_COMMAND_SET_PITCH

#define AP_COMMAND_SET_PITCH (   _pitch)    { ap_state->commands[COMMAND_PITCH] = _pitch; }

Definition at line 67 of file autopilot_utils.h.

◆ AP_COMMAND_SET_ROLL

#define AP_COMMAND_SET_ROLL (   _roll)    { ap_state->commands[COMMAND_ROLL] = _roll; }

AP command setter macros for usual commands.

Definition at line 64 of file autopilot_utils.h.

◆ AP_COMMAND_SET_THROTTLE

#define AP_COMMAND_SET_THROTTLE (   _throttle)
Value:
{ \
ap_state->commands[COMMAND_THROTTLE] = _throttle; \
autopilot.throttle = _throttle; \
}

Definition at line 77 of file autopilot_utils.h.

◆ AP_COMMAND_SET_YAW

#define AP_COMMAND_SET_YAW (   _yaw)    {}

Definition at line 73 of file autopilot_utils.h.

◆ AP_MODE_OF_PULSE

#define AP_MODE_OF_PULSE (   pprz)
Value:

Get mode from pulse.

Definition at line 38 of file autopilot_utils.h.

◆ AP_SETPOINT_PITCH

#define AP_SETPOINT_PITCH (   _pitch,
  _max 
)
Value:
{ \
_pitch = FLOAT_OF_PPRZ(fbw_state->channels[RADIO_PITCH], 0., _max); \
}

Definition at line 95 of file autopilot_utils.h.

◆ AP_SETPOINT_ROLL

#define AP_SETPOINT_ROLL (   _roll,
  _max 
)
Value:
{ \
_roll = FLOAT_OF_PPRZ(fbw_state->channels[RADIO_ROLL], 0., _max); \
}

Definition at line 90 of file autopilot_utils.h.

◆ AP_SETPOINT_THROTTLE

#define AP_SETPOINT_THROTTLE (   _throttle)
Value:
{ \
_throttle = fbw_state->channels[RADIO_THROTTLE]; \
}

Definition at line 109 of file autopilot_utils.h.

◆ AP_SETPOINT_YAW_RATE

#define AP_SETPOINT_YAW_RATE (   _yaw,
  _max 
)    {}

Definition at line 105 of file autopilot_utils.h.

◆ FLOAT_OF_PPRZ

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

pprz_t to float with saturation

Definition at line 48 of file autopilot_utils.h.

◆ STICK_PUSHED

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

Stick pushed.

Definition at line 44 of file autopilot_utils.h.

◆ THRESHOLD1

#define THRESHOLD1   THRESHOLD_MANUAL_PPRZ

Definition at line 57 of file autopilot_utils.h.

◆ THRESHOLD2

#define THRESHOLD2   (MAX_PPRZ/2)

Definition at line 58 of file autopilot_utils.h.

◆ THRESHOLD_MANUAL_PPRZ

#define THRESHOLD_MANUAL_PPRZ   (MIN_PPRZ / 2)

Threshold for RC mode detection.

Definition at line 56 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 52 of file autopilot_utils.h.

THRESHOLD1
#define THRESHOLD1
Definition: autopilot_utils.h:57
FLOAT_OF_PPRZ
#define FLOAT_OF_PPRZ(pprz, center, travel)
pprz_t to float with saturation
Definition: autopilot_utils.h:48
RADIO_ROLL
#define RADIO_ROLL
Definition: intermcu_ap.h:41
AP_MODE_AUTO2
#define AP_MODE_AUTO2
Definition: autopilot_static.h:38
fbw_state
struct fbw_state * fbw_state
Definition: inter_mcu.c:36
RADIO_THROTTLE
#define RADIO_THROTTLE
Definition: intermcu_ap.h:40
THRESHOLD2
#define THRESHOLD2
Definition: autopilot_utils.h:58
AP_MODE_MANUAL
#define AP_MODE_MANUAL
AP modes.
Definition: autopilot_static.h:36
RADIO_PITCH
#define RADIO_PITCH
Definition: intermcu_ap.h:42
AP_MODE_AUTO1
#define AP_MODE_AUTO1
Definition: autopilot_static.h:37