From a998bf781e59b9d30a4c87c2b13049db1b906fe2 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Sat, 7 Jun 2025 11:39:26 -0400 Subject: [PATCH] refactor --- sunnypilot/mapd/live_map_data/base_map_data.py | 14 -------------- sunnypilot/mapd/live_map_data/osm_map_data.py | 1 - 2 files changed, 15 deletions(-) diff --git a/sunnypilot/mapd/live_map_data/base_map_data.py b/sunnypilot/mapd/live_map_data/base_map_data.py index 60071238ba..536d7720b7 100644 --- a/sunnypilot/mapd/live_map_data/base_map_data.py +++ b/sunnypilot/mapd/live_map_data/base_map_data.py @@ -16,11 +16,6 @@ from openpilot.sunnypilot.navd.helpers import Coordinate, coordinate_from_param class BaseMapData(ABC): def __init__(self): self.params = Params() - self._last_gps: Coordinate | None = None - self._gps_location_service = get_gps_location_service(self.params) - self._gps_packets = [self._gps_location_service] - self._sm = messaging.SubMaster(['livePose', 'carControl'] + self._gps_packets) - self._pm = messaging.PubMaster(['liveMapDataSP']) self.gps_location_service = get_gps_location_service(self.params) self.sm = messaging.SubMaster(['livePose', 'carControl'] + [self.gps_location_service]) @@ -65,15 +60,6 @@ class BaseMapData(ABC): mapd_sp_send.valid = self.sm.all_checks(service_list=[self.gps_location_service, 'livePose']) live_map_data = mapd_sp_send.liveMapDataSP - if self._last_gps: - live_map_data.lastGpsTimestamp = self._last_gps.annotations.get('unixTimestampMillis', 0) - live_map_data.lastGpsLatitude = self._last_gps.latitude - live_map_data.lastGpsLongitude = self._last_gps.longitude - live_map_data.lastGpsSpeed = self._last_gps.annotations.get('speed', 0) - live_map_data.lastGpsBearingDeg = self._last_gps.annotations.get('bearingDeg', 0) - live_map_data.lastGpsAccuracy = self._last_gps.annotations.get('accuracy', 0) - live_map_data.lastGpsBearingAccuracyDeg = self._last_gps.annotations.get('bearingAccuracyDeg', 0) - live_map_data.speedLimitValid = bool(speed_limit > 0) live_map_data.speedLimit = speed_limit live_map_data.speedLimitAheadValid = bool(next_speed_limit > 0) diff --git a/sunnypilot/mapd/live_map_data/osm_map_data.py b/sunnypilot/mapd/live_map_data/osm_map_data.py index b9449669d8..5f74a5d011 100644 --- a/sunnypilot/mapd/live_map_data/osm_map_data.py +++ b/sunnypilot/mapd/live_map_data/osm_map_data.py @@ -8,7 +8,6 @@ import json import platform from openpilot.common.params import Params -from openpilot.sunnypilot.navd.helpers import Coordinate from openpilot.sunnypilot.mapd.live_map_data.base_map_data import BaseMapData from openpilot.sunnypilot.navd.helpers import Coordinate