Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
stabilization_attitude_rc_setpoint.h File Reference

Read an attitude setpoint from the RC. More...

+ Include dependency graph for stabilization_attitude_rc_setpoint.h:
+ This graph shows which files directly or indirectly include this file:

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...
 

Detailed Description

Read an attitude setpoint from the RC.

Definition in file stabilization_attitude_rc_setpoint.h.


Data Structure Documentation

◆ AttitudeRCInput

struct AttitudeRCInput

Attitude (and Rate) Remote Control input.

Definition at line 36 of file stabilization_attitude_rc_setpoint.h.

+ Collaboration diagram for AttitudeRCInput:
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

Function Documentation

◆ stabilization_attitude_get_heading_f()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stabilization_attitude_get_heading_i()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stabilization_attitude_rc_setpoint_init()

void stabilization_attitude_rc_setpoint_init ( struct AttitudeRCInput rc_sp)

Init rc input.

Parameters
[out]rc_sppointer 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stabilization_attitude_read_rc_roll_pitch_earth_quat_f()

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.

Parameters
[out]qquaternion representing the RC roll/pitch input
[in]theta_offsetpitch offset for forward flight
[in]rcpointer 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).

Parameters
[out]qquaternion representing the RC roll/pitch input
[in]theta_offsetpitch offset for forward flight
[in]rcpointer 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stabilization_attitude_read_rc_roll_pitch_quat_f()

void stabilization_attitude_read_rc_roll_pitch_quat_f ( struct FloatQuat q,
struct RadioControl rc 
)

Read RC roll and pitch only.

Parameters
[out]qquaternion representing the RC roll/pitch input
[in]rcpointer to radio control structure

Read RC roll and pitch only.

Interprets the stick positions as axes.

Parameters
[out]qquaternion representing the RC roll/pitch input
[in]rcpointer 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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.

Parameters
[out]rc_sppointer to rc input structure
[in]in_flighttrue if in flight
[in]in_carefreetrue if in carefree mode
[in]coordinated_turntrue if in horizontal mode forward
[in]rcpointer to radio control structure
[out]rc_sppointer to rc input structure
[in]in_flighttrue if in flight
[in]in_carefreetrue if in carefree mode
[in]coordinated_turntrue if in horizontal mode forward
[in]rcpointer 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().

+ Here is the call graph for this function:

◆ stabilization_attitude_read_rc_setpoint_earth_bound()

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.

Parameters
[out]rc_sppointer to rc input structure
[in]in_flighttrue if in flight
[in]in_carefreetrue if in carefree mode
[in]coordinated_turntrue if in horizontal mode forward
[in]rcpointer to radio control structure

Read attitude setpoint from RC as quaternion in earth bound frame Interprets the stick positions as axes.

Parameters
[out]rc_sppointer to rc input structure
[in]in_flighttrue if in flight
[in]in_carefreetrue if in carefree mode
[in]coordinated_turntrue if in horizontal mode forward
[in]rcpointer 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.

+ Here is the call graph for this function:

◆ stabilization_attitude_read_rc_setpoint_eulers()

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.

Parameters
[out]rc_sppointer to rc input structure
[in]in_flighttrue if in flight
[in]in_carefreetrue if in carefree mode
[in]coordinated_turntrue if in horizontal mode forward
[in]rcpointer to radio control structure
Returns
attitude setpoint in eulers (int)

Definition at line 231 of file stabilization_attitude_rc_setpoint.c.

Referenced by guidance_module_enter().

+ Here is the caller graph for this function:

◆ stabilization_attitude_read_rc_setpoint_eulers_f()

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.

Parameters
[out]rc_sppointer to rc input structure
[in]in_flighttrue if in flight
[in]in_carefreetrue if in carefree mode
[in]coordinated_turntrue if in horizontal mode forward
[in]rcpointer to radio control structure
Returns
attitude setpoint in eulers (float)

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().

+ Here is the caller graph for this function:

◆ stabilization_attitude_reset_care_free_heading()

void stabilization_attitude_reset_care_free_heading ( struct AttitudeRCInput rc_sp)

Reset care free heading to current heading.

Parameters
[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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stabilization_attitude_reset_rc_setpoint()

void stabilization_attitude_reset_rc_setpoint ( struct AttitudeRCInput rc_sp)

Reset rc input to current state.

Parameters
[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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: