Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
rotwing_state.h File Reference
#include "std.h"
+ Include dependency graph for rotwing_state.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  rotwing_bitmask_t
 
struct  rotwing_state_t
 
struct  rotwing_bitmask_t.__unnamed307__
 

Macros

#define ROTWING_SKEW_ANGLE_STEP   55.0
 
#define ROTWING_QUAD_PREF_PITCH   -5.0
 

Enumerations

enum  rotwing_states_t {
  ROTWING_STATE_FORCE_HOVER , ROTWING_STATE_REQUEST_HOVER , ROTWING_STATE_FORCE_FW , ROTWING_STATE_REQUEST_FW ,
  ROTWING_STATE_FREE
}
 

Functions

void rotwing_state_init (void)
 
void rotwing_state_periodic (void)
 
bool rotwing_state_hover_motors_running (void)
 
bool rotwing_state_pusher_motor_running (void)
 
bool rotwing_state_skew_angle_valid (void)
 
bool rotwing_state_hover_motors_idling (void)
 Check if hover motors are idling (COMMAND_THRUST < ROTWING_QUAD_IDLE_MIN_THRUST) for ROTWING_QUAD_IDLE_TIMEOUT time. More...
 
void rotwing_state_set (enum rotwing_states_t state)
 
bool rotwing_state_choose_circle_direction (uint8_t wp_id)
 
void rotwing_state_set_transition_wp (uint8_t wp_id)
 
void rotwing_state_update_WP_height (uint8_t wp_id, float height)
 

Variables

struct rotwing_state_t rotwing_state
 

Data Structure Documentation

◆ rotwing_bitmask_t

union rotwing_bitmask_t

Definition at line 49 of file rotwing_state.h.

+ Collaboration diagram for rotwing_bitmask_t:
Data Fields
struct rotwing_bitmask_t __unnamed__
uint16_t value

◆ rotwing_state_t

struct rotwing_state_t

Definition at line 61 of file rotwing_state.h.

Data Fields
float cruise_airspeed
bool fail_hover_motor
bool fail_pusher_motor
bool fail_skew_angle
bool force_skew
float fw_min_airspeed
bool hover_motors_enabled
float max_airspeed
int32_t meas_rpm[5]
float meas_rpm_time[5]
float meas_skew_angle_deg
float meas_skew_angle_time
float min_airspeed
enum rotwing_states_t nav_state
float ref_model_skew_angle_deg
int16_t skew_cmd
float sp_skew_angle_deg
enum rotwing_states_t state

◆ rotwing_bitmask_t.__unnamed307__

struct rotwing_bitmask_t.__unnamed307__

Definition at line 51 of file rotwing_state.h.

Data Fields
bool hover_motors_enabled: 1
bool hover_motors_idle: 1
bool hover_motors_running: 1
bool pusher_motor_running: 1
bool skew_angle_valid: 1
bool skew_forced: 1

Macro Definition Documentation

◆ ROTWING_QUAD_PREF_PITCH

#define ROTWING_QUAD_PREF_PITCH   -5.0

Definition at line 38 of file rotwing_state.h.

◆ ROTWING_SKEW_ANGLE_STEP

#define ROTWING_SKEW_ANGLE_STEP   55.0

Definition at line 33 of file rotwing_state.h.

Enumeration Type Documentation

◆ rotwing_states_t

Enumerator
ROTWING_STATE_FORCE_HOVER 
ROTWING_STATE_REQUEST_HOVER 
ROTWING_STATE_FORCE_FW 
ROTWING_STATE_REQUEST_FW 
ROTWING_STATE_FREE 

Definition at line 41 of file rotwing_state.h.

Function Documentation

◆ rotwing_state_choose_circle_direction()

bool rotwing_state_choose_circle_direction ( uint8_t  wp_id)

◆ rotwing_state_hover_motors_idling()

bool rotwing_state_hover_motors_idling ( void  )

Check if hover motors are idling (COMMAND_THRUST < ROTWING_QUAD_IDLE_MIN_THRUST) for ROTWING_QUAD_IDLE_TIMEOUT time.

Returns
true if hover motors are idling, false otherwise

Definition at line 162 of file rotwing_state.c.

References Stabilization::cmd, get_sys_time_float(), ROTWING_QUAD_IDLE_MIN_THRUST, ROTWING_QUAD_IDLE_TIMEOUT, and stabilization.

Referenced by guidance_indi_hybrid_set_wls_settings(), rotwing_state_periodic(), and send_rotating_wing_state().

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

◆ rotwing_state_hover_motors_running()

bool rotwing_state_hover_motors_running ( void  )

Definition at line 402 of file rotwing_state.c.

References get_sys_time_float(), rotwing_state_t::meas_rpm, rotwing_state_t::meas_rpm_time, ROTWING_QUAD_MIN_RPM, ROTWING_RPM_TIMEOUT, and rotwing_state.

Referenced by G1G2_oneloop(), guidance_indi_hybrid_set_wls_settings(), rotwing_state_periodic(), and send_rotating_wing_state().

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

◆ rotwing_state_init()

◆ rotwing_state_periodic()

void rotwing_state_periodic ( void  )

Definition at line 176 of file rotwing_state.c.

References ACT_FEEDBACK_BOARD_ID, Stabilization::att_submode, commands, rotwing_state_t::cruise_airspeed, rotwing_state_t::fail_hover_motor, rotwing_state_t::fail_pusher_motor, rotwing_state_t::fail_skew_angle, rotwing_state_t::force_skew, rotwing_state_t::fw_min_airspeed, get_sys_time_float(), gi_unbounded_airspeed_sp, guidance_h, GUIDANCE_H_MODE_NONE, guidance_set_min_max_airspeed(), rotwing_state_t::hover_motors_enabled, act_feedback_t::idx, rotwing_state_t::max_airspeed, MAX_PPRZ, rotwing_state_t::meas_rpm, rotwing_state_t::meas_rpm_time, rotwing_state_t::meas_skew_angle_deg, rotwing_state_t::min_airspeed, HorizontalGuidance::mode, Stabilization::mode, nav_max_deceleration_sp, rotwing_state_t::nav_state, act_feedback_t::act_feedback_set_t::position, act_feedback_t::position, rotwing_state_t::ref_model_skew_angle_deg, ROTWING_FW_SKEW_ANGLE, ROTWING_FW_STALL_TIMEOUT, ROTWING_MIN_AIRSPEED_SLOPE_START_ANGLE, ROTWING_PUSH_MIN_RPM, ROTWING_QUAD_MIN_RPM, ROTWING_SKEW_ANGLE_STEP, ROTWING_SKEW_BACK_MARGIN, rotwing_state, ROTWING_STATE_FORCE_FW, ROTWING_STATE_FORCE_HOVER, ROTWING_STATE_FREE, rotwing_state_hover_motors_idling(), rotwing_state_hover_motors_running(), rotwing_state_pusher_motor_running(), ROTWING_STATE_REQUEST_FW, ROTWING_STATE_REQUEST_HOVER, act_feedback_t::set, rotwing_state_t::skew_cmd, rotwing_state_t::sp_skew_angle_deg, speed_sp, stabilization, STABILIZATION_ATT_SUBMODE_FORWARD, STABILIZATION_MODE_ATTITUDE, STABILIZATION_MODE_NONE, rotwing_state_t::state, and stateGetAirspeed_f().

+ Here is the call graph for this function:

◆ rotwing_state_pusher_motor_running()

bool rotwing_state_pusher_motor_running ( void  )

Definition at line 419 of file rotwing_state.c.

References get_sys_time_float(), rotwing_state_t::meas_rpm, rotwing_state_t::meas_rpm_time, ROTWING_PUSH_MIN_RPM, ROTWING_RPM_TIMEOUT, and rotwing_state.

Referenced by guidance_indi_hybrid_set_wls_settings(), rotwing_state_periodic(), and send_rotating_wing_state().

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

◆ rotwing_state_set()

void rotwing_state_set ( enum rotwing_states_t  state)

Definition at line 436 of file rotwing_state.c.

References rotwing_state_t::nav_state, rotwing_state, and state.

◆ rotwing_state_set_transition_wp()

◆ rotwing_state_skew_angle_valid()

bool rotwing_state_skew_angle_valid ( void  )

Definition at line 428 of file rotwing_state.c.

References get_sys_time_float(), rotwing_state_t::meas_skew_angle_deg, rotwing_state_t::meas_skew_angle_time, rotwing_state_t::ref_model_skew_angle_deg, ROTWING_RPM_TIMEOUT, ROTWING_SKEW_REF_MODEL_MAX_DIFF, and rotwing_state.

Referenced by send_rotating_wing_state().

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

◆ rotwing_state_update_WP_height()

void rotwing_state_update_WP_height ( uint8_t  wp_id,
float  height 
)

Definition at line 506 of file rotwing_state.c.

References DefaultChannel, DefaultDevice, waypoint_set_enu(), waypoints, EnuCoor_f::x, point::x, and point::y.

+ Here is the call graph for this function:

Variable Documentation

◆ rotwing_state