diff --git a/ArduSub/turn_counter.cpp b/ArduSub/turn_counter.cpp index f2260aa12e..52df84fecb 100644 --- a/ArduSub/turn_counter.cpp +++ b/ArduSub/turn_counter.cpp @@ -8,11 +8,11 @@ void Sub::update_turn_counter() // Determine state // 0: 0-90 deg, 1: 90-180 deg, 2: -180--90 deg, 3: -90--0 deg uint8_t turn_state; - if (ahrs.yaw >= 0.0f && ahrs.yaw < radians(90)) { + if (ahrs.get_yaw() >= 0.0f && ahrs.get_yaw() < radians(90)) { turn_state = 0; - } else if (ahrs.yaw > radians(90)) { + } else if (ahrs.get_yaw() > radians(90)) { turn_state = 1; - } else if (ahrs.yaw < -radians(90)) { + } else if (ahrs.get_yaw() < -radians(90)) { turn_state = 2; } else { turn_state = 3;