diff --git a/openpilot/common/params_keys.h b/openpilot/common/params_keys.h index 96bef4daa7..f5e82b1d9d 100644 --- a/openpilot/common/params_keys.h +++ b/openpilot/common/params_keys.h @@ -93,6 +93,7 @@ inline static std::unordered_map keys = { {"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_ChestnutModelError", {CLEAR_ON_MANAGER_START, JSON}}, {"Offroad_ChestnutNotDetected", {CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION, JSON}}, {"Offroad_ChestnutOverheated", {CLEAR_ON_MANAGER_START, JSON}}, {"Offroad_ChestnutPcieUnavailable", {CLEAR_ON_MANAGER_START, JSON}}, diff --git a/openpilot/selfdrive/selfdrived/alerts_offroad.json b/openpilot/selfdrive/selfdrived/alerts_offroad.json index c5ee4650a3..66eec0b8a8 100644 --- a/openpilot/selfdrive/selfdrived/alerts_offroad.json +++ b/openpilot/selfdrive/selfdrived/alerts_offroad.json @@ -21,6 +21,10 @@ "text": "Chestnut detected! Switch to the release-chestnut branch to use chestnut-class models.", "severity": -1 }, + "Offroad_ChestnutModelError": { + "text": "Chestnut model error. Restart the car to retry.", + "severity": 0 + }, "Offroad_ChestnutNotDetected": { "text": "Chestnut not detected. Check USB and 12V connections.", "severity": 0 diff --git a/openpilot/system/hardware/chestnut/status.py b/openpilot/system/hardware/chestnut/status.py index 8c38987dff..b088c56b22 100644 --- a/openpilot/system/hardware/chestnut/status.py +++ b/openpilot/system/hardware/chestnut/status.py @@ -23,6 +23,7 @@ class ChestnutStatus: self.link_failures = 0 self.model_loading_seen = False self.model_attempted = False + self.model_failed = False self.overheated = False self.usb_seen = False self.usb_failed = False @@ -42,11 +43,13 @@ class ChestnutStatus: self.link_failures = 0 self.model_loading_seen = False self.model_attempted = False + self.model_failed = False self.usb_seen = firmware_ok self.usb_failed = False self.model_loading_seen |= model_loading self.model_attempted |= self.model_loading_seen and not model_loading and model_active is not None + self.model_failed |= not offroad and self.model_attempted and model_active is False if not offroad and self.usb_seen and not firmware_ok: self.usb_failed = True @@ -91,6 +94,7 @@ class ChestnutStatus: else: pcie_alert = "Chestnut GPU unavailable. PCIe link is not up. Check the GPU is securely seated." set_alert("Offroad_ChestnutPcieUnavailable", self.pcie_failed, pcie_alert) + set_alert("Offroad_ChestnutModelError", self.model_failed and not (missing or self.pcie_failed)) set_alert("Offroad_ChestnutUncompiled", offroad and firmware_ok and not chestnut_compiled()) set_alert("Offroad_ChestnutUpdateFailed", offroad and firmware_failed) self.offroad = offroad