Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/ctrl/eff_scheduling_rotwing_V2.h"
#include "generated/airframe.h"
#include "state.h"
#include "modules/actuators/actuators.h"
#include "modules/core/abi.h"
#include "filters/low_pass_filter.h"
#include "modules/ins/ins_ext_pose.h"
#include "firmwares/rotorcraft/oneloop/oneloop_andi.h"
#include "generated/modules.h"
Go to the source code of this file.
Macros | |
#define | FORCE_ONELOOP |
#define | WING_ROTATION_CAN_ROTWING_ID ABI_BROADCAST |
ABI binding wing position data. More... | |
Functions | |
void | eff_scheduling_rotwing_update_wing_angle (void) |
void | eff_scheduling_rotwing_update_airspeed (void) |
void | ele_pref_sched (void) |
void | update_attitude (void) |
void | sum_EFF_MAT_RW (void) |
Function that sums g1 and g2 to obtain the g1_g2 matrix. More... | |
void | init_RW_Model (void) |
void | calc_G1_G2_RW (void) |
static void | wing_position_cb (uint8_t sender_id UNUSED, struct act_feedback_t *pos_msg, uint8_t num_act) |
void | eff_scheduling_rotwing_init (void) |
void | eff_scheduling_rotwing_periodic (void) |
Variables | |
float | actuator_state_filt_vect [EFF_MAT_COLS_NB] = {0} |
float | G2_RW [EFF_MAT_COLS_NB] = {0} |
float | G1_RW [EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB] = {0} |
float | EFF_MAT_RW [EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB] = {0} |
static float | flt_cut_ap = 2.0e-3 |
static float | flt_cut = 1.0e-4 |
struct FloatEulers | eulers_zxy_RW_EFF |
static Butterworth2LowPass | skew_filt |
bool | airspeed_fake_on = false |
float | airspeed_fake = 0.0 |
float | ele_eff = 19.36 |
float | roll_eff = 5.5 |
float | yaw_eff = 0.390 |
float | ele_min = 0.0 |
struct RW_Model | RW |
static abi_event | wing_position_ev |
float | skew_meas = 0.0 |
float | time = 0.0 |
Definition in file eff_scheduling_rotwing_V2.c.
#define FORCE_ONELOOP |
Definition at line 34 of file eff_scheduling_rotwing_V2.c.
#define WING_ROTATION_CAN_ROTWING_ID ABI_BROADCAST |
ABI binding wing position data.
Definition at line 96 of file eff_scheduling_rotwing_V2.c.
void calc_G1_G2_RW | ( | void | ) |
Definition at line 224 of file eff_scheduling_rotwing_V2.c.
References actuator_state_1l, RW_Model::ail, RW_Model::as2, RW_Model::att, I::b_xx, I::b_yy, RW_skew::cosr, RW_skew::cosr2, RW_skew::cosr3, F_M_Body::dFdu, wing_model::dLdtheta, F_M_Body::dMdu, F_M_Body::dMdud, RW_Model::ele, ele_eff, RW_Model::flp, G1_RW, G2_RW, RW_Model::I, wing_model::k0, wing_model::k1, wing_model::k2, F_M_Body::l, wing_model::L, RW_Model::m, RW_Model::mB, RW_Model::mF, RW_Model::mL, RW_Model::mP, RW_Model::mR, RW_Model::P, RW_Model::rud, RW, RW_ap, RW_aq, RW_ar, RW_aX, RW_aZ, RW_G_SCALE, RW_skew::sinr, RW_skew::sinr2, RW_skew::sinr3, RW_Model::skew, RW_Model::T, RW_attitude::theta, I::w_xx, I::w_yy, RW_Model::wing, I::xx, I::yy, and I::zz.
Referenced by eff_scheduling_rotwing_periodic().
void eff_scheduling_rotwing_init | ( | void | ) |
Definition at line 115 of file eff_scheduling_rotwing_V2.c.
References init_butterworth_2_low_pass(), init_RW_Model(), skew_filt, update_attitude(), wing_position_cb(), wing_position_ev, and WING_ROTATION_CAN_ROTWING_ID.
void eff_scheduling_rotwing_periodic | ( | void | ) |
Definition at line 277 of file eff_scheduling_rotwing_V2.c.
References calc_G1_G2_RW(), eff_scheduling_rotwing_update_airspeed(), eff_scheduling_rotwing_update_wing_angle(), ele_pref_sched(), sum_EFF_MAT_RW(), and update_attitude().
|
inline |
Definition at line 401 of file eff_scheduling_rotwing_V2.c.
References airspeed_fake, airspeed_fake_on, RW_Model::as, RW_Model::as2, RW, stateGetAirspeed_f(), and time.
Referenced by eff_scheduling_rotwing_periodic().
|
inline |
Definition at line 381 of file eff_scheduling_rotwing_V2.c.
References RW_skew::cosr, RW_skew::cosr2, RW_skew::cosr3, RW_skew::deg, float_quat_of_eulers(), SecondOrderLowPass::o, RW_skew::rad, RW, RW_skew::sinr, RW_skew::sinr2, RW_skew::sinr3, RW_Model::skew, skew_filt, skew_meas, and update_butterworth_2_low_pass().
Referenced by eff_scheduling_rotwing_periodic().
void ele_pref_sched | ( | void | ) |
Definition at line 418 of file eff_scheduling_rotwing_V2.c.
References RW_Model::as, ELE_MAX_AS, ele_min, ELE_MIN_AS, RW_Model::ele_pref, RW, and ZERO_ELE_PPRZ.
Referenced by eff_scheduling_rotwing_periodic().
void init_RW_Model | ( | void | ) |
Definition at line 125 of file eff_scheduling_rotwing_V2.c.
References RW_Model::ail, RW_Model::as, RW_Model::as2, RW_Model::att, I::b_xx, I::b_yy, RW_skew::cosr, RW_skew::cosr2, RW_attitude::cphi, RW_attitude::cpsi, RW_attitude::ctheta, RW_skew::deg, F_M_Body::dFdu, F_M_Body::dMdu, F_M_Body::dMdud, RW_Model::ele, ele_eff, RW_Model::ele_pref, RW_Model::flp, RW_Model::I, wing_model::k0, wing_model::k1, wing_model::k2, F_M_Body::l, RW_Model::m, RW_Model::mB, RW_Model::mF, RW_Model::mL, RW_Model::mP, RW_Model::mR, RW_attitude::phi, RW_attitude::psi, RW_skew::rad, roll_eff, RW_Model::rud, RW, RW_G_SCALE, RW_skew::sinr, RW_skew::sinr2, RW_skew::sinr3, RW_Model::skew, RW_attitude::sphi, RW_attitude::spsi, RW_attitude::stheta, RW_attitude::theta, I::w_xx, I::w_yy, RW_Model::wing, I::xx, yaw_eff, I::yy, and I::zz.
Referenced by eff_scheduling_rotwing_init().
void sum_EFF_MAT_RW | ( | void | ) |
Function that sums g1 and g2 to obtain the g1_g2 matrix.
It also undoes the scaling that was done to make the values readable FIXME: make this function into a for loop to make it more adaptable to different configurations
Definition at line 294 of file eff_scheduling_rotwing_V2.c.
References RW_Model::att, RW_attitude::cphi, RW_attitude::cpsi, RW_attitude::ctheta, wing_model::dLdtheta, EFF_MAT_COLS_NB, EFF_MAT_ROWS_NB, EFF_MAT_RW, flt_cut, flt_cut_ap, G1_RW, G2_RW, wing_model::L, RW_Model::m, RW_Model::P, P, RW, RW_aD, RW_aE, RW_aN, RW_ap, RW_aq, RW_ar, RW_aX, RW_aZ, RW_attitude::sphi, RW_attitude::spsi, RW_attitude::stheta, RW_Model::T, mesonh.mesonh_atmosphere::T, and RW_Model::wing.
Referenced by eff_scheduling_rotwing_periodic().
void update_attitude | ( | void | ) |
Definition at line 210 of file eff_scheduling_rotwing_V2.c.
References RW_Model::att, RW_attitude::cphi, RW_attitude::cpsi, RW_attitude::ctheta, eulers_zxy_RW_EFF, float_eulers_of_quat_zxy(), FloatEulers::phi, RW_attitude::phi, FloatEulers::psi, RW_attitude::psi, RW, RW_attitude::sphi, RW_attitude::spsi, stateGetNedToBodyQuat_f(), RW_attitude::stheta, FloatEulers::theta, and RW_attitude::theta.
Referenced by eff_scheduling_rotwing_init(), and eff_scheduling_rotwing_periodic().
|
static |
Definition at line 102 of file eff_scheduling_rotwing_V2.c.
References skew_meas.
Referenced by eff_scheduling_rotwing_init().
float actuator_state_filt_vect[EFF_MAT_COLS_NB] = {0} |
Definition at line 37 of file eff_scheduling_rotwing_V2.c.
float airspeed_fake = 0.0 |
Definition at line 77 of file eff_scheduling_rotwing_V2.c.
Referenced by eff_scheduling_rotwing_update_airspeed().
bool airspeed_fake_on = false |
Definition at line 76 of file eff_scheduling_rotwing_V2.c.
Referenced by eff_scheduling_rotwing_update_airspeed().
float EFF_MAT_RW[EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB] = {0} |
Definition at line 69 of file eff_scheduling_rotwing_V2.c.
Referenced by calc_model(), G1G2_oneloop(), send_eff_mat_guid_oneloop_andi(), send_eff_mat_stab_oneloop_andi(), and sum_EFF_MAT_RW().
float ele_eff = 19.36 |
Definition at line 78 of file eff_scheduling_rotwing_V2.c.
Referenced by calc_G1_G2_RW(), and init_RW_Model().
float ele_min = 0.0 |
Definition at line 81 of file eff_scheduling_rotwing_V2.c.
Referenced by ele_pref_sched(), and oneloop_andi_enter().
struct FloatEulers eulers_zxy_RW_EFF |
Definition at line 71 of file eff_scheduling_rotwing_V2.c.
Referenced by update_attitude().
|
static |
Definition at line 71 of file eff_scheduling_rotwing_V2.c.
Referenced by sum_EFF_MAT_RW().
|
static |
Definition at line 70 of file eff_scheduling_rotwing_V2.c.
Referenced by sum_EFF_MAT_RW().
float G1_RW[EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB] = {0} |
Definition at line 68 of file eff_scheduling_rotwing_V2.c.
Referenced by calc_G1_G2_RW(), and sum_EFF_MAT_RW().
float G2_RW[EFF_MAT_COLS_NB] = {0} |
Definition at line 67 of file eff_scheduling_rotwing_V2.c.
Referenced by calc_G1_G2_RW(), oneloop_andi_run(), and sum_EFF_MAT_RW().
float roll_eff = 5.5 |
Definition at line 79 of file eff_scheduling_rotwing_V2.c.
Referenced by init_RW_Model().
struct RW_Model RW |
Definition at line 81 of file eff_scheduling_rotwing_V2.c.
Referenced by calc_G1_G2_RW(), calc_model(), eff_scheduling_rotwing_update_airspeed(), eff_scheduling_rotwing_update_wing_angle(), ele_pref_sched(), init_RW_Model(), oneloop_andi_run(), sum_EFF_MAT_RW(), and update_attitude().
|
static |
Definition at line 74 of file eff_scheduling_rotwing_V2.c.
Referenced by eff_scheduling_rotwing_init(), and eff_scheduling_rotwing_update_wing_angle().
float skew_meas = 0.0 |
Definition at line 101 of file eff_scheduling_rotwing_V2.c.
Referenced by eff_scheduling_rotwing_update_wing_angle(), and wing_position_cb().
timestamp date of calibration in mtostk_time_t unix time = 0.0 |
Definition at line 400 of file eff_scheduling_rotwing_V2.c.
Referenced by eff_scheduling_rotwing_update_airspeed(), gyro_cb(), init_random(), logger_file_start(), nps_autopilot_run_step(), nps_flightgear_init(), nps_radio_control_available(), nps_sensor_accel_init(), nps_sensor_airspeed_init(), nps_sensor_aoa_init(), nps_sensor_baro_init(), nps_sensor_gps_init(), nps_sensor_gps_run_step(), nps_sensor_gyro_init(), nps_sensor_mag_init(), nps_sensor_sideslip_init(), nps_sensor_sonar_init(), nps_sensor_temperature_init(), nps_sensors_init(), nps_sensors_run_step(), orange_avoider_guided_init(), orange_avoider_init(), radio_control_script_ff(), radio_control_script_step_pitch(), radio_control_script_step_roll(), radio_control_script_step_yaw(), radio_control_script_takeoff(), UpdateSensorLatency(), and UpdateSensorLatency_Single().
|
static |
Definition at line 99 of file eff_scheduling_rotwing_V2.c.
Referenced by eff_scheduling_rotwing_init().
float yaw_eff = 0.390 |
Definition at line 80 of file eff_scheduling_rotwing_V2.c.
Referenced by eff_scheduling_falcon_periodic(), eff_scheduling_periodic_b(), and init_RW_Model().