From 9cbd34158f6fa264b86493c1c5bdb2a1bbc0dd4f Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 1 Oct 2024 21:17:24 -0700 Subject: [PATCH] GM: signed wheel speeds (#33697) * signed wheel speeds * clean up * bump to master * bump to master again * did a sanity check for negative vego * bump --- opendbc_repo | 2 +- selfdrive/car/car_specific.py | 5 ++--- selfdrive/controls/controlsd.py | 2 +- selfdrive/selfdrived/selfdrived.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/opendbc_repo b/opendbc_repo index 01f47ff1a3..ea87b4fa3b 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 01f47ff1a324ade77d99f79c7ea0f4e87110147d +Subproject commit ea87b4fa3ba98a71c2c8e93c97788fb0fa960d55 diff --git a/selfdrive/car/car_specific.py b/selfdrive/car/car_specific.py index 9602400250..1053588001 100644 --- a/selfdrive/car/car_specific.py +++ b/selfdrive/car/car_specific.py @@ -119,9 +119,8 @@ class CarSpecificEvents: # 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 - below_min_enable_speed = CS.out.vEgo < self.CP.minEnableSpeed or CS.moving_backward # type: ignore[attr-defined] - if below_min_enable_speed and not (CS.out.standstill and CS.out.brake >= 20 and - self.CP.networkLocation == NetworkLocation.fwdCamera): + if CS.out.vEgo < self.CP.minEnableSpeed and not (CS.out.standstill and CS.out.brake >= 20 and + self.CP.networkLocation == NetworkLocation.fwdCamera): events.add(EventName.belowEngageSpeed) if CS.out.cruiseState.standstill: events.add(EventName.resumeRequired) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 80331c6ee7..c97a06a0cf 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -87,7 +87,7 @@ class Controls: CC.enabled = self.sm['selfdriveState'].enabled # Check which actuators can be enabled - standstill = CS.vEgo <= max(self.CP.minSteerSpeed, MIN_LATERAL_CONTROL_SPEED) or CS.standstill + standstill = abs(CS.vEgo) <= max(self.CP.minSteerSpeed, MIN_LATERAL_CONTROL_SPEED) or CS.standstill CC.latActive = self.sm['selfdriveState'].active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and not standstill CC.longActive = CC.enabled and not any(e.overrideLongitudinal for e in self.sm['onroadEvents']) and self.CP.openpilotLongitudinalControl diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index 9e6ac90219..63e078e6d7 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -334,7 +334,7 @@ class SelfdriveD: self.events.add(EventName.noGps) if gps_ok: self.distance_traveled = 0 - self.distance_traveled += CS.vEgo * DT_CTRL + self.distance_traveled += abs(CS.vEgo) * DT_CTRL if self.sm['modelV2'].frameDropPerc > 20: self.events.add(EventName.modeldLagging)