diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index f0979950ee..c23f48cd64 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -828,7 +828,7 @@ MulticopterAttitudeControl::sensor_correction_poll() } /* update the latest gyro selection */ - if (_sensor_correction.selected_gyro_instance <= sizeof(_sensor_gyro_sub) / sizeof(_sensor_gyro_sub[0])) { + if (_sensor_correction.selected_gyro_instance < sizeof(_sensor_gyro_sub) / sizeof(_sensor_gyro_sub[0])) { _selected_gyro = _sensor_correction.selected_gyro_instance; } }