Skip to content
Snippets Groups Projects
Commit 43c377ca authored by Randy Mackay's avatar Randy Mackay
Browse files

Copter: add compass calibration to pre-arm check

parent 6efdabb1
No related branches found
No related tags found
No related merge requests found
......@@ -216,6 +216,23 @@ static void pre_arm_checks(bool display_failure)
return;
}
// check compass learning is on or offsets have been set
Vector3f offsets = compass.get_offsets();
if(!compass._learn && offsets.length() == 0) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Compass not calibrated"));
}
return;
}
// check for unreasonable compass offsets
if(offsets.length() > 500) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Compass offsets too high"));
}
return;
}
#if AC_FENCE == ENABLED
// check fence is initialised
if(!fence.pre_arm_check()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment