Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Read an attitude setpoint from the RC. More...
#include "std.h"
#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
#include "modules/radio_control/radio_control.h"
Go to the source code of this file.
Data Structures | |
struct | AttitudeRCInput |
Attitude (and Rate) Remote Control input. More... | |
Functions | |
void | stabilization_attitude_rc_setpoint_init (struct AttitudeRCInput *rc_sp) |
Init rc input. More... | |
void | stabilization_attitude_read_rc_setpoint (struct AttitudeRCInput *rc_sp, bool in_flight, bool in_carefree, bool coordinated_turn, struct RadioControl *rc) |
Read attitude setpoint from RC as quaternion Interprets the stick positions as axes. More... | |
void | stabilization_attitude_read_rc_setpoint_earth_bound (struct AttitudeRCInput *rc_sp, bool in_flight, bool in_carefree, bool coordinated_turn, struct RadioControl *rc) |
Read attitude setpoint from RC as quaternion in earth bound frame Interprets the stick positions as axes. More... | |
struct Int32Eulers | stabilization_attitude_read_rc_setpoint_eulers (struct AttitudeRCInput *rc_sp, bool in_flight, bool in_carefree, bool coordinated_turn, struct RadioControl *rc) |
Read attitude setpoint from RC as euler angles Only the euler format is updated and returned. More... | |
struct FloatEulers | stabilization_attitude_read_rc_setpoint_eulers_f (struct AttitudeRCInput *rc_sp, bool in_flight, bool in_carefree, bool coordinated_turn, struct RadioControl *rc) |
Read attitude setpoint from RC as float euler angles Only the euler format is updated and returned. More... | |
void | stabilization_attitude_reset_rc_setpoint (struct AttitudeRCInput *rc_sp) |
Reset rc input to current state. More... | |
void | stabilization_attitude_reset_care_free_heading (struct AttitudeRCInput *rc_sp) |
Reset care free heading to current heading. More... | |
void | stabilization_attitude_read_rc_roll_pitch_quat_f (struct FloatQuat *q, struct RadioControl *rc) |
Read RC roll and pitch only. More... | |
void | stabilization_attitude_read_rc_roll_pitch_earth_quat_f (struct FloatQuat *q, float theta_offset, struct RadioControl *rc) |
Read RC roll and pitch only, in earth bounded frame. More... | |
int32_t | stabilization_attitude_get_heading_i (void) |
Get attitude heading as int (avoiding jumps) More... | |
float | stabilization_attitude_get_heading_f (void) |
Get attitude heading as float (avoiding jumps) More... | |
Read an attitude setpoint from the RC.
Definition in file stabilization_attitude_rc_setpoint.h.
struct AttitudeRCInput |
Attitude (and Rate) Remote Control input.
Definition at line 36 of file stabilization_attitude_rc_setpoint.h.
Data Fields | ||
---|---|---|
float | care_free_heading | care_free heading |
float | last_ts | |
struct FloatEulers | rc_eulers | RC input in eulers (needed even for quat for yaw integration) |
struct FloatQuat | rc_quat | RC input in quaternion. |
float | transition_theta_offset | pitch offset for hybrids, add when in forward mode |
float stabilization_attitude_get_heading_f | ( | void | ) |
Get attitude heading as float (avoiding jumps)
Definition at line 231 of file stabilization_attitude_rc_setpoint.c.
References heading, FloatEulers::phi, FloatEulers::psi, stateGetNedToBodyEulers_f(), and FloatEulers::theta.
Referenced by stabilization_attitude_enter().
int32_t stabilization_attitude_get_heading_i | ( | void | ) |
Get attitude heading as int (avoiding jumps)
Definition at line 215 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(), and stabilization_indi_enter().
void stabilization_attitude_rc_setpoint_init | ( | struct AttitudeRCInput * | rc_sp | ) |
Init rc input.
[out] | rc_sp | pointer to rc input structure |
Definition at line 102 of file stabilization_attitude_rc_setpoint.c.
References AttitudeRCInput::care_free_heading, FLOAT_EULERS_ZERO, float_quat_identity(), AttitudeRCInput::last_ts, AttitudeRCInput::rc_eulers, AttitudeRCInput::rc_quat, and AttitudeRCInput::transition_theta_offset.
Referenced by ctrl_module_init(), and stabilization_init().
void stabilization_attitude_read_rc_roll_pitch_earth_quat_f | ( | struct FloatQuat * | q, |
float | theta_offset, | ||
struct RadioControl * | rc | ||
) |
Read RC roll and pitch only, in earth bounded frame.
[out] | q | quaternion representing the RC roll/pitch input |
[in] | theta_offset | pitch offset for forward flight |
[in] | rc | pointer to radio control structure |
Read RC roll and pitch only, in earth bounded frame.
Both angles are are interpreted relative to to the horizontal plane (earth bound).
[out] | q | quaternion representing the RC roll/pitch input |
[in] | theta_offset | pitch offset for forward flight |
[in] | rc | pointer to radio control structure |
Definition at line 441 of file stabilization_attitude_rc_setpoint.c.
References get_rc_pitch_f(), get_rc_roll_f(), FloatQuat::qi, FloatQuat::qx, FloatQuat::qy, and FloatQuat::qz.
Referenced by stabilization_attitude_read_rc_setpoint_earth_bound().
void stabilization_attitude_read_rc_roll_pitch_quat_f | ( | struct FloatQuat * | q, |
struct RadioControl * | rc | ||
) |
Read RC roll and pitch only.
[out] | q | quaternion representing the RC roll/pitch input |
[in] | rc | pointer to radio control structure |
Read RC roll and pitch only.
Interprets the stick positions as axes.
[out] | q | quaternion representing the RC roll/pitch input |
[in] | rc | pointer to radio control structure |
Definition at line 423 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().
void stabilization_attitude_read_rc_setpoint | ( | struct AttitudeRCInput * | rc_sp, |
bool | in_flight, | ||
bool | in_carefree, | ||
bool | coordinated_turn, | ||
struct RadioControl * | rc | ||
) |
Read attitude setpoint from RC as quaternion Interprets the stick positions as axes.
Both eulers and quaternion format are updated.
[out] | rc_sp | pointer to rc input structure |
[in] | in_flight | true if in flight |
[in] | in_carefree | true if in carefree mode |
[in] | coordinated_turn | true if in horizontal mode forward |
[in] | rc | pointer to radio control structure |
[out] | rc_sp | pointer to rc input structure |
[in] | in_flight | true if in flight |
[in] | in_carefree | true if in carefree mode |
[in] | coordinated_turn | true if in horizontal mode forward |
[in] | rc | pointer to radio control structure |
Definition at line 119 of file stabilization_attitude_rc_setpoint.c.
References AttitudeRCInput::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, AttitudeRCInput::rc_eulers, AttitudeRCInput::rc_quat, stabilization_attitude_read_rc_roll_pitch_quat_f(), stabilization_attitude_read_rc_setpoint_eulers_f(), and stateGetNedToBodyEulers_f().
void stabilization_attitude_read_rc_setpoint_earth_bound | ( | struct AttitudeRCInput * | rc_sp, |
bool | in_flight, | ||
bool | in_carefree, | ||
bool | coordinated_turn, | ||
struct RadioControl * | rc | ||
) |
Read attitude setpoint from RC as quaternion in earth bound frame Interprets the stick positions as axes.
Both eulers and quaternion format are updated.
[out] | rc_sp | pointer to rc input structure |
[in] | in_flight | true if in flight |
[in] | in_carefree | true if in carefree mode |
[in] | coordinated_turn | true if in horizontal mode forward |
[in] | rc | pointer to radio control structure |
Read attitude setpoint from RC as quaternion in earth bound frame Interprets the stick positions as axes.
[out] | rc_sp | pointer to rc input structure |
[in] | in_flight | true if in flight |
[in] | in_carefree | true if in carefree mode |
[in] | coordinated_turn | true if in horizontal mode forward |
[in] | rc | pointer to radio control structure |
Definition at line 169 of file stabilization_attitude_rc_setpoint.c.
References float_quat_comp(), float_quat_normalize(), float_quat_of_axis_angle(), FloatEulers::psi, QUAT_COPY, AttitudeRCInput::rc_eulers, AttitudeRCInput::rc_quat, stabilization_attitude_read_rc_roll_pitch_earth_quat_f(), stabilization_attitude_read_rc_setpoint_eulers_f(), stateGetNedToBodyEulers_f(), and AttitudeRCInput::transition_theta_offset.
struct Int32Eulers stabilization_attitude_read_rc_setpoint_eulers | ( | struct AttitudeRCInput * | rc_sp, |
bool | in_flight, | ||
bool | in_carefree, | ||
bool | coordinated_turn, | ||
struct RadioControl * | rc | ||
) |
Read attitude setpoint from RC as euler angles Only the euler format is updated and returned.
[out] | rc_sp | pointer to rc input structure |
[in] | in_flight | true if in flight |
[in] | in_carefree | true if in carefree mode |
[in] | coordinated_turn | true if in horizontal mode forward |
[in] | rc | pointer to radio control structure |
Definition at line 231 of file stabilization_attitude_rc_setpoint.c.
Referenced by guidance_module_enter().
struct FloatEulers stabilization_attitude_read_rc_setpoint_eulers_f | ( | struct AttitudeRCInput * | rc_sp, |
bool | in_flight, | ||
bool | in_carefree, | ||
bool | coordinated_turn, | ||
struct RadioControl * | rc | ||
) |
Read attitude setpoint from RC as float euler angles Only the euler format is updated and returned.
[out] | rc_sp | pointer to rc input structure |
[in] | in_flight | true if in flight |
[in] | in_carefree | true if in carefree mode |
[in] | coordinated_turn | true if in horizontal mode forward |
[in] | rc | pointer to radio control structure |
Definition at line 231 of file stabilization_attitude_rc_setpoint.c.
Referenced by stabilization_attitude_read_rc_setpoint(), and stabilization_attitude_read_rc_setpoint_earth_bound().
void stabilization_attitude_reset_care_free_heading | ( | struct AttitudeRCInput * | rc_sp | ) |
Reset care free heading to current heading.
[in/out] | rc_sp pointer to rc input structure |
Reset care free heading to current heading.
Definition at line 207 of file stabilization_attitude_rc_setpoint.c.
References AttitudeRCInput::care_free_heading, FloatEulers::psi, and stateGetNedToBodyEulers_f().
Referenced by stabilization_attitude_read_rc().
void stabilization_attitude_reset_rc_setpoint | ( | struct AttitudeRCInput * | rc_sp | ) |
Reset rc input to current state.
[in/out] | rc_sp pointer to rc input structure |
Reset rc input to current state.
Definition at line 200 of file stabilization_attitude_rc_setpoint.c.
References AttitudeRCInput::rc_eulers, AttitudeRCInput::rc_quat, stateGetNedToBodyEulers_f(), and stateGetNedToBodyQuat_f().
Referenced by stabilization_attitude_reset_rc().