Drop gpsd support and the GNSS simulator service: the car's GNSS comes over CAN later; /api/gnss/position and the GNSS control stay, fed through GNSS_LATEST
This commit is contained in:
1 parent
09a9d8baba
commit
49900c1703
10 files changed
+22
-133
No files matched your search
@@ -10,7 +10,6 @@ require_relative "lib/maptool/gpx_store"
|
||||
require_relative "lib/maptool/library"
|
||||
require_relative "lib/maptool/google_saved"
|
||||
require_relative "lib/maptool/routing"
|
||||
require_relative "lib/maptool/gpsd_client"
|
||||
require_relative "lib/maptool/mqtt_client"
|
||||
require_relative "lib/maptool/live_store"
|
||||
require_relative "lib/maptool/livetrack_store"
|
||||
@@ -301,11 +300,12 @@ module Maptool
|
||||
redirect "/"
|
||||
end
|
||||
|
||||
# Live GNSS position, polled by the frontend from /api/gnss/position. A
|
||||
# single background thread reads gpsd (if it's running — harmless retry
|
||||
# loop if not, see GpsdClient) and keeps this updated; polling instead
|
||||
# of push (SSE/WebSocket) is deliberate — gpsd itself only reports at
|
||||
# ~1Hz, so there is nothing to gain from a push channel, and it avoids
|
||||
# Live GNSS position, polled by the frontend from /api/gnss/position.
|
||||
# No receiver feeds it for now: gpsd support was dropped, the car's
|
||||
# GNSS is to come over CAN (TODO.adoc) and will fill GNSS_LATEST the
|
||||
# same way. Polling instead of push (SSE/WebSocket) is deliberate — a
|
||||
# receiver reports at ~1Hz, so there is nothing to gain from a push
|
||||
# channel, and it avoids
|
||||
# Sinatra's `stream(:keep_open)` helper, which — absent an EventMachine
|
||||
# reactor (i.e. under plain threaded Puma, as here) — busy-loops calling
|
||||
# its block repeatedly instead of waiting for external writes; fine for
|
||||
@@ -320,15 +320,6 @@ module Maptool
|
||||
GNSS_LATEST = {}
|
||||
GNSS_LATEST_MUTEX = Mutex.new
|
||||
|
||||
Thread.new do
|
||||
GpsdClient.new.each_position do |position|
|
||||
GNSS_LATEST_MUTEX.synchronize do
|
||||
GNSS_LATEST.replace(position)
|
||||
GNSS_LATEST[:received_at] = Time.now.to_f
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Live data off the home MQTT broker (MQTT_URL), polled by the frontend
|
||||
# from /api/live like GNSS above — the "Tracker" and "ITS-G5" overlays:
|
||||
# the LTE GNSS tracker's position and USB power (+ its trail, optionally
|
||||
|
||||
Reference in new issue
Block a user