From 28560d6cf1b44f2f01c1dc0e6855a1fb64fd1e11 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 15 Aug 2026 13:18:02 -0700 Subject: [PATCH] show an offroad alert to switch to a chestnut branch (#38636) * show an offroad alert to switch to a chestnut branch * add to keys --- openpilot/common/params_keys.h | 1 + openpilot/selfdrive/selfdrived/alerts_offroad.json | 4 ++++ openpilot/system/hardware/hardwared.py | 2 ++ 3 files changed, 7 insertions(+) diff --git a/openpilot/common/params_keys.h b/openpilot/common/params_keys.h index 7a914128fa..e44d8f8e34 100644 --- a/openpilot/common/params_keys.h +++ b/openpilot/common/params_keys.h @@ -91,6 +91,7 @@ inline static std::unordered_map keys = { {"ObdMultiplexingChanged", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"ObdMultiplexingEnabled", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, BOOL}}, {"Offroad_CarUnrecognized", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, JSON}}, + {"Offroad_ChestnutBranch", {CLEAR_ON_MANAGER_START, JSON}}, {"Offroad_ConnectivityNeeded", {CLEAR_ON_MANAGER_START, JSON}}, {"Offroad_ConnectivityNeededPrompt", {CLEAR_ON_MANAGER_START, JSON}}, {"Offroad_ExcessiveActuation", {PERSISTENT, JSON}}, diff --git a/openpilot/selfdrive/selfdrived/alerts_offroad.json b/openpilot/selfdrive/selfdrived/alerts_offroad.json index 07bab0c377..b0179c0ac3 100644 --- a/openpilot/selfdrive/selfdrived/alerts_offroad.json +++ b/openpilot/selfdrive/selfdrived/alerts_offroad.json @@ -17,6 +17,10 @@ "severity": 1, "_comment": "Set extra field to the failed reason." }, + "Offroad_ChestnutBranch": { + "text": "Chestnut detected! Switch to the release-chestnut branch to use chestnut-class models.", + "severity": 0 + }, "Offroad_UnregisteredHardware": { "text": "Failed to register with comma.ai backend. It will not connect or upload to comma.ai servers, and receives no support from comma.ai. If this is a device purchased at comma.ai/shop, open a ticket at https://comma.ai/support.", "severity": 1 diff --git a/openpilot/system/hardware/hardwared.py b/openpilot/system/hardware/hardwared.py index 270a75ade6..d7fac517fb 100755 --- a/openpilot/system/hardware/hardwared.py +++ b/openpilot/system/hardware/hardwared.py @@ -237,6 +237,7 @@ def hardware_thread(end_event, hw_queue) -> None: fan_controller = FanController(int(1./DT_HW)) chestnut = Chestnut() + big_model_available = os.path.isfile(os.path.join(BASEDIR, "openpilot/selfdrive/modeld/models/big_driving_supercombo.onnx")) while not end_event.is_set(): sm.update(PANDA_STATES_TIMEOUT) @@ -298,6 +299,7 @@ def hardware_thread(end_event, hw_queue) -> None: set_usb_state(msg.deviceState, last_hw_state.usb_state) chestnut.update(started_ts is None, last_hw_state.usb_state) + set_offroad_alert_if_changed("Offroad_ChestnutBranch", msg.deviceState.chestnutPresent and not big_model_available) # this subset is only used for offroad temp_sources = [