Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return failure in pre_arm_check if unhealthy #19787

Merged
merged 2 commits into from Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 20 additions & 3 deletions Tools/autotest/test_build_options.py
Expand Up @@ -54,6 +54,10 @@ def get_defines(feature, options):

def test_feature(feature, options):
defines = get_defines(feature, options)
test_compile_with_defines(defines)


def test_compile_with_defines(defines):
extra_hwdef_filepath = "/tmp/extra.hwdef"
write_defines_to_file(defines, extra_hwdef_filepath)
util.waf_configure(
Expand All @@ -64,12 +68,12 @@ def test_feature(feature, options):
try:
util.waf_build(t)
except Exception:
print("Failed to build (%s) with (%s) disabled" %
(t, feature.label))
print("Failed to build (%s) with everything disabled" %
(t,))
raise


def run():
def run_disable_in_turn():
options = get_build_options_from_ardupilot_tree()
count = 1
for feature in options:
Expand All @@ -79,5 +83,18 @@ def run():
count += 1


def run_disable_all():
options = get_build_options_from_ardupilot_tree()
defines = {}
for feature in options:
defines[feature.define] = 0
test_compile_with_defines(defines)


def run():
run_disable_all()
run_disable_in_turn()


if __name__ == '__main__':
run()
4 changes: 2 additions & 2 deletions libraries/AP_AHRS/AP_AHRS.cpp
Expand Up @@ -2033,11 +2033,11 @@ bool AP_AHRS::pre_arm_check(bool requires_position, char *failure_msg, uint8_t f
return ret;
#endif
case EKFType::NONE:
return dcm.pre_arm_check(requires_position, failure_msg, failure_msg_len);
return dcm.pre_arm_check(requires_position, failure_msg, failure_msg_len) && ret;

#if HAL_EXTERNAL_AHRS_ENABLED
case EKFType::EXTERNAL:
return AP::externalAHRS().pre_arm_check(failure_msg, failure_msg_len);
return AP::externalAHRS().pre_arm_check(failure_msg, failure_msg_len) && ret;
#endif

#if HAL_NAVEKF2_AVAILABLE
Expand Down