break canError into two separate events
parent
6230f366c5
commit
916448af25
2
cereal
2
cereal
|
@ -1 +1 @@
|
||||||
Subproject commit c8be73d10c957bff769998588595107d62e9e738
|
Subproject commit 0adfc7e77efbf1ebc21bf2629a85d165b319b23e
|
|
@ -117,6 +117,7 @@ class Controls:
|
||||||
self.v_cruise_kph_last = 0
|
self.v_cruise_kph_last = 0
|
||||||
self.mismatch_counter = 0
|
self.mismatch_counter = 0
|
||||||
self.can_error_counter = 0
|
self.can_error_counter = 0
|
||||||
|
self.consecutive_can_error_count = 0
|
||||||
self.last_blinker_frame = 0
|
self.last_blinker_frame = 0
|
||||||
self.saturated_count = 0
|
self.saturated_count = 0
|
||||||
self.events_prev = []
|
self.events_prev = []
|
||||||
|
@ -188,8 +189,13 @@ class Controls:
|
||||||
LaneChangeState.laneChangeFinishing]:
|
LaneChangeState.laneChangeFinishing]:
|
||||||
self.events.add(EventName.laneChange)
|
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.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:
|
if self.mismatch_counter >= 200:
|
||||||
self.events.add(EventName.controlsMismatch)
|
self.events.add(EventName.controlsMismatch)
|
||||||
if not self.sm.alive['plan'] and self.sm.alive['pathPlan']:
|
if not self.sm.alive['plan'] and self.sm.alive['pathPlan']:
|
||||||
|
@ -210,8 +216,6 @@ class Controls:
|
||||||
self.events.add(EventName.radarFault)
|
self.events.add(EventName.radarFault)
|
||||||
if self.sm['plan'].radarCanError:
|
if self.sm['plan'].radarCanError:
|
||||||
self.events.add(EventName.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:
|
if log.HealthData.FaultType.relayMalfunction in self.sm['health'].faults:
|
||||||
self.events.add(EventName.relayMalfunction)
|
self.events.add(EventName.relayMalfunction)
|
||||||
if self.sm['plan'].fcw:
|
if self.sm['plan'].fcw:
|
||||||
|
|
|
@ -305,6 +305,14 @@ EVENTS = {
|
||||||
Priority.LOW, VisualAlert.steerRequired, AudibleAlert.chimePrompt, 1., 2., 3.),
|
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 **********
|
# ********** events only containing alerts that display while engaged **********
|
||||||
|
|
||||||
EventName.vehicleModelInvalid: {
|
EventName.vehicleModelInvalid: {
|
||||||
|
@ -603,11 +611,6 @@ EVENTS = {
|
||||||
EventName.canError: {
|
EventName.canError: {
|
||||||
ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN Error: Check Connections"),
|
ET.IMMEDIATE_DISABLE: ImmediateDisableAlert("CAN Error: Check Connections"),
|
||||||
ET.NO_ENTRY: NoEntryAlert("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: {
|
EventName.steerUnavailable: {
|
||||||
|
|
Loading…
Reference in New Issue