From bcdbd8edb9e82d447093b06edc4d2abc8c0367bd Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 25 Nov 2022 17:00:58 -0700 Subject: [PATCH] Toyota: alert when in standstill (#26585) * add resume required alert * possibly need this (pressing resume with brake held does nothing) * better text (has both meanings) * try this * Revert "try this" This reverts commit 5b2991929b62f5bcd9bfa0767d709b5fe83b094b. * no alert with interceptor * check long old-commit-hash: 3253b8590002fa5f56e003add3f5f47a21870873 --- selfdrive/car/toyota/interface.py | 23 +++++++++++++---------- selfdrive/controls/lib/events.py | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 3f4edb36d..0139c692c 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -247,16 +247,19 @@ class CarInterface(CarInterfaceBase): # events events = self.create_common_events(ret) - if self.CS.low_speed_lockout and self.CP.openpilotLongitudinalControl: - events.add(EventName.lowSpeedLockout) - if ret.vEgo < self.CP.minEnableSpeed and self.CP.openpilotLongitudinalControl: - events.add(EventName.belowEngageSpeed) - if c.actuators.accel > 0.3: - # some margin on the actuator to not false trigger cancellation while stopping - events.add(EventName.speedTooLow) - if ret.vEgo < 0.001: - # while in standstill, send a user alert - events.add(EventName.manualRestart) + if self.CP.openpilotLongitudinalControl: + if ret.cruiseState.standstill and not ret.brakePressed and not self.CP.enableGasInterceptor: + events.add(EventName.resumeRequired) + if self.CS.low_speed_lockout: + events.add(EventName.lowSpeedLockout) + if ret.vEgo < self.CP.minEnableSpeed: + events.add(EventName.belowEngageSpeed) + if c.actuators.accel > 0.3: + # some margin on the actuator to not false trigger cancellation while stopping + events.add(EventName.speedTooLow) + if ret.vEgo < 0.001: + # while in standstill, send a user alert + events.add(EventName.manualRestart) ret.events = events.to_msg() diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 1ed2ffa86..ad10b8f0b 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -501,7 +501,7 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = { EventName.resumeRequired: { ET.WARNING: Alert( "STOPPED", - "Press Resume to Go", + "Press Resume to Exit Standstill", AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, VisualAlert.none, AudibleAlert.none, .2), },