disable tlog calls, add param gate to tlog client

- Comment out all tlog() calls in controlsd (100Hz) and carstate (100Hz)
  — was causing controlsd to lag from JSON serialization + ZMQ overhead
- tlog() now checks TelemetryEnabled memory param (1/sec file read),
  returns immediately when disabled — zero cost when telemetry is off

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-14 02:28:19 -05:00
parent 73472e5fab
commit 4756d8e32c
3 changed files with 35 additions and 63 deletions

View File

@@ -639,15 +639,13 @@ class Controls:
self.enabled = self.state in ENABLED_STATES
self.active = self.state in ACTIVE_STATES
# CLEARPILOT: log engagement state for debugging cruise desync issues
tlog("engage", {
"state": self.state.name if hasattr(self.state, 'name') else str(self.state),
"enabled": self.enabled,
"active": self.active,
"cruise_enabled": CS.cruiseState.enabled,
"cruise_available": CS.cruiseState.available,
"brakePressed": CS.brakePressed,
})
# CLEARPILOT: engagement telemetry disabled — was running at 100Hz, causing CPU load
# tlog("engage", {
# "state": self.state.name if hasattr(self.state, 'name') else str(self.state),
# "enabled": self.enabled, "active": self.active,
# "cruise_enabled": CS.cruiseState.enabled, "cruise_available": CS.cruiseState.available,
# "brakePressed": CS.brakePressed,
# })
if self.active:
self.current_alert_types.append(ET.WARNING)