mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-28 02:13:45 +08:00
see sat 2
This commit is contained in:
@@ -55,6 +55,16 @@ class GnssHealth:
|
||||
|
||||
def _update(self) -> None:
|
||||
sm = ui_state.sm
|
||||
|
||||
# qcomgpsd publishes gpsLocation; gpsLocationExternal is only used by ublox/car-GPS devices,
|
||||
# so checking that socket alone leaves hasFix stuck False on this hardware.
|
||||
for service in ("gpsLocation", "gpsLocationExternal"):
|
||||
if sm.valid.get(service, False) and sm.recv_frame[service] > 0:
|
||||
self._has_fix = sm[service].hasFix
|
||||
break
|
||||
|
||||
# qcomGnss multiplexes measurement/drMeasurement/svPoly, so only act on the variant that
|
||||
# carries per-satellite status rather than returning early on the others.
|
||||
if not sm.valid.get("qcomGnss", False):
|
||||
return
|
||||
|
||||
@@ -77,9 +87,6 @@ class GnssHealth:
|
||||
noise = [sv.carrierNoise for sv in svs if sv.carrierNoise > 0]
|
||||
self._cno = sum(noise) / len(noise) if noise else 0.0
|
||||
|
||||
if sm.valid.get("gpsLocationExternal", False):
|
||||
self._has_fix = sm["gpsLocationExternal"].hasFix
|
||||
|
||||
def render(self, bounds: rl.Rectangle) -> None:
|
||||
self._update()
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ class UIState:
|
||||
"selfdriveState",
|
||||
"longitudinalPlan",
|
||||
"gpsLocationExternal",
|
||||
"gpsLocation",
|
||||
"qcomGnss",
|
||||
"mapdOut",
|
||||
"carOutput",
|
||||
|
||||
Reference in New Issue
Block a user