Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
autopilot_rc_helpers.h File Reference
#include "generated/airframe.h"
#include "modules/radio_control/radio_control.h"
#include "generated/modules.h"
Include dependency graph for autopilot_rc_helpers.h:

Go to the source code of this file.

Macros

#define AUTOPILOT_THROTTLE_THRESHOLD   (MAX_PPRZ / 20)
#define AUTOPILOT_YAW_THRESHOLD   (MAX_PPRZ * 19 / 20)
#define AUTOPILOT_STICK_CENTER_THRESHOLD   (MAX_PPRZ * 1 / 20)
#define THROTTLE_STICK_DOWN()
#define YAW_STICK_PUSHED()
#define YAW_STICK_CENTERED()
#define PITCH_STICK_CENTERED()
#define ROLL_STICK_CENTERED()

Functions

static bool rc_mode_switch (uint8_t chan, uint8_t pos, uint8_t max)
 RC mode switch position helper switch positions threshold are evenly spaced.
static bool rc_attitude_sticks_centered (void)
 Convenience macro for 3way switch.
static bool kill_switch_is_on (void)
static uint8_t percent_from_rc (int channel)

Macro Definition Documentation

◆ AUTOPILOT_STICK_CENTER_THRESHOLD

#define AUTOPILOT_STICK_CENTER_THRESHOLD   (MAX_PPRZ * 1 / 20)

Definition at line 38 of file autopilot_rc_helpers.h.

◆ AUTOPILOT_THROTTLE_THRESHOLD

#define AUTOPILOT_THROTTLE_THRESHOLD   (MAX_PPRZ / 20)

Definition at line 35 of file autopilot_rc_helpers.h.

◆ AUTOPILOT_YAW_THRESHOLD

#define AUTOPILOT_YAW_THRESHOLD   (MAX_PPRZ * 19 / 20)

Definition at line 36 of file autopilot_rc_helpers.h.

◆ PITCH_STICK_CENTERED

#define PITCH_STICK_CENTERED ( )
Value:
struct RadioControl radio_control
#define AUTOPILOT_STICK_CENTER_THRESHOLD

Definition at line 49 of file autopilot_rc_helpers.h.

◆ ROLL_STICK_CENTERED

#define ROLL_STICK_CENTERED ( )
Value:

Definition at line 52 of file autopilot_rc_helpers.h.

◆ THROTTLE_STICK_DOWN

#define THROTTLE_STICK_DOWN ( )
Value:
#define AUTOPILOT_THROTTLE_THRESHOLD

Definition at line 41 of file autopilot_rc_helpers.h.

◆ YAW_STICK_CENTERED

#define YAW_STICK_CENTERED ( )

◆ YAW_STICK_PUSHED

#define YAW_STICK_PUSHED ( )
Value:

Definition at line 43 of file autopilot_rc_helpers.h.

Function Documentation

◆ kill_switch_is_on()

bool kill_switch_is_on ( void )
inlinestatic

Definition at line 98 of file autopilot_rc_helpers.h.

◆ percent_from_rc()

uint8_t percent_from_rc ( int channel)
inlinestatic

Definition at line 104 of file autopilot_rc_helpers.h.

References MAX_PPRZ, and radio_control.

◆ rc_attitude_sticks_centered()

bool rc_attitude_sticks_centered ( void )
inlinestatic

Convenience macro for 3way switch.

Definition at line 83 of file autopilot_rc_helpers.h.

References PITCH_STICK_CENTERED, ROLL_STICK_CENTERED, and YAW_STICK_CENTERED.

◆ rc_mode_switch()

bool rc_mode_switch ( uint8_t chan,
uint8_t pos,
uint8_t max )
inlinestatic

RC mode switch position helper switch positions threshold are evenly spaced.

Parameters
[in]chanRC mode channel number
[in]posswitch position to be tested
[in]maxmaximum number of position of the switch
Returns
true if current position is the same as requested (and RC status is OK)

Definition at line 64 of file autopilot_rc_helpers.h.

References MAX_PPRZ, MIN_PPRZ, p, radio_control, and RC_OK.