From 0189b3fbe671b37e2bcb080f2c623a792dd76a5b Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 26 May 2023 13:07:35 -0700 Subject: [PATCH] controls: write recalibrating offroad alert once (#28312) * only write once * rm read --------- Co-authored-by: Adeeb Shihadeh old-commit-hash: 715f44ff455e1d5cf03ed6e0b0a2dae526229f84 --- selfdrive/controls/controlsd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index a1620194bd..a584a44cb9 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -178,6 +178,7 @@ class Controls: self.desired_curvature_rate = 0.0 self.experimental_mode = False self.v_cruise_helper = VCruiseHelper(self.CP) + self.recalibrating_seen = False # TODO: no longer necessary, aside from process replay self.sm['liveParameters'].valid = True @@ -286,7 +287,9 @@ 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) + if not self.recalibrating_seen: + set_offroad_alert("Offroad_Recalibration", True) + self.recalibrating_seen = True self.events.add(EventName.calibrationRecalibrating) else: self.events.add(EventName.calibrationInvalid)