From f7ac6c8d869e4ce2e690066c7deb0e21cba205af Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 18 May 2016 16:32:32 +1000 Subject: [PATCH] AP_Compass: make internal compasses use a higher cal threshold they tend to be a lot noisier --- libraries/AP_Compass/AP_Compass_Calibration.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Compass/AP_Compass_Calibration.cpp b/libraries/AP_Compass/AP_Compass_Calibration.cpp index b9d73f2e33..b8da7070b3 100644 --- a/libraries/AP_Compass/AP_Compass_Calibration.cpp +++ b/libraries/AP_Compass/AP_Compass_Calibration.cpp @@ -50,9 +50,12 @@ Compass::start_calibration(uint8_t i, bool retry, bool autosave, float delay, bo if (!is_calibrating() && delay > 0.5f) { AP_Notify::events.initiated_compass_cal = 1; } - if (i == get_primary()) { + if (i == get_primary() && _state[i].external != 0) { _calibrator[i].set_tolerance(_calibration_threshold); } else { + // internal compasses or secondary compasses get twice the + // threshold. This is because internal compasses tend to be a + // lot noisier _calibrator[i].set_tolerance(_calibration_threshold*2); } _calibrator[i].start(retry, autosave, delay);