Skip to content

Commit

Permalink
Improved lazy GPS fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
connervieira committed Jun 10, 2024
1 parent 35d75ca commit 64954bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,10 @@ def gps_daemon():
most_recent_gps_location = get_gps_location()
time.sleep(float(config["general"]["gps"]["lazy_polling_interval"])) # Wait before polling the GPS again.
def get_gps_location_lazy(): # This function gets the most recent GPS location from the lazy GPS monitor.
return most_recent_gps_location
try:
return most_recent_gps_location
except:
return [0.0, 0.0, 0.0, 0.0, 0.0, 0, 0]
gps_daemon_thread = threading.Thread(target=gps_daemon, name="LazyGPSDaemon") # Create the lazy GPS manager thread.
gps_daemon_thread.start() # Start the GPS daemon thread.

Expand Down

0 comments on commit 64954bd

Please sign in to comment.