From 5b1b6f6080fb86407a30b65f64594af1defa5d52 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Wed, 10 Aug 2022 10:54:28 +0200 Subject: [PATCH] mc_att_control_main: use gradual() for throttle curve rescale without hover thrust --- src/modules/mc_att_control/mc_att_control_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index 88eb51aa51..4f119ffade 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -101,7 +101,7 @@ MulticopterAttitudeControl::throttle_curve(float throttle_stick_input) // throttle_stick_input is in range [0, 1] switch (_param_mpc_thr_curve.get()) { case 1: // no rescaling to hover throttle - return throttle_min + throttle_stick_input * (_param_mpc_thr_max.get() - throttle_min); + return math::gradual(throttle_stick_input, 0.f, 1.f, throttle_min, _param_mpc_thr_max.get()); default: // 0 or other: rescale to hover throttle at 0.5 stick return math::gradual3(throttle_stick_input,