mc_att_control_main: use gradual() for throttle curve rescale without hover thrust

This commit is contained in:
Matthias Grob
2022-08-11 14:18:54 +02:00
parent 7cb6a47714
commit 5b1b6f6080
@@ -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,