Skip to content

Commit 0e9f842

Browse files
Merge pull request #11144 from sensei-hacker/fix-gps-recovery-issue-11049
Fix GPS recovery - update lastUpdateTime on first reading after signal recovery
2 parents 2be60b3 + 843f29d commit 0e9f842

File tree

2 files changed

+432
-3
lines changed

2 files changed

+432
-3
lines changed

src/main/navigation/navigation_pos_estimator.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,13 @@ void onNewGPSData(void)
256256
posEstimator.gps.eph = INAV_GPS_DEFAULT_EPH;
257257
posEstimator.gps.epv = INAV_GPS_DEFAULT_EPV;
258258
}
259-
260-
/* Indicate a last valid reading of Pos/Vel */
261-
posEstimator.gps.lastUpdateTime = currentTimeUs;
262259
}
263260

261+
/* Indicate a last valid reading of Pos/Vel - must be updated even on
262+
* first GPS reading after recovery to prevent position estimate from
263+
* timing out and getting stuck at zero (fixes issue #11049) */
264+
posEstimator.gps.lastUpdateTime = currentTimeUs;
265+
264266
previousLat = gpsSol.llh.lat;
265267
previousLon = gpsSol.llh.lon;
266268
previousAlt = gpsSol.llh.alt;

0 commit comments

Comments
 (0)