From 270844745f5e2bf58fc1372e180516e0398b53d6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 1 Jan 2020 09:08:31 +1100 Subject: [PATCH] AP_Compass: limit rotations we try to ROTATION_MAX_AUTO_ROTATION --- libraries/AP_Compass/CompassCalibrator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/AP_Compass/CompassCalibrator.cpp b/libraries/AP_Compass/CompassCalibrator.cpp index 633a5a0541..49334f4147 100644 --- a/libraries/AP_Compass/CompassCalibrator.cpp +++ b/libraries/AP_Compass/CompassCalibrator.cpp @@ -823,9 +823,9 @@ bool CompassCalibrator::calculate_orientation(void) // this function is very slow EXPECT_DELAY_MS(1000); - float variance[ROTATION_MAX] {}; + float variance[ROTATION_MAX_AUTO_ROTATION+1] {}; - for (enum Rotation r = ROTATION_NONE; r