From c192c92a4e838b9d5b8b80bc86fb35a0f236f2b2 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Mon, 15 May 2023 13:10:36 -0700 Subject: [PATCH] calibrationd: add offroad alert when remount detected (#28073) * calibrationd: add offroad alert for recalibration * Update common/params.cc --- common/params.cc | 1 + selfdrive/controls/controlsd.py | 1 + selfdrive/controls/lib/alerts_offroad.json | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/common/params.cc b/common/params.cc index c3a50fd109..bc1e414faa 100644 --- a/common/params.cc +++ b/common/params.cc @@ -202,6 +202,7 @@ std::unordered_map keys = { {"Offroad_TemperatureTooHigh", CLEAR_ON_MANAGER_START}, {"Offroad_UnofficialHardware", CLEAR_ON_MANAGER_START}, {"Offroad_UpdateFailed", CLEAR_ON_MANAGER_START}, + {"Offroad_Recalibration", CLEAR_ON_MANAGER_START | CLEAR_ON_ONROAD_TRANSITION}, }; } // namespace diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 96109d345c..f62ea06729 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -286,6 +286,7 @@ class Controls: if cal_status == log.LiveCalibrationData.Status.uncalibrated: self.events.add(EventName.calibrationIncomplete) elif cal_status == log.LiveCalibrationData.Status.recalibrating: + set_offroad_alert("Offroad_Recalibration", True) self.events.add(EventName.calibrationRecalibrating) else: self.events.add(EventName.calibrationInvalid) diff --git a/selfdrive/controls/lib/alerts_offroad.json b/selfdrive/controls/lib/alerts_offroad.json index 2f85ea917a..42d2512e51 100644 --- a/selfdrive/controls/lib/alerts_offroad.json +++ b/selfdrive/controls/lib/alerts_offroad.json @@ -48,5 +48,9 @@ "Offroad_NoFirmware": { "text": "openpilot was unable to identify your car. Check integrity of cables and ensure all connections are secure, particularly that the comma power is fully inserted in the OBD-II port of the vehicle. Need help? Join discord.comma.ai.", "severity": 0 + }, + "Offroad_Recalibration": { + "text": "openpilot detected a change in the device's mounting position. Ensure the device is fully seated in the mount and the mount is firmly secured to the windshield.", + "severity": 0 } }