GM: Correctly handle EPS warning vs error states (#21641)

old-commit-hash: f5d9216a01
commatwo_master
Jason Young 4 years ago committed by GitHub
parent 6da976034b
commit 5acd7306e7
  1. 2
      selfdrive/car/gm/carcontroller.py
  2. 3
      selfdrive/car/gm/carstate.py

@ -33,7 +33,7 @@ class CarController():
# STEER
if (frame % P.STEER_STEP) == 0:
lkas_enabled = enabled and not CS.out.steerWarning and CS.out.vEgo > P.MIN_STEER_SPEED
lkas_enabled = enabled and not (CS.out.steerWarning or CS.out.steerError) and CS.out.vEgo > P.MIN_STEER_SPEED
if lkas_enabled:
new_steer = int(round(actuators.steer * P.STEER_MAX))
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P)

@ -45,7 +45,8 @@ class CarState(CarStateBase):
# 0 inactive, 1 active, 2 temporarily limited, 3 failed
self.lkas_status = pt_cp.vl["PSCMStatus"]["LKATorqueDeliveredStatus"]
ret.steerWarning = self.lkas_status not in [0, 1]
ret.steerWarning = self.lkas_status == 2
ret.steerError = self.lkas_status == 3
# 1 - open, 0 - closed
ret.doorOpen = (pt_cp.vl["BCMDoorBeltStatus"]["FrontLeftDoor"] == 1 or

Loading…
Cancel
Save