Block entry on non-adaptive cruise mode (#1708)
* block entry on non-adaptive cruise mode * user disable * toyotaalbatross
parent
ed7e568b70
commit
25688f36cc
|
@ -107,6 +107,8 @@ class CarInterfaceBase():
|
|||
events.add(EventName.stockAeb)
|
||||
if cs_out.vEgo > MAX_CTRL_SPEED:
|
||||
events.add(EventName.speedTooHigh)
|
||||
if cs_out.cruiseState.nonAdaptive:
|
||||
events.add(EventName.wrongCruiseMode)
|
||||
|
||||
if cs_out.steerError:
|
||||
events.add(EventName.steerUnavailable)
|
||||
|
|
|
@ -90,6 +90,8 @@ class CarState(CarStateBase):
|
|||
else:
|
||||
ret.cruiseState.standstill = self.pcm_acc_status == 7
|
||||
ret.cruiseState.enabled = bool(cp.vl["PCM_CRUISE"]['CRUISE_ACTIVE'])
|
||||
# TODO: CRUISE_STATE is a 4 bit signal, find any other non-adaptive cruise states
|
||||
ret.cruiseState.nonAdaptive = cp.vl["PCM_CRUISE"]['CRUISE_STATE'] in [5]
|
||||
|
||||
if self.CP.carFingerprint == CAR.PRIUS:
|
||||
ret.genericToggle = cp.vl["AUTOPARK_STATUS"]['STATE'] != 0
|
||||
|
|
|
@ -189,7 +189,6 @@ EVENTS = {
|
|||
|
||||
EventName.gasPressed: {ET.PRE_ENABLE: None},
|
||||
|
||||
EventName.wrongCruiseMode: {},
|
||||
EventName.laneChangeBlocked: {},
|
||||
|
||||
EventName.focusRecoverActive: {},
|
||||
|
@ -485,6 +484,11 @@ EVENTS = {
|
|||
duration_hud_alert=0.),
|
||||
},
|
||||
|
||||
EventName.wrongCruiseMode: {
|
||||
ET.USER_DISABLE: EngagementAlert(AudibleAlert.chimeDisengage),
|
||||
ET.NO_ENTRY: NoEntryAlert("Enable Adaptive Cruise"),
|
||||
},
|
||||
|
||||
EventName.steerTempUnavailable: {
|
||||
ET.WARNING: Alert(
|
||||
"TAKE CONTROL",
|
||||
|
|
Loading…
Reference in New Issue