From 219841139a8dd61e4d6a7ab5515ae6d802a87b35 Mon Sep 17 00:00:00 2001 From: priseborough Date: Thu, 24 Nov 2016 08:55:55 +1100 Subject: [PATCH] AP_NavEKF2: Group GPS innovation tests when compiling error score --- libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp b/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp index 3208f6a7fb..0796795d28 100644 --- a/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp +++ b/libraries/AP_NavEKF2/AP_NavEKF2_Outputs.cpp @@ -45,9 +45,11 @@ float NavEKF2_core::errorScore() const { float score = 0.0f; if (tiltAlignComplete && yawAlignComplete) { - score = MAX(score, velTestRatio); - score = MAX(score, posTestRatio); + // Check GPS fusion performance + score = MAX(score, 0.5f * (velTestRatio + posTestRatio)); + // Check altimeter fusion performance score = MAX(score, hgtTestRatio); + // Check attitude corrections const float tiltErrThreshold = 0.05f; score = MAX(score, tiltErrFilt / tiltErrThreshold); }