VTOL: fix quad-chute max altitude limit

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer
2023-01-12 09:29:21 +01:00
committed by Roman Bapst
parent 3d50a7ce44
commit 8a680a3153
2 changed files with 7 additions and 4 deletions
@@ -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
+5 -2
View File
@@ -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()