From ad42a5b2f9257f0f81609425d8ccda1d27580de9 Mon Sep 17 00:00:00 2001 From: Balduin Date: Mon, 17 Feb 2025 17:46:39 +0100 Subject: [PATCH] preflight check: more self explanatory code --- src/modules/control_allocator/ControlAllocator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/control_allocator/ControlAllocator.cpp b/src/modules/control_allocator/ControlAllocator.cpp index e40075a84f..89bc97aecd 100644 --- a/src/modules/control_allocator/ControlAllocator.cpp +++ b/src/modules/control_allocator/ControlAllocator.cpp @@ -502,16 +502,18 @@ void ControlAllocator::preflight_check_overwrite_torque_sp(matrix::Vector(_actuator_effectiveness) != nullptr; + int n_axes = 3; if (tiltrotor) { - max_phase = 4 * 2; + n_axes = 4; } + int max_phase = 2 * n_axes; + hrt_abstime now = hrt_absolute_time(); if (now - _last_preflight_check_update >= 500_ms) { _preflight_check_phase++;