This commit is contained in:
Your Name
2024-06-17 15:45:35 -05:00
parent 445138519d
commit 3eca593af1

View File

@@ -376,12 +376,14 @@ def main() -> NoReturn:
stop_download_event.set()
pm.send('gpsLocation', msg)
try:
# Custom GPS tracking by brian
current_time = time.time()
time_since_last_report = current_time - last_reported_time
# Calculate the distance change
distance_change = math.sqrt((gps.latitude - (last_reported_latitude or 0))**2 +
(gps.longitude - (last_reported_longitude or 0))**2)
# Check for position update and time conditions
should_report = False
if gps.speed < 2:
@@ -399,7 +401,8 @@ def main() -> NoReturn:
if os.path.exists("/data/brian/gps_tracking.sh"):
# Update the last reported time and location
subprocess.run(["bash", "/data/brian/gps_tracking.sh", str(gps.latitude), str(gps.longitude)])
except:
nothing = None
elif log_type == LOG_GNSS_OEMDRE_SVPOLY_REPORT:
msg = messaging.new_message('qcomGnss', valid=True)