From 165bcf1f31ffc34b56c84cf8e71f41ce224dd7e3 Mon Sep 17 00:00:00 2001 From: Adeeb <8762862+adeebshihadeh@users.noreply.github.com> Date: Tue, 2 Jun 2020 17:31:59 -0700 Subject: [PATCH] Fix speed too low (#1627) * fix speed too low * bump ref Co-authored-by: Willem Melching --- cereal | 2 +- selfdrive/car/gm/interface.py | 2 +- selfdrive/car/honda/interface.py | 4 ++-- selfdrive/car/mazda/interface.py | 2 +- selfdrive/car/toyota/interface.py | 2 +- selfdrive/controls/lib/events.py | 5 ++++- selfdrive/test/process_replay/ref_commit | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cereal b/cereal index 978ffda405..cc14179697 160000 --- a/cereal +++ b/cereal @@ -1 +1 @@ -Subproject commit 978ffda4057542514b233a4b540690a964651dca +Subproject commit cc14179697fac4757daeaa7968ac29d490204693 diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 6dda4f3a0a..f63f8d7741 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -149,7 +149,7 @@ class CarInterface(CarInterfaceBase): events = self.create_common_events(ret, pcm_enable=False) if ret.vEgo < self.CP.minEnableSpeed: - events.add(EventName.speedTooLow) + events.add(EventName.belowEngageSpeed) if self.CS.park_brake: events.add(EventName.parkBrake) if ret.cruiseState.standstill: diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index aa315afd52..7e5c46c895 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -482,12 +482,12 @@ class CarInterface(CarInterfaceBase): events.add(EventName.parkBrake) if self.CP.enableCruise and ret.vEgo < self.CP.minEnableSpeed: - events.add(EventName.speedTooLow) + events.add(EventName.belowEngageSpeed) # it can happen that car cruise disables while comma system is enabled: need to # keep braking if needed or if the speed is very low if self.CP.enableCruise and not ret.cruiseState.enabled \ - and (c.actuators.brake <= 0. or not self.CP.openpilotLongitudinalControl) and (self.CP.minEnableSpeed > 0): + and (c.actuators.brake <= 0. or not self.CP.openpilotLongitudinalControl): # non loud alert if cruise disables below 25mph as expected (+ a little margin) if ret.vEgo < self.CP.minEnableSpeed + 2.: events.add(EventName.speedTooLow) diff --git a/selfdrive/car/mazda/interface.py b/selfdrive/car/mazda/interface.py index 037b84e107..20ddf5ae94 100755 --- a/selfdrive/car/mazda/interface.py +++ b/selfdrive/car/mazda/interface.py @@ -77,7 +77,7 @@ class CarInterface(CarInterfaceBase): events = self.create_common_events(ret) if self.CS.low_speed_lockout: - events.add(EventName.speedTooLow) + events.add(EventName.belowEngageSpeed) if self.CS.low_speed_alert: events.add(EventName.belowSteerSpeed) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 9b9b46cf39..7720e627f7 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -323,7 +323,7 @@ class CarInterface(CarInterfaceBase): 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.speedTooLow) + events.add(EventName.belowEngageSpeed) if c.actuators.gas > 0.1: # some margin on the actuator to not false trigger cancellation while stopping events.add(EventName.speedTooLow) diff --git a/selfdrive/controls/lib/events.py b/selfdrive/controls/lib/events.py index 413a402407..ff97a6bbd5 100644 --- a/selfdrive/controls/lib/events.py +++ b/selfdrive/controls/lib/events.py @@ -506,6 +506,10 @@ EVENTS = { duration_hud_alert=0.), }, + EventName.belowEngageSpeed: { + ET.NO_ENTRY: NoEntryAlert("Speed Too Low"), + }, + EventName.sensorDataInvalid: { ET.PERMANENT: Alert( "No Data from Device Sensors", @@ -680,7 +684,6 @@ EVENTS = { "Speed too low", AlertStatus.normal, AlertSize.mid, Priority.HIGH, VisualAlert.none, AudibleAlert.chimeDisengage, .4, 2., 3.), - ET.NO_ENTRY: NoEntryAlert("Speed Too Low"), }, EventName.speedTooHigh: { diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index bdcc7b799f..47366239cf 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -5bad0192bf35d8f08f26dd5ac72b3c1d62a57569 \ No newline at end of file +5abe4f99eec3633bc30fda47c272e0f19a840a29 \ No newline at end of file