bench mode: live camera via thermald, blinking telemetry indicator

- Unblocked thermald and camerad — thermald manages CPU cores and reads
  fake pandaStates for ignition, bench no longer publishes deviceState
- camerad starts with live camera feed on bench
- Force nvg->update() every frame for HUD repaint without camera dependency
- Blue blinking telemetry circle uses getBool pattern
- camerad debug logging for startup diagnostics

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 03:10:06 +00:00
parent 3edc1972c8
commit b70543a003
4 changed files with 22 additions and 22 deletions

View File

@@ -36,8 +36,9 @@ def main():
params_mem.put("BenchGear", "P")
params_mem.put("BenchEngaged", "0")
# thermald handles deviceState (reads our fake pandaStates for ignition)
pm = messaging.PubMaster([
"deviceState", "pandaStates", "carState", "controlsState",
"pandaStates", "carState", "controlsState",
"driverMonitoringState", "liveCalibration",
])
@@ -65,19 +66,7 @@ def main():
speed_ms = speed_mph * MS_PER_MPH
gear = gear_map.get(gear_str, car.CarState.GearShifter.park)
# deviceState — 2 Hz
if frame % 5 == 0:
dat = messaging.new_message("deviceState")
dat.deviceState.started = True
dat.deviceState.freeSpacePercent = 80
dat.deviceState.memoryUsagePercent = 30
dat.deviceState.cpuTempC = [40.0] * 3
dat.deviceState.gpuTempC = [40.0] * 3
dat.deviceState.cpuUsagePercent = [20] * 8
dat.deviceState.networkType = log.DeviceState.NetworkType.cell4G
pm.send("deviceState", dat)
# pandaStates — 10 Hz
# pandaStates10 Hz (thermald reads ignition from this)
if frame % 1 == 0:
dat = messaging.new_message("pandaStates", 1)
dat.pandaStates[0].ignitionLine = True

View File

@@ -402,10 +402,10 @@ def manager_thread(frogpilot_functions) -> None:
ignore.append("pandad")
# CLEARPILOT: bench mode — disable real car processes, enable bench simulator
if os.getenv("BENCH_MODE") is not None:
ignore += ["pandad", "thermald", "controlsd", "radard", "plannerd",
ignore += ["pandad", "controlsd", "radard", "plannerd",
"calibrationd", "torqued", "paramsd", "locationd", "sensord",
"ubloxd", "pigeond", "dmonitoringmodeld", "dmonitoringd",
"modeld", "soundd", "camerad", "loggerd", "micd",
"modeld", "soundd", "loggerd", "micd",
"dashcamd"]
session_log.info("bench mode enabled")
ignore += [x for x in os.getenv("BLOCK", "").split(",") if len(x) > 0]

View File

@@ -76,6 +76,7 @@ void OnroadWindow::updateState(const UIState &s) {
alerts->updateAlert(alert);
nvg->updateState(s);
nvg->update(); // CLEARPILOT: force repaint every frame for HUD elements
QColor bgColor = bg_colors[s.status];
if (paramsMemory.getBool("no_lat_lane_change") == 1) {
@@ -403,13 +404,13 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
Hardware::set_display_power(true);
}
// CLEARPILOT: blinking red circle when telemetry is recording
if (Params().get("TelemetryEnabled") == "1") {
// CLEARPILOT: blinking blue circle when telemetry is recording
if (Params().getBool("TelemetryEnabled")) {
// Blink: visible for 500ms, hidden for 500ms
int phase = (QDateTime::currentMSecsSinceEpoch() / 500) % 2;
if (phase == 0) {
p.setPen(Qt::NoPen);
p.setBrush(QColor(220, 30, 30));
p.setBrush(QColor(30, 100, 220));
p.drawEllipse(width() - 150, 50, 100, 100);
}
}