Arming: use compass.configured method

This checks that when compass offset learning is off, that the offsets
are non-zero and that the detected device id matches the device id
stored to eeprom when the offsets were last saved.
This commit is contained in:
Randy Mackay 2014-07-09 17:28:53 +09:00
parent 170ca89a21
commit 76369d153f

View File

@ -113,8 +113,7 @@ bool AP_Arming::compass_checks(bool report)
return false;
}
// check compass learning is on or offsets have been set
Vector3f offsets = compass->get_offsets();
if(!compass->_learn && offsets.length() == 0) {
if (!compass.learn_offsets_enabled() && !compass.configured()) {
if (report) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Compass not calibrated"));
}