Multicopter rate controller: Protect for full throttle scaling

PX4 supports -1 to 1 as input and this module was not protected against the input range.
This commit is contained in:
Lorenz Meier
2021-02-13 20:41:28 +01:00
parent 66d86aae2e
commit cc11fb2818

View File

@@ -192,7 +192,7 @@ MulticopterRateControl::Run()
math::superexpo(_manual_control_setpoint.r, _param_mc_acro_expo_y.get(), _param_mc_acro_supexpoy.get())};
_rates_sp = man_rate_sp.emult(_acro_rate_max);
_thrust_sp = _manual_control_setpoint.z;
_thrust_sp = math::constrain(_manual_control_setpoint.z, 0.0f, 1.0f);
// publish rate setpoint
vehicle_rates_setpoint_s v_rates_sp{};