process replay: support old routes with no peripheralState

old-commit-hash: 7361d1a11b
taco
Adeeb Shihadeh 2 years ago
parent 30414a7305
commit 4f7bfc430a
  1. 11
      selfdrive/controls/controlsd.py

@ -275,11 +275,12 @@ class Controls:
# self.events.add(EventName.highCpuUsage) # self.events.add(EventName.highCpuUsage)
# Alert if fan isn't spinning for 5 seconds # Alert if fan isn't spinning for 5 seconds
if self.sm['peripheralState'].fanSpeedRpm == 0 and self.sm['deviceState'].fanSpeedPercentDesired > 50: if self.sm['peripheralState'].pandaType != log.PandaState.PandaType.unknown:
if (self.sm.frame - self.last_functional_fan_frame) * DT_CTRL > 5.0: if self.sm['peripheralState'].fanSpeedRpm == 0 and self.sm['deviceState'].fanSpeedPercentDesired > 50:
self.events.add(EventName.fanMalfunction) if (self.sm.frame - self.last_functional_fan_frame) * DT_CTRL > 5.0:
else: self.events.add(EventName.fanMalfunction)
self.last_functional_fan_frame = self.sm.frame else:
self.last_functional_fan_frame = self.sm.frame
# Handle calibration status # Handle calibration status
cal_status = self.sm['liveCalibration'].calStatus cal_status = self.sm['liveCalibration'].calStatus

Loading…
Cancel
Save