Skip to content

Commit

Permalink
AP_ExternalAHRS: Check backend pre-arm before origin
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
Ryanf55 authored and tridge committed Mar 26, 2024
1 parent 95ac178 commit 35451c7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libraries/AP_ExternalAHRS/AP_ExternalAHRS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
return false;
}

if (!backend->pre_arm_check(failure_msg, failure_msg_len)) {
return false;
}
if (!state.have_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;
}

/*
Expand Down

0 comments on commit 35451c7

Please sign in to comment.