From eaad11bb743677fccea9947f0ac64152b220f39a Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Thu, 17 Aug 2023 10:02:48 +0200 Subject: [PATCH] ActuatorEffectiveness: add comment for 2% magic number to stop motors Signed-off-by: Silvan Fuhrer --- .../ActuatorEffectiveness/ActuatorEffectiveness.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.cpp b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.cpp index 099adb3120c5..901c469746e6 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.cpp +++ b/src/modules/control_allocator/ActuatorEffectiveness/ActuatorEffectiveness.cpp @@ -91,6 +91,8 @@ void ActuatorEffectiveness::stopMaskedMotorsWithZeroThrust(uint32_t stoppable_mo const uint32_t motor_mask = (1u << actuator_idx); if (stoppable_motors_mask & motor_mask) { + + // Stop motor if its setpoint is below 2%. This value was determined empirically (RC stick inaccuracy) if (fabsf(actuator_sp(actuator_idx)) < .02f) { _stopped_motors_mask |= motor_mask;