|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/rotwing_drone/rotwing_state.h"#include "firmwares/rotorcraft/autopilot_firmware.h"#include "modules/core/commands.h"#include "modules/actuators/actuators.h"#include "modules/core/abi.h"#include "generated/airframe.h"#include "modules/datalink/telemetry.h"Go to the source code of this file.
Functions | |
| ASSERT_EQUIVALENCE (MOTOR_FRONT, BMOTOR_FRONT) | |
| ASSERT_EQUIVALENCE (MOTOR_RIGHT, BMOTOR_RIGHT) | |
| ASSERT_EQUIVALENCE (MOTOR_BACK, BMOTOR_BACK) | |
| ASSERT_EQUIVALENCE (MOTOR_LEFT, BMOTOR_LEFT) | |
| static void | rotwing_state_feedback_cb (uint8_t sender_id, struct act_feedback_t *feedback_msg, uint8_t num_act) |
| static void | rotwing_state_skew_sweep (bool run, float time) |
| Sweep the skew angle setpoint between skew_sweep.min_deg and skew_sweep.max_deg at skew_sweep.freq, starting from min_deg. | |
| static void | send_rotating_wing_state (struct transport_tx *trans, struct link_device *dev) |
| void | rotwing_state_init (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. | |
| void | rotwing_state_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) |
| bool | rotwing_state_hover_motors_running (void) |
| bool | rotwing_state_pusher_motor_running (void) |
| bool | rotwing_state_skew_angle_valid (void) |
| void | rotwing_state_set (enum rotwing_states_t state) |
| bool | rotwing_state_choose_circle_direction (uint8_t wp_id) |
| bool | rotwing_state_choose_state_by_dist (uint8_t wp_id) |
Variables | |
| abi_event | rotwing_state_feedback_ev |
| struct rotwing_state_t | rotwing_state |
| #define ASSERT_EQUIVALENCE | ( | primary, | |
| backup ) |
Definition at line 33 of file rotwing_state.c.
| #define GUIDANCE_INDI_FWD_CLIMB_SPEED 4.0 |
Climb speed when navigation is making turns instead of direct lines.
Definition at line 156 of file rotwing_state.c.
| #define GUIDANCE_INDI_FWD_DESCEND_SPEED -4.0 |
Descend speed when navigation is making turns instead of direct lines.
Definition at line 163 of file rotwing_state.c.
| #define GUIDANCE_INDI_QUAD_CLIMB_SPEED 2.0 |
Climb speed when navigation is doing direct lines.
Definition at line 170 of file rotwing_state.c.
| #define GUIDANCE_INDI_QUAD_DESCEND_SPEED -2.0 |
Descend speed when navigation is doing direct lines.
Definition at line 177 of file rotwing_state.c.
| #define ROTWING_FW_SKEW_ANGLE 85.0 |
Definition at line 77 of file rotwing_state.c.
Referenced by rotwing_state_periodic().
| #define ROTWING_FW_STALL_TIMEOUT 0.5 |
Definition at line 117 of file rotwing_state.c.
Referenced by rotwing_state_periodic().
| #define ROTWING_MIN_AIRSPEED_SLOPE_START_ANGLE 30.0 |
Definition at line 112 of file rotwing_state.c.
Referenced by rotwing_state_periodic().
| #define ROTWING_PUSH_MIN_RPM 300 |
Definition at line 57 of file rotwing_state.c.
Referenced by rotwing_state_periodic(), and rotwing_state_pusher_motor_running().
| #define ROTWING_QUAD_IDLE_MIN_THRUST 100 |
Definition at line 67 of file rotwing_state.c.
Referenced by rotwing_state_hover_motors_idling().
| #define ROTWING_QUAD_IDLE_TIMEOUT 0.4 |
Definition at line 72 of file rotwing_state.c.
Referenced by rotwing_state_hover_motors_idling().
| #define ROTWING_QUAD_MIN_RPM 400 |
Definition at line 52 of file rotwing_state.c.
Referenced by rotwing_state_hover_motors_running(), and rotwing_state_periodic().
| #define ROTWING_QUAD_SKEW_ANGLE 25.0 |
Definition at line 82 of file rotwing_state.c.
Referenced by rotwing_state_periodic().
| #define ROTWING_RPM_TIMEOUT 1.0 |
Definition at line 62 of file rotwing_state.c.
Referenced by rotwing_state_hover_motors_running(), rotwing_state_pusher_motor_running(), and rotwing_state_skew_angle_valid().
| #define ROTWING_SKEW_BACK_MARGIN 5.0 |
Definition at line 102 of file rotwing_state.c.
Referenced by rotwing_state_periodic().
| #define ROTWING_SKEW_REF_MODEL_MAX_DIFF 5.f |
Definition at line 107 of file rotwing_state.c.
Referenced by rotwing_state_skew_angle_valid().
| #define ROTWING_SKEW_SWEEP_FREQ 0.1f |
Definition at line 134 of file rotwing_state.c.
Referenced by rotwing_state_init().
| #define ROTWING_SKEW_SWEEP_MAX 60.f |
Definition at line 130 of file rotwing_state.c.
Referenced by rotwing_state_init().
| #define ROTWING_SKEW_SWEEP_MIN 0.f |
Definition at line 126 of file rotwing_state.c.
Referenced by rotwing_state_init().
| #define ROTWING_STATE_ACT_FEEDBACK_ID ABI_BROADCAST |
ABI binding feedback data.
Definition at line 149 of file rotwing_state.c.
Referenced by rotwing_state_init().
| #define ROTWING_STATE_MIN_FW_DIST 200.0 |
Definition at line 121 of file rotwing_state.c.
Referenced by rotwing_state_choose_state_by_dist().
| #define ROTWING_TRANSITION_MAX_BANK RadOfDeg(20) |
Definition at line 87 of file rotwing_state.c.
Referenced by rotwing_state_periodic().
| #define ROTWING_TRANSITION_MAX_CLIMB_SPEED 0.5 |
Definition at line 92 of file rotwing_state.c.
Referenced by rotwing_state_periodic().
| #define ROTWING_TRANSITION_MAX_DESCEND_SPEED -0.5 |
Definition at line 97 of file rotwing_state.c.
Referenced by rotwing_state_periodic().
| #define SERVO_BMOTOR_PUSH_IDX SERVO_MOTOR_PUSH_IDX |
Definition at line 139 of file rotwing_state.c.
Referenced by rotwing_state_feedback_cb().
| #define SERVO_BROTATION_MECH_IDX SERVO_ROTATION_MECH_IDX |
Definition at line 144 of file rotwing_state.c.
Referenced by rotwing_state_feedback_cb().
| ASSERT_EQUIVALENCE | ( | MOTOR_BACK | , |
| BMOTOR_BACK | ) |
References MOTOR_BACK.
| ASSERT_EQUIVALENCE | ( | MOTOR_FRONT | , |
| BMOTOR_FRONT | ) |
References MOTOR_FRONT.
| ASSERT_EQUIVALENCE | ( | MOTOR_LEFT | , |
| BMOTOR_LEFT | ) |
References MOTOR_LEFT.
| ASSERT_EQUIVALENCE | ( | MOTOR_RIGHT | , |
| BMOTOR_RIGHT | ) |
References MOTOR_RIGHT.
| bool rotwing_state_choose_circle_direction | ( | uint8_t | wp_id | ) |
Definition at line 591 of file rotwing_state.c.
References float_rmat_transp_vmult(), stateGetNedToBodyRMat_f(), stateGetPositionNed_f(), VECT3_CROSS_PRODUCT, VECT3_DIFF, VECT3_DOT_PRODUCT, waypoints, FloatVect3::x, NedCoor_f::x, FloatVect3::y, NedCoor_f::y, and NedCoor_f::z.
| bool rotwing_state_choose_state_by_dist | ( | uint8_t | wp_id | ) |
Definition at line 626 of file rotwing_state.c.
References AP_MODE_NAV, autopilot, dist2_to_wp, get_dist2_to_point(), ROTWING_STATE_MIN_FW_DIST, ROTWING_STATE_REQUEST_FW, ROTWING_STATE_REQUEST_HOVER, rotwing_state_set(), and waypoints.
|
static |
|
static |
Definition at line 514 of file rotwing_state.c.
References get_sys_time_float(), idx, act_feedback_t::act_feedback_set_t::position, rotwing_state, act_feedback_t::act_feedback_set_t::rpm, SERVO_BMOTOR_PUSH_IDX, SERVO_BROTATION_MECH_IDX, act_feedback_t::set, and UNUSED.
| 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.
Definition at line 269 of file rotwing_state.c.
References 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().
| bool rotwing_state_hover_motors_running | ( | void | ) |
Definition at line 551 of file rotwing_state.c.
References get_sys_time_float(), ROTWING_QUAD_MIN_RPM, ROTWING_RPM_TIMEOUT, and rotwing_state.
Referenced by compute_accel_from_speed_sp(), G1G2_oneloop(), guidance_indi_hybrid_set_wls_settings(), rotwing_state_periodic(), and send_rotating_wing_state().
| void rotwing_state_init | ( | void | ) |
Definition at line 227 of file rotwing_state.c.
References DefaultPeriodic, preflight_check_register(), register_periodic_telemetry(), ROTWING_SKEW_SWEEP_FREQ, ROTWING_SKEW_SWEEP_MAX, ROTWING_SKEW_SWEEP_MIN, rotwing_state, ROTWING_STATE_ACT_FEEDBACK_ID, rotwing_state_feedback_cb(), rotwing_state_feedback_ev, ROTWING_STATE_FORCE_HOVER, and send_rotating_wing_state().
| void rotwing_state_periodic | ( | void | ) |
Definition at line 303 of file rotwing_state.c.
References ACT_FEEDBACK_BOARD_ID, actuators_pprz, AP_MODE_FAILSAFE, autopilot, commands, get_sys_time_float(), gi_unbounded_airspeed_sp, guidance_h, GUIDANCE_H_MAX_BANK, GUIDANCE_H_MODE_NONE, GUIDANCE_INDI_FWD_CLIMB_SPEED, GUIDANCE_INDI_FWD_DESCEND_SPEED, GUIDANCE_INDI_QUAD_CLIMB_SPEED, GUIDANCE_INDI_QUAD_DESCEND_SPEED, guidance_set_max_bank_angle(), guidance_set_max_climb_speed(), guidance_set_max_descend_speed(), guidance_set_min_max_airspeed(), act_feedback_t::idx, MAX_PPRZ, nav_max_deceleration_sp, act_feedback_t::act_feedback_set_t::position, act_feedback_t::position, ROTWING_FW_SKEW_ANGLE, ROTWING_FW_STALL_TIMEOUT, ROTWING_MIN_AIRSPEED_SLOPE_START_ANGLE, ROTWING_PUSH_MIN_RPM, ROTWING_QUAD_MIN_RPM, ROTWING_QUAD_SKEW_ANGLE, 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, rotwing_state_skew_angle_valid(), rotwing_state_skew_sweep(), ROTWING_TRANSITION_MAX_BANK, ROTWING_TRANSITION_MAX_CLIMB_SPEED, ROTWING_TRANSITION_MAX_DESCEND_SPEED, act_feedback_t::set, speed_sp, stabilization, STABILIZATION_ATT_SUBMODE_FORWARD, STABILIZATION_MODE_ATTITUDE, STABILIZATION_MODE_NONE, stateGetAirspeed_f(), and stateSetFixedWingFlight().
| bool rotwing_state_pusher_motor_running | ( | void | ) |
Definition at line 568 of file rotwing_state.c.
References get_sys_time_float(), ROTWING_PUSH_MIN_RPM, ROTWING_RPM_TIMEOUT, and rotwing_state.
Referenced by compute_accel_from_speed_sp(), guidance_indi_hybrid_set_wls_settings(), rotwing_state_periodic(), and send_rotating_wing_state().
| void rotwing_state_set | ( | enum rotwing_states_t | state | ) |
Definition at line 585 of file rotwing_state.c.
References rotwing_state, and state.
Referenced by rotwing_state_choose_state_by_dist().
| bool rotwing_state_skew_angle_valid | ( | void | ) |
Definition at line 577 of file rotwing_state.c.
References get_sys_time_float(), ROTWING_RPM_TIMEOUT, ROTWING_SKEW_REF_MODEL_MAX_DIFF, and rotwing_state.
Referenced by rotwing_state_periodic(), and send_rotating_wing_state().
|
static |
Sweep the skew angle setpoint between skew_sweep.min_deg and skew_sweep.max_deg at skew_sweep.freq, starting from min_deg.
Only runs while the skew is forced and the sweep is active, otherwise the setpoint is left as it is.
Definition at line 288 of file rotwing_state.c.
References rotwing_state, and start_time.
Referenced by rotwing_state_periodic().
|
static |
Definition at line 186 of file rotwing_state.c.
References dev, gi_unbounded_airspeed_sp, rotwing_state, rotwing_state_hover_motors_idling(), rotwing_state_hover_motors_running(), rotwing_state_pusher_motor_running(), rotwing_state_skew_angle_valid(), state, and status.
Referenced by rotwing_state_init().
| struct rotwing_state_t rotwing_state |
Definition at line 183 of file rotwing_state.c.
Referenced by G1G2_oneloop(), guidance_indi_hybrid_set_wls_settings(), oneloop_andi_run(), rotwing_state_feedback_cb(), rotwing_state_hover_motors_running(), rotwing_state_init(), rotwing_state_periodic(), rotwing_state_pusher_motor_running(), rotwing_state_set(), rotwing_state_skew_angle_valid(), rotwing_state_skew_sweep(), and send_rotating_wing_state().
| abi_event rotwing_state_feedback_ev |
Definition at line 180 of file rotwing_state.c.
Referenced by rotwing_state_init().