diff --git a/libraries/AP_Compass/AP_Compass_Calibration.cpp b/libraries/AP_Compass/AP_Compass_Calibration.cpp index 2f004b9929..d09c371956 100644 --- a/libraries/AP_Compass/AP_Compass_Calibration.cpp +++ b/libraries/AP_Compass/AP_Compass_Calibration.cpp @@ -200,7 +200,7 @@ bool Compass::_accept_calibration(uint8_t i) set_and_save_offdiagonals(i,offdiag); set_and_save_scale_factor(i,scale_factor); - if (_get_state(prio).external && _rotate_auto >= 2) { + if (cal_report.check_orientation && _get_state(prio).external && _rotate_auto >= 2) { set_and_save_orientation(i, cal_report.orientation); } diff --git a/libraries/AP_Compass/CompassCalibrator.cpp b/libraries/AP_Compass/CompassCalibrator.cpp index 6d9d44e51a..0f06eb51de 100644 --- a/libraries/AP_Compass/CompassCalibrator.cpp +++ b/libraries/AP_Compass/CompassCalibrator.cpp @@ -321,6 +321,7 @@ void CompassCalibrator::update_cal_report() cal_report.orientation_confidence = _orientation_confidence; cal_report.original_orientation = _orig_orientation; cal_report.orientation = _orientation_solution; + cal_report.check_orientation = _check_orientation; } // running method for use in thread diff --git a/libraries/AP_Compass/CompassCalibrator.h b/libraries/AP_Compass/CompassCalibrator.h index cdca4e35b8..3faaafa717 100644 --- a/libraries/AP_Compass/CompassCalibrator.h +++ b/libraries/AP_Compass/CompassCalibrator.h @@ -67,6 +67,7 @@ public: Rotation original_orientation; Rotation orientation; float scale_factor; + bool check_orientation; } cal_report; // Structure setup to set calibration run settings