Switch manual_control_setpoint.z scaling from [0,1] to [-1,1]

To be consistent with all other axes of stick input and avoid future
rescaling confusion.

Note: for the MAVLink message 69 MANUAL_CONTROL it's using the full range
according to the message specs now [-1000,1000].
This commit is contained in:
Matthias Grob
2022-11-28 19:25:55 +01:00
parent 5579e319ff
commit 83246c84cf
13 changed files with 38 additions and 52 deletions
@@ -178,7 +178,7 @@ MulticopterRateControl::Run()
math::superexpo(manual_control_setpoint.r, _param_mc_acro_expo_y.get(), _param_mc_acro_supexpoy.get())};
_rates_setpoint = man_rate_sp.emult(_acro_rate_max);
_thrust_setpoint(2) = -math::constrain(manual_control_setpoint.z, 0.0f, 1.0f);
_thrust_setpoint(2) = -(manual_control_setpoint.z + 1.f) * .5f;
_thrust_setpoint(0) = _thrust_setpoint(1) = 0.f;
// publish rate setpoint