From bd0229b7bce518defd3d2394648e070226a1450c Mon Sep 17 00:00:00 2001 From: priseborough Date: Mon, 22 May 2017 11:05:40 +1000 Subject: [PATCH] AP_GPS: Fix bug in calculation of blended GPS delay --- 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 0d776dabe7..ebd0e13c14 100644 --- a/libraries/AP_GPS/AP_GPS.cpp +++ b/libraries/AP_GPS/AP_GPS.cpp @@ -1454,7 +1454,7 @@ void AP_GPS::calc_blended_state(void) if (_blend_weights[i] > 0.0f) { temp_time_1 += (double)timing[i].last_fix_time_ms * (double) _blend_weights[i]; temp_time_2 += (double)timing[i].last_message_time_ms * (double)_blend_weights[i]; - _blended_lag_sec += get_lag(i) * _blended_lag_sec; + _blended_lag_sec += get_lag(i) * _blend_weights[i]; } } timing[GPS_BLENDED_INSTANCE].last_fix_time_ms = (uint32_t)temp_time_1;