Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
A guidance mode based on Incremental Nonlinear Dynamic Inversion Come to IROS2016 to learn more! More...
#include "generated/airframe.h"
#include "firmwares/rotorcraft/guidance/guidance_indi_hybrid.h"
#include "modules/radio_control/radio_control.h"
#include "firmwares/rotorcraft/autopilot_rc_helpers.h"
#include "state.h"
#include "mcu_periph/sys_time.h"
#include "autopilot.h"
#include "stdio.h"
#include "filters/low_pass_filter.h"
#include "modules/core/abi.h"
#include "firmwares/rotorcraft/navigation.h"
#include "modules/datalink/telemetry.h"
Go to the source code of this file.
A guidance mode based on Incremental Nonlinear Dynamic Inversion Come to IROS2016 to learn more!
Definition in file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_AIRSPEED_FILT_CUTOFF 0.5 |
Definition at line 196 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_COORDINATED_TURN_AIRSPEED_MARGIN 0.0 |
Definition at line 212 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_COORDINATED_TURN_MAX_AIRSPEED 30.0 |
Definition at line 208 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_COORDINATED_TURN_MIN_AIRSPEED 10.0 |
Definition at line 204 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_FILTER_CUTOFF 3.0 |
Definition at line 191 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_FWD_CLIMB_SPEED 4.0 |
Climb speed when navigation is making turns instead of direct lines.
Definition at line 86 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_FWD_DESCEND_SPEED -4.0 |
Descend speed when navigation is making turns instead of direct lines.
Definition at line 93 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_LIFTD_ASQ 0.20 |
Definition at line 58 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_LIFTD_P50 (GUIDANCE_INDI_LIFTD_P80/2) |
Definition at line 71 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_LIFTD_P80 (GUIDANCE_INDI_LIFTD_ASQ*12*12) |
Definition at line 70 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_MAX_LAT_ACCEL 9.81 |
Definition at line 200 of file guidance_indi_hybrid.c.
Definition at line 62 of file guidance_indi_hybrid.c.
Definition at line 79 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_POS_GAIN 0.5 |
Definition at line 53 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_POS_GAINZ 0.5 |
Definition at line 54 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_QUAD_CLIMB_SPEED 2.0 |
Climb speed when navigation is doing direct lines.
Definition at line 100 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_QUAD_DESCEND_SPEED -2.0 |
Descend speed when navigation is doing direct lines.
Definition at line 107 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_SPEED_GAIN 1.8 |
Definition at line 48 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_SPEED_GAINZ 1.8 |
Definition at line 49 of file guidance_indi_hybrid.c.
#define GUIDANCE_INDI_VEL_SP_ID ABI_BROADCAST |
Definition at line 292 of file guidance_indi_hybrid.c.
Definition at line 149 of file guidance_indi_hybrid.c.
#define TURN_AIRSPEED_TH 13.0 |
Definition at line 154 of file guidance_indi_hybrid.c.
Definition at line 749 of file guidance_indi_hybrid.c.
References guidance_indi_hybrid_params::climb_vspeed_fwd, guidance_indi_hybrid_params::climb_vspeed_quad, guidance_indi_hybrid_params::descend_vspeed_fwd, guidance_indi_hybrid_params::descend_vspeed_quad, foo, gih_params, stateGetAirspeed_f(), and TURN_AIRSPEED_TH.
Referenced by guidance_indi_run_mode().
|
static |
Definition at line 623 of file guidance_indi_hybrid.c.
References desired_airspeed, eulers_zxy, FLOAT_ANGLE_NORMALIZE, float_eulers_of_quat_zxy(), FLOAT_VECT2_NORM, float_vect3_bound_in_2d(), foo, force_forward, gi_speed_sp, gi_unbounded_airspeed_sp, gih_params, guidance_indi_airspeed_filt, guidance_indi_airspeed_filtering, GUIDANCE_INDI_MAX_LAT_ACCEL, guidance_indi_hybrid_params::heading_bank_gain, guidance_indi_hybrid_params::max_airspeed, guidance_indi_hybrid_params::min_airspeed, SecondOrderLowPass::o, FloatEulers::psi, rotwing_state_hover_motors_running(), rotwing_state_pusher_motor_running(), guidance_indi_hybrid_params::speed_gain, guidance_indi_hybrid_params::speed_gainz, guidance_indi_hybrid_params::stall_protect_gain, stateGetAirspeed_f(), stateGetNedToBodyQuat_f(), stateGetSpeedNed_f(), TURN_AIRSPEED_TH, VECT2_DIFF, FloatVect2::x, FloatVect3::x, NedCoor_f::x, FloatVect2::y, FloatVect3::y, NedCoor_f::y, FloatVect3::z, and NedCoor_f::z.
Referenced by guidance_indi_run_mode().
Call upon entering indi guidance.
Definition at line 389 of file guidance_indi_hybrid.c.
References accely_filt, Stabilization::cmd, eulers_zxy, filt_accel_ned, filter_cutoff, float_eulers_of_quat_zxy(), foo, guidance_indi_airspeed_filt, guidance_indi_airspeed_filt_cutoff, guidance_indi_hybrid_heading_sp, RotorcraftNavigation::heading, init_butterworth_2_low_pass(), nav, FloatEulers::phi, pitch_filt, FloatEulers::psi, roll_filt, stabilization, stateGetNedToBodyQuat_f(), FloatEulers::theta, thrust_act, thrust_filt, and thrust_in.
Get the derivative of lift w.r.t.
pitch.
airspeed | The airspeed says most about the flight condition |
Definition at line 883 of file guidance_indi_hybrid.c.
References foo, gih_params, guidance_indi_hybrid_params::liftd_asq, guidance_indi_hybrid_params::liftd_p50, and guidance_indi_hybrid_params::liftd_p80.
Referenced by guidance_indi_calcg_wing(), and guidance_indi_calcg_wing().
Init function.
Definition at line 343 of file guidance_indi_hybrid.c.
References accely_filt, DefaultPeriodic, filt_accel_ned, filter_cutoff, foo, Ga, guidance_indi_airspeed_filt, guidance_indi_airspeed_filt_cutoff, GUIDANCE_INDI_VEL_SP_ID, init_butterworth_2_low_pass(), pitch_filt, register_periodic_telemetry(), roll_filt, send_eff_mat_guid_indi_hybrid(), send_guidance_indi_hybrid(), thrust_dyn, thrust_filt, vel_sp_cb(), and vel_sp_ev.
Low pass the accelerometer measurements to remove noise from vibrations.
The roll and pitch also need to be filtered to synchronize them with the acceleration Called as a periodic function with PERIODIC_FREQ
Definition at line 856 of file guidance_indi_hybrid.c.
References ACCEL_FLOAT_OF_BFP, accely_filt, eulers_zxy, filt_accel_ned, foo, guidance_indi_airspeed_filt, FloatEulers::phi, pitch_filt, roll_filt, stateGetAccelBody_i(), stateGetAccelNed_f(), stateGetAirspeed_f(), FloatEulers::theta, update_butterworth_2_low_pass(), NedCoor_f::x, NedCoor_f::y, and NedCoor_f::z.
Referenced by guidance_indi_run().
struct StabilizationSetpoint guidance_indi_run | ( | struct FloatVect3 * | accel_sp, |
float | heading_sp | ||
) |
accel_sp | accel setpoint in NED frame [m/s^2] |
heading_sp | the desired heading [rad] |
main indi guidance function
Definition at line 426 of file guidance_indi_hybrid.c.
References accely_filt, du_gih, euler_cmd, eulers_zxy, filt_accel_ned, FLOAT_ANGLE_NORMALIZE, float_eulers_of_quat_zxy(), float_mat3_mult(), float_mat_inv_3d(), float_quat_normalize(), float_quat_of_eulers_zxy(), foo, g1g2, Ga, Ga_inv, gih_coordinated_turn_max_airspeed, gih_coordinated_turn_min_airspeed, guidance_euler_cmd, guidance_indi_calcg_wing(), guidance_indi_hybrid_heading_sp, guidance_indi_hybrid_set_wls_settings(), guidance_indi_max_bank, GUIDANCE_INDI_MAX_PITCH, GUIDANCE_INDI_MAX_PUSHER_INCREMENT, guidance_indi_min_pitch, guidance_indi_propagate_filters(), guidance_indi_specific_force_gain, heading, SecondOrderLowPass::o, FloatRates::p, FloatEulers::phi, pitch_filt, FloatEulers::psi, radio_control, RADIO_PITCH, RADIO_ROLL, RADIO_THROTTLE, roll_filt, sp_accel, stab_sp_from_quat_ff_rates_f(), stabilization, stabilization_attitude_get_heading_f(), stateGetAirspeed_f(), stateGetNedToBodyEulers_f(), stateGetNedToBodyQuat_f(), take_heading_control, th_sp_from_incr_vect_f(), th_sp_from_thrust_i(), FloatEulers::theta, THRUST_AXIS_Z, thrust_filt, thrust_in, thrust_sp, Stabilization::transition_ratio, v_gih, RadioControl::values, VECT3_DIFF, wls_alloc(), FloatVect3::x, FloatVect3::y, and FloatVect3::z.
Referenced by guidance_indi_run_mode().
struct StabilizationSetpoint guidance_indi_run_mode | ( | bool in_flight | UNUSED, |
struct HorizontalGuidance * | gh, | ||
struct VerticalGuidance * | gv, | ||
enum GuidanceIndiHybrid_HMode | h_mode, | ||
enum GuidanceIndiHybrid_VMode | v_mode | ||
) |
Definition at line 760 of file guidance_indi_hybrid.c.
References ACCEL_FLOAT_OF_BFP, bound_vz_sp(), compute_accel_from_speed_sp(), foo, get_sys_time_float(), gi_speed_sp, gih_params, GUIDANCE_INDI_HYBRID_H_POS, GUIDANCE_INDI_HYBRID_H_SPEED, GUIDANCE_INDI_HYBRID_V_ACCEL, GUIDANCE_INDI_HYBRID_V_POS, GUIDANCE_INDI_HYBRID_V_SPEED, guidance_indi_run(), indi_vel_sp, POS_FLOAT_OF_BFP, guidance_indi_hybrid_params::pos_gain, guidance_indi_hybrid_params::pos_gainz, SPEED_FLOAT_OF_BFP, guidance_indi_hybrid_params::speed_gain, guidance_indi_hybrid_params::speed_gainz, stateGetPositionNed_f(), stateGetSpeedNed_f(), time_of_vel_sp, FloatVect3::x, NedCoor_f::x, FloatVect3::y, NedCoor_f::y, FloatVect3::z, and NedCoor_f::z.
Definition at line 414 of file guidance_indi_hybrid.c.
References gih_params, max_airspeed, guidance_indi_hybrid_params::max_airspeed, and guidance_indi_hybrid_params::min_airspeed.
Referenced by rotwing_state_periodic().
|
static |
Definition at line 303 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_init().
|
static |
Definition at line 310 of file guidance_indi_hybrid.c.
References dev, euler_cmd, filt_accel_ned, foo, gi_speed_sp, SecondOrderLowPass::o, sp_accel, FloatVect3::x, FloatVect3::y, and FloatVect3::z.
Referenced by guidance_indi_init().
|
static |
ABI callback that obtains the velocity setpoint from a module.
Definition at line 915 of file guidance_indi_hybrid.c.
References foo, get_sys_time_float(), indi_vel_sp, time_of_vel_sp, FloatVect3::x, FloatVect3::y, and FloatVect3::z.
Referenced by guidance_indi_init().
Butterworth2LowPass accely_filt |
Definition at line 240 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), guidance_indi_init(), guidance_indi_propagate_filters(), and guidance_indi_run().
Definition at line 229 of file guidance_indi_hybrid.c.
struct FloatVect2 desired_airspeed |
Definition at line 243 of file guidance_indi_hybrid.c.
Referenced by compute_accel_from_speed_sp().
float du_gih[GUIDANCE_INDI_HYBRID_U] |
Definition at line 249 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run().
struct FloatVect3 euler_cmd |
Definition at line 247 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run(), and send_guidance_indi_hybrid().
struct FloatEulers eulers_zxy |
state eulers in zxy order
Definition at line 232 of file guidance_indi_hybrid.c.
Referenced by compute_accel_from_speed_sp(), eff_scheduling_falcon_periodic(), eff_scheduling_periodic_b(), guidance_indi_calcg_wing(), guidance_indi_calcg_wing(), guidance_indi_enter(), guidance_indi_hybrid_set_wls_settings(), guidance_indi_propagate_filters(), guidance_indi_run(), schdule_control_effectiveness(), and send_fp().
Butterworth2LowPass filt_accel_ned[3] |
Definition at line 236 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), guidance_indi_init(), guidance_indi_propagate_filters(), guidance_indi_run(), and send_guidance_indi_hybrid().
float filter_cutoff = GUIDANCE_INDI_FILTER_CUTOFF |
Definition at line 281 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), and guidance_indi_init().
forward flight for hybrid nav
Definition at line 160 of file guidance_indi_hybrid.c.
Referenced by compute_accel_from_speed_sp(), and reshape_wind().
Definition at line 246 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_init(), guidance_indi_run(), and send_eff_mat_guid_indi_hybrid().
struct FloatVect3 gi_speed_sp = {0.0, 0.0, 0.0} |
Definition at line 289 of file guidance_indi_hybrid.c.
Referenced by compute_accel_from_speed_sp(), guidance_indi_run_mode(), and send_guidance_indi_hybrid().
Definition at line 244 of file guidance_indi_hybrid.c.
Referenced by compute_accel_from_speed_sp(), rotwing_state_periodic(), and send_rotating_wing_state().
float gih_coordinated_turn_max_airspeed = GUIDANCE_INDI_COORDINATED_TURN_MAX_AIRSPEED + GUIDANCE_INDI_COORDINATED_TURN_AIRSPEED_MARGIN |
Definition at line 226 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run().
float gih_coordinated_turn_min_airspeed = GUIDANCE_INDI_COORDINATED_TURN_MIN_AIRSPEED |
Definition at line 225 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run().
struct guidance_indi_hybrid_params gih_params |
Definition at line 110 of file guidance_indi_hybrid.c.
Referenced by bound_vz_sp(), compute_accel_from_speed_sp(), guidance_indi_get_liftd(), guidance_indi_run_mode(), and guidance_set_min_max_airspeed().
struct FloatEulers guidance_euler_cmd |
Definition at line 285 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run().
Butterworth2LowPass guidance_indi_airspeed_filt |
Definition at line 241 of file guidance_indi_hybrid.c.
Referenced by compute_accel_from_speed_sp(), guidance_indi_enter(), guidance_indi_init(), and guidance_indi_propagate_filters().
float guidance_indi_airspeed_filt_cutoff = GUIDANCE_INDI_AIRSPEED_FILT_CUTOFF |
Definition at line 282 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), and guidance_indi_init().
Definition at line 162 of file guidance_indi_hybrid.c.
Referenced by compute_accel_from_speed_sp().
Definition at line 284 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), and guidance_indi_run().
float guidance_indi_max_bank = GUIDANCE_H_MAX_BANK |
Definition at line 218 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run().
float guidance_indi_min_pitch = GUIDANCE_INDI_MIN_PITCH |
Definition at line 219 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run().
float guidance_indi_pitch_pref_deg = 0 |
Definition at line 131 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_hybrid_set_wls_settings().
struct FloatVect3 indi_vel_sp = {0.0, 0.0, 0.0} |
Definition at line 296 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run_mode(), and vel_sp_cb().
float inv_eff[4] |
Definition at line 215 of file guidance_indi_hybrid.c.
Butterworth2LowPass pitch_filt |
Definition at line 238 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), guidance_indi_init(), guidance_indi_propagate_filters(), and guidance_indi_run().
Butterworth2LowPass roll_filt |
Definition at line 237 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), guidance_indi_init(), guidance_indi_propagate_filters(), and guidance_indi_run().
struct FloatVect3 sp_accel = {0.0,0.0,0.0} |
Definition at line 165 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run(), and send_guidance_indi_hybrid().
Definition at line 158 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run().
Definition at line 235 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter().
Definition at line 234 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_init().
Butterworth2LowPass thrust_filt |
Definition at line 239 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), guidance_indi_init(), and guidance_indi_run().
float thrust_in |
Definition at line 287 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_enter(), and guidance_indi_run().
struct ThrustSetpoint thrust_sp |
Definition at line 286 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run().
float time_of_vel_sp = 0.0 |
Definition at line 297 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_run_mode(), and vel_sp_cb().
float v_gih[3] |
Definition at line 278 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_calcg_wing(), and guidance_indi_run().
abi_event vel_sp_ev |
Definition at line 294 of file guidance_indi_hybrid.c.
Referenced by guidance_indi_init().