AP_ExternalAHRS: Check backend pre-arm before origin

* This allows the backend to report more detailed errors
* Before this, many pre-arm errors were hidden by origin failure
* If pre-arm could report multiple errors, that would be ideal

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
This commit is contained in:
Ryan Friedman 2024-03-24 18:00:04 -06:00 committed by Randy Mackay
parent a0939dd518
commit e7b934dacd

View File

@ -235,11 +235,14 @@ bool AP_ExternalAHRS::pre_arm_check(char *failure_msg, uint8_t failure_msg_len)
hal.util->snprintf(failure_msg, failure_msg_len, "ExternalAHRS: Invalid backend"); hal.util->snprintf(failure_msg, failure_msg_len, "ExternalAHRS: Invalid backend");
return false; return false;
} }
if (!backend->pre_arm_check(failure_msg, failure_msg_len)) {
return false;
}
if (!state.have_origin) { if (!state.have_origin) {
hal.util->snprintf(failure_msg, failure_msg_len, "ExternalAHRS: No origin"); hal.util->snprintf(failure_msg, failure_msg_len, "ExternalAHRS: No origin");
return false;
} }
return backend->pre_arm_check(failure_msg, failure_msg_len); return true;
} }
/* /*