From b4f5d49adb0ead40e61aaed50aeed1117f3bc3d5 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 11 Mar 2024 11:29:58 +1100 Subject: [PATCH] AP_GPS: remove redundant check get_type has this sanity check --- libraries/AP_GPS/AP_GPS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_GPS/AP_GPS.cpp b/libraries/AP_GPS/AP_GPS.cpp index de82e9041e..fb51c2df81 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -2418,7 +2418,7 @@ bool AP_GPS::gps_yaw_deg(uint8_t instance, float &yaw_deg, float &accuracy_deg, { #if GPS_MAX_RECEIVERS > 1 const auto type = get_type(instance); - if (instance < GPS_MAX_RECEIVERS && + if ( ((type == GPS_TYPE_UBLOX_RTK_BASE) || (type == GPS_TYPE_UAVCAN_RTK_BASE)) && ((get_type(instance^1) == GPS_TYPE_UBLOX_RTK_ROVER) || (get_type(instance^1) == GPS_TYPE_UAVCAN_RTK_ROVER))) { // return the yaw from the rover