From 84bf91ceda2f757d99e82628965443101df3b91c Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 2 Nov 2022 17:55:53 -0700 Subject: [PATCH] GM: fix fault while moving backwards (#26333) * log signed speed * bump to master * need this * fix * fix... * see if this works * just fault fix (no logging or standstill. tho revisit standstill) * move * Revert "move" This reverts commit c564e74666e3a418ef43a77926c8a38a2bf89511. old-commit-hash: e634afb719e9ea787155272b3d2fe64b385bcb7d --- opendbc | 2 +- selfdrive/car/gm/carstate.py | 2 ++ selfdrive/car/gm/interface.py | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/opendbc b/opendbc index b3dc569994..296f190000 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit b3dc569994fd10e4de04afd650980c51ddfce5e1 +Subproject commit 296f190000a2e71408e207ba21a2257cc853ec15 diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index 7cb2274674..af69307a2c 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -28,6 +28,7 @@ class CarState(CarStateBase): self.cruise_buttons = pt_cp.vl["ASCMSteeringButton"]["ACCButtons"] self.buttons_counter = pt_cp.vl["ASCMSteeringButton"]["RollingCounter"] self.pscm_status = copy.copy(pt_cp.vl["PSCMStatus"]) + self.moving_backward = pt_cp.vl["EBCMWheelSpdRear"]["MovingBackward"] != 0 # Variables used for avoiding LKAS faults self.loopback_lka_steering_cmd_updated = len(loopback_cp.vl_all["ASCMLKASteeringCmd"]["RollingCounter"]) > 0 @@ -139,6 +140,7 @@ class CarState(CarStateBase): ("FRWheelSpd", "EBCMWheelSpdFront"), ("RLWheelSpd", "EBCMWheelSpdRear"), ("RRWheelSpd", "EBCMWheelSpdRear"), + ("MovingBackward", "EBCMWheelSpdRear"), ("PRNDL2", "ECMPRDNL2"), ("ManualMode", "ECMPRDNL2"), ("LKADriverAppldTrq", "PSCMStatus"), diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 9ef7f388ff..2420098b4a 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -225,8 +225,9 @@ class CarInterface(CarInterfaceBase): # Enabling at a standstill with brake is allowed # TODO: verify 17 Volt can enable for the first time at a stop and allow for all GMs - if ret.vEgo < self.CP.minEnableSpeed and not (ret.standstill and ret.brake >= 20 and - self.CP.networkLocation == NetworkLocation.fwdCamera): + below_min_enable_speed = ret.vEgo < self.CP.minEnableSpeed or self.CS.moving_backward + if below_min_enable_speed and not (ret.standstill and ret.brake >= 20 and + self.CP.networkLocation == NetworkLocation.fwdCamera): events.add(EventName.belowEngageSpeed) if ret.cruiseState.standstill: events.add(EventName.resumeRequired)