AP_Fence: add pre-arm check for fence enabled but none selected

This commit is contained in:
Hwurzburg 2021-05-18 10:20:49 -05:00 committed by Peter Barker
parent cd43c0ecef
commit faf4993436

View File

@ -282,6 +282,12 @@ bool AC_Fence::pre_arm_check(const char* &fail_msg) const
{
fail_msg = nullptr;
// if fences are enabled but none selected fail pre-arm check
if (enabled() && !present()) {
fail_msg = "Fences enabled, but none selected";
return false;
}
// if not enabled or not fence set-up always return true
if ((!_enabled && !_auto_enabled) || !_enabled_fences) {
return true;