mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-23 14:47:44 +08:00
FW attitude controller: add protection against division by zero in airspeed scaling
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Daniel Agar
parent
436258c1c5
commit
8400f2c9bc
@@ -256,7 +256,8 @@ float FixedwingAttitudeControl::get_airspeed_and_update_scaling()
|
||||
*
|
||||
* Forcing the scaling to this value allows reasonable handheld tests.
|
||||
*/
|
||||
const float airspeed_constrained = constrain(airspeed, _param_fw_airspd_min.get(), _param_fw_airspd_max.get());
|
||||
const float airspeed_constrained = constrain(constrain(airspeed, _param_fw_airspd_min.get(),
|
||||
_param_fw_airspd_max.get()), 0.1f, 1000.0f);
|
||||
|
||||
_airspeed_scaling = (_param_fw_arsp_scale_en.get()) ? (_param_fw_airspd_trim.get() / airspeed_constrained) : 1.0f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user