From 7bfe6ba4d0c70744321b698657c745f6f677c687 Mon Sep 17 00:00:00 2001 From: Trey Moen <50057480+greatgitsby@users.noreply.github.com> Date: Tue, 8 Sep 2026 15:21:03 -0700 Subject: [PATCH] pandad: allow disabling driver camera IR offroad (#38812) --- openpilot/common/params_keys.h | 1 + openpilot/selfdrive/pandad/pandad.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openpilot/common/params_keys.h b/openpilot/common/params_keys.h index ba6eae3dd5..4b87356aca 100644 --- a/openpilot/common/params_keys.h +++ b/openpilot/common/params_keys.h @@ -28,6 +28,7 @@ inline static std::unordered_map keys = { {"ControlsReady", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"CurrentBootlog", {PERSISTENT, STRING}}, {"CurrentRoute", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, STRING}}, + {"DisableDriverCameraIR", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"DisableLogging", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"DisablePowerDown", {PERSISTENT, BOOL}}, {"DisableUpdates", {PERSISTENT, BOOL}}, diff --git a/openpilot/selfdrive/pandad/pandad.cc b/openpilot/selfdrive/pandad/pandad.cc index d0b65586aa..8b54ca6eaf 100644 --- a/openpilot/selfdrive/pandad/pandad.cc +++ b/openpilot/selfdrive/pandad/pandad.cc @@ -328,8 +328,8 @@ void process_peripheral_state(Panda *panda, PubMaster *pm, bool no_fan_control, } } - // Disable IR on input timeout - if (nanos_since_boot() - last_cabin_camera_t > 1e9) { + // Disable IR on input timeout or when requested offroad. + if (nanos_since_boot() - last_cabin_camera_t > 1e9 || (!is_onroad && params.getBool("DisableDriverCameraIR"))) { ir_pwr = 0; }