Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Read an attitude setpoint from the RC. More...
#include "firmwares/rotorcraft/stabilization/stabilization_attitude_rc_setpoint.h"
#include "generated/airframe.h"
#include "subsystems/radio_control.h"
#include "state.h"
#include "firmwares/rotorcraft/guidance/guidance_h.h"
#include "firmwares/rotorcraft/stabilization/stabilization_attitude.h"
#include "firmwares/rotorcraft/autopilot_rc_helpers.h"
#include "mcu_periph/sys_time.h"
Go to the source code of this file.
Macros | |
#define | STABILIZATION_ATTITUDE_DEADBAND_A 0 |
#define | STABILIZATION_ATTITUDE_DEADBAND_E 0 |
#define | YAW_DEADBAND_EXCEEDED() |
Functions | |
static int32_t | get_rc_roll (void) |
static int32_t | get_rc_pitch (void) |
static int32_t | get_rc_yaw (void) |
static float | get_rc_roll_f (void) |
static float | get_rc_pitch_f (void) |
static float | get_rc_yaw_f (void) |
void | stabilization_attitude_reset_care_free_heading (void) |
reset the heading for care-free mode to current heading More... | |
int32_t | stabilization_attitude_get_heading_i (void) |
float | stabilization_attitude_get_heading_f (void) |
void | stabilization_attitude_read_rc_setpoint_eulers (struct Int32Eulers *sp, bool_t in_flight, bool_t in_carefree, bool_t coordinated_turn) |
Read attitude setpoint from RC as euler angles. More... | |
void | stabilization_attitude_read_rc_setpoint_eulers_f (struct FloatEulers *sp, bool_t in_flight, bool_t in_carefree, bool_t coordinated_turn) |
void | stabilization_attitude_read_rc_roll_pitch_quat_f (struct FloatQuat *q) |
Read roll/pitch command from RC as quaternion. More... | |
void | stabilization_attitude_read_rc_roll_pitch_earth_quat_f (struct FloatQuat *q) |
Read roll/pitch command from RC as quaternion. More... | |
void | stabilization_attitude_read_rc_setpoint_quat_f (struct FloatQuat *q_sp, bool_t in_flight, bool_t in_carefree, bool_t coordinated_turn) |
Read attitude setpoint from RC as quaternion Interprets the stick positions as axes. More... | |
void | stabilization_attitude_read_rc_setpoint_quat_earth_bound_f (struct FloatQuat *q_sp, bool_t in_flight, bool_t in_carefree, bool_t coordinated_turn) |
Variables | |
float | care_free_heading = 0 |
Read an attitude setpoint from the RC.
Definition in file stabilization_attitude_rc_setpoint.c.
#define STABILIZATION_ATTITUDE_DEADBAND_A 0 |
Definition at line 37 of file stabilization_attitude_rc_setpoint.c.
Referenced by get_rc_roll(), and get_rc_roll_f().
#define STABILIZATION_ATTITUDE_DEADBAND_E 0 |
Definition at line 41 of file stabilization_attitude_rc_setpoint.c.
Referenced by get_rc_pitch(), and get_rc_pitch_f().
#define YAW_DEADBAND_EXCEEDED | ( | ) |
Definition at line 44 of file stabilization_attitude_rc_setpoint.c.
Referenced by stabilization_attitude_read_rc_setpoint_eulers(), and stabilization_attitude_read_rc_setpoint_eulers_f().
|
static |
Definition at line 63 of file stabilization_attitude_rc_setpoint.c.
References ANGLE_BFP_OF_REAL, MAX_PPRZ, radio_control, RADIO_PITCH, STABILIZATION_ATTITUDE_DEADBAND_E, and RadioControl::values.
Referenced by stabilization_attitude_read_rc_setpoint_eulers().
|
static |
Definition at line 94 of file stabilization_attitude_rc_setpoint.c.
References MAX_PPRZ, radio_control, RADIO_PITCH, STABILIZATION_ATTITUDE_DEADBAND_E, and RadioControl::values.
Referenced by stabilization_attitude_read_rc_roll_pitch_earth_quat_f(), stabilization_attitude_read_rc_roll_pitch_quat_f(), and stabilization_attitude_read_rc_setpoint_eulers_f().
|
static |
Definition at line 51 of file stabilization_attitude_rc_setpoint.c.
References ANGLE_BFP_OF_REAL, MAX_PPRZ, radio_control, RADIO_ROLL, STABILIZATION_ATTITUDE_DEADBAND_A, and RadioControl::values.
Referenced by stabilization_attitude_read_rc_setpoint_eulers().
|
static |
Definition at line 83 of file stabilization_attitude_rc_setpoint.c.
References MAX_PPRZ, radio_control, RADIO_ROLL, STABILIZATION_ATTITUDE_DEADBAND_A, and RadioControl::values.
Referenced by stabilization_attitude_read_rc_roll_pitch_earth_quat_f(), stabilization_attitude_read_rc_roll_pitch_quat_f(), and stabilization_attitude_read_rc_setpoint_eulers_f().
|
static |
Definition at line 75 of file stabilization_attitude_rc_setpoint.c.
References ANGLE_BFP_OF_REAL, MAX_PPRZ, radio_control, RADIO_YAW, and RadioControl::values.
Referenced by stabilization_attitude_read_rc_setpoint_eulers().
|
inlinestatic |
Definition at line 105 of file stabilization_attitude_rc_setpoint.c.
References MAX_PPRZ, radio_control, RADIO_YAW, and RadioControl::values.
Referenced by stabilization_attitude_read_rc_setpoint_eulers_f().
float stabilization_attitude_get_heading_f | ( | void | ) |
Definition at line 140 of file stabilization_attitude_rc_setpoint.c.
References heading, FloatEulers::phi, FloatEulers::psi, stateGetNedToBodyEulers_f(), and FloatEulers::theta.
Referenced by stabilization_attitude_enter(), stabilization_attitude_read_rc_setpoint_eulers_f(), and stabilization_attitude_set_failsafe_setpoint().
int32_t stabilization_attitude_get_heading_i | ( | void | ) |
Definition at line 121 of file stabilization_attitude_rc_setpoint.c.
References ANGLE_FLOAT_OF_BFP, heading, INT32_ANGLE_PI_2, INT32_TRIG_FRAC, INT_MULT_RSHIFT, Int32Eulers::phi, PPRZ_ITRIG_SIN, Int32Eulers::psi, stateGetNedToBodyEulers_i(), and Int32Eulers::theta.
Referenced by guidance_flip_enter(), stabilization_attitude_enter(), stabilization_attitude_read_rc_setpoint_eulers(), and stabilization_attitude_set_failsafe_setpoint().
void stabilization_attitude_read_rc_roll_pitch_earth_quat_f | ( | struct FloatQuat * | q | ) |
Read roll/pitch command from RC as quaternion.
Both angles are are interpreted relative to to the horizontal plane (earth bound).
[out] | q | quaternion representing the RC roll/pitch input |
Definition at line 340 of file stabilization_attitude_rc_setpoint.c.
References ANGLE_FLOAT_OF_BFP, get_rc_pitch_f(), get_rc_roll_f(), FloatQuat::qi, FloatQuat::qx, FloatQuat::qy, FloatQuat::qz, and transition_theta_offset.
Referenced by stabilization_attitude_read_rc_setpoint_quat_earth_bound_f().
void stabilization_attitude_read_rc_roll_pitch_quat_f | ( | struct FloatQuat * | q | ) |
Read roll/pitch command from RC as quaternion.
Interprets the stick positions as axes.
[out] | q | quaternion representing the RC roll/pitch input |
Definition at line 324 of file stabilization_attitude_rc_setpoint.c.
References float_quat_of_orientation_vect(), get_rc_pitch_f(), get_rc_roll_f(), FloatVect3::x, FloatVect3::y, and FloatVect3::z.
Referenced by stabilization_attitude_read_rc_setpoint_quat_f().
void stabilization_attitude_read_rc_setpoint_eulers | ( | struct Int32Eulers * | sp, |
bool_t | in_flight, | ||
bool_t | in_carefree, | ||
bool_t | coordinated_turn | ||
) |
Read attitude setpoint from RC as euler angles.
[in] | coordinated_turn | true if in horizontal mode forward |
[in] | in_carefree | true if in carefree mode |
[in] | in_flight | true if in flight |
[out] | sp | attitude setpoint as euler angles |
Definition at line 164 of file stabilization_attitude_rc_setpoint.c.
References ANGLE_BFP_OF_REAL, ANGLE_FLOAT_OF_BFP, care_free_heading, get_rc_pitch(), get_rc_roll(), get_rc_yaw(), get_sys_time_float(), heading, INT32_ANGLE_FRAC, INT32_ANGLE_NORMALIZE, INT_MULT_RSHIFT, Int32Eulers::phi, PPRZ_ITRIG_COS, PPRZ_ITRIG_SIN, Int32Eulers::psi, stabilization_attitude_get_heading_i(), stateGetNedToBodyEulers_i(), Int32Eulers::theta, THROTTLE_STICK_DOWN, and YAW_DEADBAND_EXCEEDED.
Referenced by guidance_h_read_rc(), stabilization_attitude_read_rc(), stabilization_attitude_read_rc_setpoint_quat_earth_bound_f(), and stabilization_attitude_read_rc_setpoint_quat_f().
void stabilization_attitude_read_rc_setpoint_eulers_f | ( | struct FloatEulers * | sp, |
bool_t | in_flight, | ||
bool_t | in_carefree, | ||
bool_t | coordinated_turn | ||
) |
Definition at line 244 of file stabilization_attitude_rc_setpoint.c.
References care_free_heading, FLOAT_ANGLE_NORMALIZE, get_rc_pitch_f(), get_rc_roll_f(), get_rc_yaw_f(), get_sys_time_float(), heading, FloatEulers::phi, FloatEulers::psi, stabilization_attitude_get_heading_f(), stateGetNedToBodyEulers_f(), FloatEulers::theta, THROTTLE_STICK_DOWN, and YAW_DEADBAND_EXCEEDED.
Referenced by stabilization_attitude_read_rc(), stabilization_attitude_read_rc_setpoint_quat_earth_bound_f(), and stabilization_attitude_read_rc_setpoint_quat_f().
void stabilization_attitude_read_rc_setpoint_quat_earth_bound_f | ( | struct FloatQuat * | q_sp, |
bool_t | in_flight, | ||
bool_t | in_carefree, | ||
bool_t | coordinated_turn | ||
) |
Definition at line 420 of file stabilization_attitude_rc_setpoint.c.
References ANGLE_FLOAT_OF_BFP, float_quat_comp(), float_quat_normalize(), float_quat_of_axis_angle(), FloatEulers::psi, QUAT_COPY, stab_att_sp_euler, stabilization_attitude_read_rc_roll_pitch_earth_quat_f(), stabilization_attitude_read_rc_setpoint_eulers(), stabilization_attitude_read_rc_setpoint_eulers_f(), and stateGetNedToBodyEulers_f().
Referenced by stabilization_attitude_read_rc().
void stabilization_attitude_read_rc_setpoint_quat_f | ( | struct FloatQuat * | q_sp, |
bool_t | in_flight, | ||
bool_t | in_carefree, | ||
bool_t | coordinated_turn | ||
) |
Read attitude setpoint from RC as quaternion Interprets the stick positions as axes.
[in] | coordinated_turn | true if in horizontal mode forward |
[in] | in_carefree | true if in carefree mode |
[in] | in_flight | true if in flight |
[out] | q_sp | attitude setpoint as quaternion |
Definition at line 367 of file stabilization_attitude_rc_setpoint.c.
References ANGLE_FLOAT_OF_BFP, care_free_heading, float_quat_comp(), float_quat_comp_inv(), float_quat_comp_norm_shortest(), float_quat_normalize(), float_quat_of_axis_angle(), FloatEulers::psi, QUAT_COPY, stab_att_sp_euler, stabilization_attitude_read_rc_roll_pitch_quat_f(), stabilization_attitude_read_rc_setpoint_eulers(), stabilization_attitude_read_rc_setpoint_eulers_f(), and stateGetNedToBodyEulers_f().
Referenced by stabilization_attitude_read_rc().
void stabilization_attitude_reset_care_free_heading | ( | void | ) |
reset the heading for care-free mode to current heading
Definition at line 113 of file stabilization_attitude_rc_setpoint.c.
References care_free_heading, FloatEulers::psi, and stateGetNedToBodyEulers_f().
Referenced by guidance_h_mode_changed().
float care_free_heading = 0 |