mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 20:03:53 +08:00
2
cereal
2
cereal
Submodule cereal updated: c8be73d10c...0adfc7e77e
@@ -117,6 +117,7 @@ class Controls:
|
||||
self.v_cruise_kph_last = 0
|
||||
self.mismatch_counter = 0
|
||||
self.can_error_counter = 0
|
||||
self.consecutive_can_error_count = 0
|
||||
self.last_blinker_frame = 0
|
||||
self.saturated_count = 0
|
||||
self.events_prev = []
|
||||
@@ -188,8 +189,13 @@ class Controls:
|
||||
LaneChangeState.laneChangeFinishing]:
|
||||
self.events.add(EventName.laneChange)
|
||||
|
||||
if self.can_rcv_error:
|
||||
if self.can_rcv_error or (not CS.canValid and self.sm.frame > 5 / DT_CTRL):
|
||||
self.events.add(EventName.canError)
|
||||
self.consecutive_can_error_count += 1
|
||||
else:
|
||||
self.consecutive_can_error_count = 0
|
||||
if self.consecutive_can_error_count > 2 / DT_CTRL:
|
||||
self.events.add(EventName.canErrorPersistent)
|
||||
if self.mismatch_counter >= 200:
|
||||
self.events.add(EventName.controlsMismatch)
|
||||
if not self.sm.alive['plan'] and self.sm.alive['pathPlan']:
|
||||
@@ -210,8 +216,6 @@ class Controls:
|
||||
self.events.add(EventName.radarFault)
|
||||
if self.sm['plan'].radarCanError:
|
||||
self.events.add(EventName.radarCanError)
|
||||
if not CS.canValid and self.sm.frame > 5 / DT_CTRL:
|
||||
self.events.add(EventName.canError)
|
||||
if log.HealthData.FaultType.relayMalfunction in self.sm['health'].faults:
|
||||
self.events.add(EventName.relayMalfunction)
|
||||
if self.sm['plan'].fcw:
|
||||
|
||||
@@ -305,6 +305,14 @@ EVENTS = {
|
||||
Priority.LOW, VisualAlert.steerRequired, AudibleAlert.chimePrompt, 1., 2., 3.),
|
||||
},
|
||||
|
||||
EventName.canErrorPersistent: {
|
||||
ET.PERMANENT: Alert(
|
||||
"CAN Error: Check Connections",
|
||||
"",
|
||||
AlertStatus.normal, AlertSize.small,
|
||||
Priority.LOW, VisualAlert.none, AudibleAlert.none, 0., 0., .2),
|
||||
},
|
||||
|
||||
# ********** events only containing alerts that display while engaged **********
|
||||
|
||||
EventName.vehicleModelInvalid: {
|
||||
@@ -603,11 +611,6 @@ EVENTS = {
|
||||
EventName.canError: {
|
||||
ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN Error: Check Connections"),
|
||||
ET.NO_ENTRY: NoEntryAlert("CAN Error: Check Connections"),
|
||||
ET.PERMANENT: Alert(
|
||||
"CAN Error: Check Connections",
|
||||
"",
|
||||
AlertStatus.normal, AlertSize.small,
|
||||
Priority.LOW, VisualAlert.none, AudibleAlert.none, 0., 0., .2),
|
||||
},
|
||||
|
||||
EventName.steerUnavailable: {
|
||||
|
||||
Reference in New Issue
Block a user