From 5b07e0aa2f05686d945a13533a78397515dca7dd Mon Sep 17 00:00:00 2001 From: Balduin Date: Wed, 6 May 2026 18:33:56 +0200 Subject: [PATCH] refactor(control_allocator): remove different timeouts again in the name of simplicity, have one hardcoded timeout. Options to address actuators that need more time: - repeatedly send the command from the GS - use another param in the {MAV/VEHICLE}_CMD to specify the duration, expose also in commander interface, take default if not given --- src/modules/control_allocator/ActuatorGroupPreflightCheck.cpp | 4 +--- src/modules/control_allocator/ActuatorGroupPreflightCheck.hpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modules/control_allocator/ActuatorGroupPreflightCheck.cpp b/src/modules/control_allocator/ActuatorGroupPreflightCheck.cpp index 7f53575f75..3eba58c3b7 100644 --- a/src/modules/control_allocator/ActuatorGroupPreflightCheck.cpp +++ b/src/modules/control_allocator/ActuatorGroupPreflightCheck.cpp @@ -164,9 +164,7 @@ void ActuatorGroupPreflightCheck::updateState(hrt_abstime now) } } - const hrt_abstime duration = isThrust(_group) ? PREFLIGHT_CHECK_DURATION_THRUST : PREFLIGHT_CHECK_DURATION_SERVOS; - - if (now - _started >= duration) { + if (now - _started >= PREFLIGHT_CHECK_DURATION) { _running = false; sendAck(_last_command, vehicle_command_ack_s::VEHICLE_CMD_RESULT_ACCEPTED, now); } diff --git a/src/modules/control_allocator/ActuatorGroupPreflightCheck.hpp b/src/modules/control_allocator/ActuatorGroupPreflightCheck.hpp index 5e32bc0222..5be6870281 100644 --- a/src/modules/control_allocator/ActuatorGroupPreflightCheck.hpp +++ b/src/modules/control_allocator/ActuatorGroupPreflightCheck.hpp @@ -81,9 +81,7 @@ public: ActuatorEffectiveness &effectiveness); private: - static constexpr hrt_abstime PREFLIGHT_CHECK_DURATION_SERVOS = 500'000; // 500 ms - // A bit longer since FW forward thrust can have significant slew rate - static constexpr hrt_abstime PREFLIGHT_CHECK_DURATION_THRUST = 2'000'000; // 2 s + static constexpr hrt_abstime PREFLIGHT_CHECK_DURATION = 500'000; // 500 ms static bool isThrust(uint8_t group); static bool isKnownGroup(uint8_t group);