mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 23:33:58 +08:00
controls: write recalibrating offroad alert once (#28312)
* only write once * rm read --------- Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user