fix(commander): size ArmingCheckReply queue to MAX_NUM_REGISTRATIONS

The ArmingCheckReply uORB queue was sized to 4 (ORB_QUEUE_LENGTH) while
ExternalChecks supports up to MAX_NUM_REGISTRATIONS (8) external modes,
each of which publishes a reply for every ArmingCheckRequest. With more
than 4 registered modes the replies from the 5th+ mode overwrote earlier
ones within a single request cycle, so those modes were flagged
"unresponsive" and silently failed to activate.

Increase ORB_QUEUE_LENGTH to 8 to match MAX_NUM_REGISTRATIONS, and add a
static_assert so the two limits cannot drift apart again.

Fixes #27271

Signed-off-by: Marko T <marko.tavcar@c-astral.com>
This commit is contained in:
Marko T
2026-06-01 10:11:20 +02:00
committed by Beat Küng
parent e17d81af21
commit e0488b19e5
2 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -40,4 +40,7 @@ bool mode_req_home_position # Requires a home position (such as RTL/Return mode)
bool mode_req_prevent_arming # Prevent arming (such as in Land mode)
bool mode_req_manual_control # Requires a manual controller
uint8 ORB_QUEUE_LENGTH = 4
# Must be >= ExternalChecks::MAX_NUM_REGISTRATIONS so replies from all registered
# modes fit in the queue within a single request cycle (otherwise replies from the
# 5th+ mode overwrite earlier ones, causing spurious "unresponsive mode" failures).
uint8 ORB_QUEUE_LENGTH = 8
@@ -33,6 +33,10 @@
#include "externalChecks.hpp"
// The reply queue must hold one reply from every registered mode within a single request cycle (https://github.com/PX4/PX4-Autopilot/issues/27271)
static_assert(arming_check_reply_s::ORB_QUEUE_LENGTH >= ExternalChecks::MAX_NUM_REGISTRATIONS,
"ArmingCheckReply ORB_QUEUE_LENGTH must be >= ExternalChecks::MAX_NUM_REGISTRATIONS");
static void setOrClearRequirementBits(bool requirement_set, int8_t nav_state, int8_t replaces_nav_state, uint32_t &bits)
{
if (requirement_set) {