From 3512d374dd2ceea1300fc57a055c62f2b8bf1f1c Mon Sep 17 00:00:00 2001 From: RomanBapst Date: Mon, 2 Oct 2023 11:28:29 +0300 Subject: [PATCH] PerformanceModel: limit maximum climbrate to expected climbrate at service ceiling Signed-off-by: RomanBapst --- .../fw_pos_control/performance_model/PerformanceModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/fw_pos_control/performance_model/PerformanceModel.cpp b/src/modules/fw_pos_control/performance_model/PerformanceModel.cpp index c96bad651681..75fd53b7db2c 100644 --- a/src/modules/fw_pos_control/performance_model/PerformanceModel.cpp +++ b/src/modules/fw_pos_control/performance_model/PerformanceModel.cpp @@ -84,7 +84,7 @@ float PerformanceModel::getMaximumClimbRate(float air_density) const (CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C - density_min), 0.0f); const float delta_rho = air_density - CONSTANTS_AIR_DENSITY_SEA_LEVEL_15C; - climbrate_max = _param_fw_t_clmb_max.get() + density_gradient * delta_rho; + climbrate_max = math::max(_param_fw_t_clmb_max.get() + density_gradient * delta_rho, kClimbrateMin); } return climbrate_max / getWeightRatio();