Copter: bypass compass healthy check when ext nav data is available for heading

This commit is contained in:
hoangthien94 2019-07-24 17:48:07 +08:00 committed by Randy Mackay
parent fc9ff2b09a
commit 6d8a1bbe81
1 changed files with 8 additions and 5 deletions

View File

@ -456,11 +456,14 @@ bool AP_Arming_Copter::arm_checks(AP_Arming::Method method)
}
#ifndef ALLOW_ARM_NO_COMPASS
const Compass &_compass = AP::compass();
// check compass health
if (!_compass.healthy()) {
check_failed(ARMING_CHECK_NONE, true, "Compass not healthy");
return false;
// if external source of heading is available, we can skip compass health check
if (!ahrs.is_ext_nav_used_for_yaw()) {
const Compass &_compass = AP::compass();
// check compass health
if (!_compass.healthy()) {
check_failed(ARMING_CHECK_NONE, true, "Compass not healthy");
return false;
}
}
#endif