Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
rotwing_state.c File Reference
+ Include dependency graph for rotwing_state.c:

Go to the source code of this file.

Macros

#define ROTWING_MIN_SKEW_ANGLE_DEG_QUAD   10.0
 
#define ROTWING_MIN_SKEW_ANGLE_COUNTER   10
 
#define ROTWING_SKEWING_COUNTER   10
 
#define ROTWING_MAX_QUAD_AIRSPEED   20.0
 
#define ROTWING_HALF_SKEW_ANGLE_DEG   55.0
 
#define ROTWING_HALF_SKEW_ANGLE_HALF_RANGE   10.0
 
#define ROTWING_HALF_SKEW_COUNTER   10
 
#define ROTWING_MIN_FW_SKEW_ANGLE_DEG   80.0
 
#define ROTWING_MIN_FW_COUNTER   10
 
#define ROTWING_MIN_THRUST_IDLE   100
 
#define ROTWING_MIN_THRUST_IDLE_COUNTER   10
 
#define ROTWING_HOV_MOT_OFF_RPM_TH   50
 
#define ROTWING_HOV_MOT_OFF_COUNTER   10
 
#define ROTWING_STATE_USE_ROTATION_REF_MODEL   FALSE
 
#define ROTWING_STATE_HOVER_PREF_PITCH   0.0
 
#define ROTWING_STATE_TRANSITION_PREF_PITCH   3.0
 
#define ROTWING_STATE_FW_PREF_PITCH   8.0
 
#define ADC_WING_ROTATION   FALSE
 
#define ROTWING_STATE_ACT_FEEDBACK_ID   ABI_BROADCAST
 ABI binding feedback data. More...
 
#define ROTWING_STATE_NUM_HOVER_RPM   4
 
#define AIRSPEED_IMPORTANCE_IN_FORWARD_WEIGHT   16
 

Functions

static void rotwing_state_feedback_cb (uint8_t sender_id, struct act_feedback_t *feedback_msg, uint8_t num_act)
 
void rotwing_check_set_current_state (void)
 
void rotwing_switch_state (void)
 
void rotwing_state_set_hover_settings (void)
 
void rotwing_state_set_skewing_settings (void)
 
void rotwing_state_set_fw_settings (void)
 
void rotwing_state_set_fw_hov_mot_idle_settings (void)
 
void rotwing_state_set_fw_hov_mot_off_settings (void)
 
void rotwing_state_set_state_settings (void)
 
void rotwing_state_skewer (void)
 
void guidance_indi_hybrid_set_wls_settings (float body_v[3], float roll_angle, float pitch_angle)
 
static void send_rotating_wing_state (struct transport_tx *trans, struct link_device *dev)
 
void init_rotwing_state (void)
 
void periodic_rotwing_state (void)
 
void request_rotwing_state (uint8_t state)
 
void rotwing_request_configuration (uint8_t configuration)
 
void rotwing_state_skew_actuator_periodic (void)
 
static void rotwing_state_feedback_cb (uint8_t sender_id, struct act_feedback_t UNUSED *feedback_msg, uint8_t UNUSED num_act_message)
 

Variables

abi_event rotwing_state_feedback_ev
 
int32_t rotwing_state_hover_rpm [ROTWING_STATE_NUM_HOVER_RPM] = {0, 0, 0, 0}
 
struct RotwingState rotwing_state
 
struct RotWingStateSettings rotwing_state_settings
 
struct RotWingStateSkewing rotwing_state_skewing
 
uint8_t rotwing_state_hover_counter = 0
 
uint8_t rotwing_state_skewing_counter = 0
 
uint8_t rotwing_state_fw_counter = 0
 
uint8_t rotwing_state_fw_idle_counter = 0
 
uint8_t rotwing_state_fw_m_off_counter = 0
 
float rotwing_state_max_hover_speed = 7
 
bool hover_motors_active = true
 
bool bool_disable_hover_motors = false
 

Macro Definition Documentation

◆ ADC_WING_ROTATION

#define ADC_WING_ROTATION   FALSE

Definition at line 110 of file rotwing_state.c.

◆ AIRSPEED_IMPORTANCE_IN_FORWARD_WEIGHT

#define AIRSPEED_IMPORTANCE_IN_FORWARD_WEIGHT   16

◆ ROTWING_HALF_SKEW_ANGLE_DEG

#define ROTWING_HALF_SKEW_ANGLE_DEG   55.0

Definition at line 55 of file rotwing_state.c.

◆ ROTWING_HALF_SKEW_ANGLE_HALF_RANGE

#define ROTWING_HALF_SKEW_ANGLE_HALF_RANGE   10.0

Definition at line 58 of file rotwing_state.c.

◆ ROTWING_HALF_SKEW_COUNTER

#define ROTWING_HALF_SKEW_COUNTER   10

Definition at line 61 of file rotwing_state.c.

◆ ROTWING_HOV_MOT_OFF_COUNTER

#define ROTWING_HOV_MOT_OFF_COUNTER   10

Definition at line 85 of file rotwing_state.c.

◆ ROTWING_HOV_MOT_OFF_RPM_TH

#define ROTWING_HOV_MOT_OFF_RPM_TH   50

Definition at line 82 of file rotwing_state.c.

◆ ROTWING_MAX_QUAD_AIRSPEED

#define ROTWING_MAX_QUAD_AIRSPEED   20.0

Definition at line 50 of file rotwing_state.c.

◆ ROTWING_MIN_FW_COUNTER

#define ROTWING_MIN_FW_COUNTER   10

Definition at line 69 of file rotwing_state.c.

◆ ROTWING_MIN_FW_SKEW_ANGLE_DEG

#define ROTWING_MIN_FW_SKEW_ANGLE_DEG   80.0

Definition at line 66 of file rotwing_state.c.

◆ ROTWING_MIN_SKEW_ANGLE_COUNTER

#define ROTWING_MIN_SKEW_ANGLE_COUNTER   10

Definition at line 40 of file rotwing_state.c.

◆ ROTWING_MIN_SKEW_ANGLE_DEG_QUAD

#define ROTWING_MIN_SKEW_ANGLE_DEG_QUAD   10.0

Definition at line 37 of file rotwing_state.c.

◆ ROTWING_MIN_THRUST_IDLE

#define ROTWING_MIN_THRUST_IDLE   100

Definition at line 74 of file rotwing_state.c.

◆ ROTWING_MIN_THRUST_IDLE_COUNTER

#define ROTWING_MIN_THRUST_IDLE_COUNTER   10

Definition at line 77 of file rotwing_state.c.

◆ ROTWING_SKEWING_COUNTER

#define ROTWING_SKEWING_COUNTER   10

Definition at line 45 of file rotwing_state.c.

◆ ROTWING_STATE_ACT_FEEDBACK_ID

#define ROTWING_STATE_ACT_FEEDBACK_ID   ABI_BROADCAST

ABI binding feedback data.

Definition at line 118 of file rotwing_state.c.

◆ ROTWING_STATE_FW_PREF_PITCH

#define ROTWING_STATE_FW_PREF_PITCH   8.0

Definition at line 105 of file rotwing_state.c.

◆ ROTWING_STATE_HOVER_PREF_PITCH

#define ROTWING_STATE_HOVER_PREF_PITCH   0.0

Definition at line 95 of file rotwing_state.c.

◆ ROTWING_STATE_NUM_HOVER_RPM

#define ROTWING_STATE_NUM_HOVER_RPM   4

Definition at line 122 of file rotwing_state.c.

◆ ROTWING_STATE_TRANSITION_PREF_PITCH

#define ROTWING_STATE_TRANSITION_PREF_PITCH   3.0

Definition at line 100 of file rotwing_state.c.

◆ ROTWING_STATE_USE_ROTATION_REF_MODEL

#define ROTWING_STATE_USE_ROTATION_REF_MODEL   FALSE

Definition at line 89 of file rotwing_state.c.

Function Documentation

◆ guidance_indi_hybrid_set_wls_settings()

◆ init_rotwing_state()

◆ periodic_rotwing_state()

◆ request_rotwing_state()

void request_rotwing_state ( uint8_t  state)

Definition at line 217 of file rotwing_state.c.

References RotwingState::desired_state, rotwing_state, ROTWING_STATE_FW_HOV_MOT_OFF, and state.

Referenced by rotwing_request_configuration().

+ Here is the caller graph for this function:

◆ rotwing_check_set_current_state()

◆ rotwing_request_configuration()

void rotwing_request_configuration ( uint8_t  configuration)

◆ rotwing_state_feedback_cb() [1/2]

static void rotwing_state_feedback_cb ( uint8_t  sender_id,
struct act_feedback_t feedback_msg,
uint8_t  num_act 
)
static

Referenced by init_rotwing_state().

+ Here is the caller graph for this function:

◆ rotwing_state_feedback_cb() [2/2]

static void rotwing_state_feedback_cb ( uint8_t  sender_id,
struct act_feedback_t UNUSED feedback_msg,
uint8_t UNUSED  num_act_message 
)
static

◆ rotwing_state_set_fw_hov_mot_idle_settings()

◆ rotwing_state_set_fw_hov_mot_off_settings()

◆ rotwing_state_set_fw_settings()

◆ rotwing_state_set_hover_settings()

◆ rotwing_state_set_skewing_settings()

◆ rotwing_state_set_state_settings()

◆ rotwing_state_skew_actuator_periodic()

◆ rotwing_state_skewer()

void rotwing_state_skewer ( void  )
inline

Definition at line 543 of file rotwing_state.c.

References RotWingStateSkewing::airspeed_scheduling, RotwingState::desired_state, rotwing_state, ROTWING_STATE_HOVER, rotwing_state_skewing, stateGetAirspeed_f(), and RotWingStateSkewing::wing_angle_deg_sp.

Referenced by periodic_rotwing_state().

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

◆ rotwing_switch_state()

◆ send_rotating_wing_state()

static void send_rotating_wing_state ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Variable Documentation

◆ bool_disable_hover_motors

bool bool_disable_hover_motors = false

◆ hover_motors_active

bool hover_motors_active = true

◆ rotwing_state

◆ rotwing_state_feedback_ev

abi_event rotwing_state_feedback_ev

Definition at line 120 of file rotwing_state.c.

Referenced by init_rotwing_state().

◆ rotwing_state_fw_counter

uint8_t rotwing_state_fw_counter = 0

Definition at line 131 of file rotwing_state.c.

Referenced by rotwing_check_set_current_state().

◆ rotwing_state_fw_idle_counter

uint8_t rotwing_state_fw_idle_counter = 0

Definition at line 132 of file rotwing_state.c.

Referenced by rotwing_check_set_current_state().

◆ rotwing_state_fw_m_off_counter

uint8_t rotwing_state_fw_m_off_counter = 0

Definition at line 133 of file rotwing_state.c.

Referenced by rotwing_check_set_current_state().

◆ rotwing_state_hover_counter

uint8_t rotwing_state_hover_counter = 0

Definition at line 129 of file rotwing_state.c.

Referenced by rotwing_check_set_current_state().

◆ rotwing_state_hover_rpm

int32_t rotwing_state_hover_rpm[ROTWING_STATE_NUM_HOVER_RPM] = {0, 0, 0, 0}

Definition at line 123 of file rotwing_state.c.

Referenced by rotwing_check_set_current_state(), and rotwing_state_feedback_cb().

◆ rotwing_state_max_hover_speed

float rotwing_state_max_hover_speed = 7

Definition at line 135 of file rotwing_state.c.

Referenced by rotwing_state_set_hover_settings().

◆ rotwing_state_settings

◆ rotwing_state_skewing

◆ rotwing_state_skewing_counter

uint8_t rotwing_state_skewing_counter = 0

Definition at line 130 of file rotwing_state.c.

Referenced by rotwing_check_set_current_state().