diff --git a/src/modules/vtol_att_control/vtol_att_control_params.c b/src/modules/vtol_att_control/vtol_att_control_params.c index 80662e708f..1fd5432d19 100644 --- a/src/modules/vtol_att_control/vtol_att_control_params.c +++ b/src/modules/vtol_att_control/vtol_att_control_params.c @@ -249,13 +249,13 @@ PARAM_DEFINE_INT32(VT_FW_QC_P, 0); PARAM_DEFINE_INT32(VT_FW_QC_R, 0); /** - * Quadchute maximum height. + * Quadchute maximum height * * Maximum height above the ground (if available, otherwhise above home if available, otherwise above the local origin) where triggering a quadchute is possible. * Triggering a quadchute always means transitioning the vehicle to hover flight in which generally a lot of energy is consumed. * At high altitudes there is therefore a big risk to deplete the battery and therefore crash. Currently, there is no automated * re-transition to fixed wing mode implemented and therefore this parameter serves and an intermediate measure to increase safety. - * Setting this value to 0 deactivates the behavior. + * Setting this value to 0 deactivates the behavior (always enable quad-chute independently of altitude). * * @unit m * @min 0 diff --git a/src/modules/vtol_att_control/vtol_type.cpp b/src/modules/vtol_att_control/vtol_type.cpp index 4a64ad9203..508a01e1c8 100644 --- a/src/modules/vtol_att_control/vtol_type.cpp +++ b/src/modules/vtol_att_control/vtol_type.cpp @@ -228,9 +228,12 @@ bool VtolType::isQuadchuteEnabled() } + const bool above_quadchute_altitude_limit = _param_quadchute_max_height.get() > 0 + && dist_to_ground > (float)_param_quadchute_max_height.get(); + return _v_control_mode->flag_armed && - !_land_detected->landed && _param_quadchute_max_height.get() > 0 && - dist_to_ground < (float)_param_quadchute_max_height.get(); + !_land_detected->landed && !above_quadchute_altitude_limit; + } bool VtolType::isMinAltBreached()