GM: Correctly handle EPS warning vs error states (#21641)
old-commit-hash: f5d9216a01dfc5b8cde88ab07bf0cfae6cf7bffd
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user