From b86e16e9272e03d077dbef0f5325e96ff6bafd23 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 19 Aug 2020 11:24:45 +0900 Subject: [PATCH] AP_NavEKF3: readRngBcnData gets minor formatting fix --- libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp b/libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp index 1646d826f8..dd682a7da4 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp +++ b/libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp @@ -882,14 +882,14 @@ void NavEKF3_core::readRngBcnData() } // Check if the range beacon data can be used to align the vehicle position - if (imuSampleTime_ms - rngBcnLast3DmeasTime_ms < 250 && beaconVehiclePosErr < 1.0f && rngBcnAlignmentCompleted) { + if ((imuSampleTime_ms - rngBcnLast3DmeasTime_ms < 250) && (beaconVehiclePosErr < 1.0f) && rngBcnAlignmentCompleted) { // check for consistency between the position reported by the beacon and the position from the 3-State alignment filter const float posDiffSq = sq(receiverPos.x - beaconVehiclePosNED.x) + sq(receiverPos.y - beaconVehiclePosNED.y); const float posDiffVar = sq(beaconVehiclePosErr) + receiverPosCov[0][0] + receiverPosCov[1][1]; if (posDiffSq < 9.0f * posDiffVar) { rngBcnGoodToAlign = true; // Set the EKF origin and magnetic field declination if not previously set - if (!validOrigin && PV_AidingMode != AID_ABSOLUTE) { + if (!validOrigin && (PV_AidingMode != AID_ABSOLUTE)) { // get origin from beacon system Location origin_loc; if (beacon->get_origin(origin_loc)) {