telemetry overlay, memory params fix, nightrider border, GPS logging
- Telemetry status bar in onroad UI: temp, fan %, model FPS, standstill
- Fix paramsMemory usage: Params("/dev/shm/params") not "/dev/shm/params/d"
- Telemetry/VPN toggles use ToggleControl with manual paramsMemory writes
- TelemetryEnabled/VpnEnabled registered PERSISTENT, written to memory path
- GPS telemetry: telemetryd subscribes to gpsLocation at 1Hz via cereal
- Nightrider: force CameraWidget bg black to eliminate color bleed border
- Suppress "Always On Lateral active" status bar message
- Re-enable gpsd and dashcamd
- CLAUDE.md: document memory params pattern, speed_limit.calculated usage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
@@ -17,6 +17,7 @@ import shutil
|
||||
import time
|
||||
import zmq
|
||||
|
||||
import cereal.messaging as messaging
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.selfdrive.clearpilot.telemetry import TELEMETRY_SOCK
|
||||
from openpilot.selfdrive.manager.process import _log_dir, session_log
|
||||
@@ -26,12 +27,16 @@ DISK_CHECK_INTERVAL = 10 # seconds
|
||||
|
||||
|
||||
def main():
|
||||
params = Params()
|
||||
params = Params("/dev/shm/params")
|
||||
ctx = zmq.Context.instance()
|
||||
sock = ctx.socket(zmq.PULL)
|
||||
sock.setsockopt(zmq.RCVHWM, 1000)
|
||||
sock.bind(TELEMETRY_SOCK)
|
||||
|
||||
# GPS subscriber for location telemetry
|
||||
sm = messaging.SubMaster(['gpsLocation'])
|
||||
last_gps_log = 0
|
||||
|
||||
csv_path = os.path.join(_log_dir, "telemetry.csv")
|
||||
state: dict[str, dict] = {} # group -> {key: last_value}
|
||||
was_enabled = False
|
||||
@@ -71,6 +76,34 @@ def main():
|
||||
|
||||
was_enabled = enabled
|
||||
|
||||
# GPS telemetry at most 1Hz — fed through the same diff logic
|
||||
if enabled and writer is not None:
|
||||
sm.update(0)
|
||||
now = time.monotonic()
|
||||
if sm.updated['gpsLocation'] and (now - last_gps_log) >= 1.0:
|
||||
gps = sm['gpsLocation']
|
||||
gps_data = {
|
||||
"latitude": f"{gps.latitude:.7f}",
|
||||
"longitude": f"{gps.longitude:.7f}",
|
||||
"speed": f"{gps.speed:.2f}",
|
||||
"altitude": f"{gps.altitude:.1f}",
|
||||
"bearing": f"{gps.bearingDeg:.1f}",
|
||||
"accuracy": f"{gps.accuracy:.1f}",
|
||||
}
|
||||
ts = time.time()
|
||||
if "gps" not in state:
|
||||
state["gps"] = {}
|
||||
prev_gps = state["gps"]
|
||||
gps_changed = False
|
||||
for key, value in gps_data.items():
|
||||
if key not in prev_gps or prev_gps[key] != value:
|
||||
writer.writerow([f"{ts:.6f}", "gps", key, value])
|
||||
prev_gps[key] = value
|
||||
gps_changed = True
|
||||
if gps_changed:
|
||||
f.flush()
|
||||
last_gps_log = now
|
||||
|
||||
# Always drain the socket (even when disabled) to avoid backpressure
|
||||
try:
|
||||
raw = sock.recv_string(zmq.NOBLOCK)
|
||||
|
||||
Reference in New Issue
Block a user