structs: add lkasEnabled and lkasDisabled (#1317)
* add lkasEnabled and lkasDisabled * not sure
This commit is contained in:
parent
bed4c18a95
commit
3e239def4b
|
@ -19,7 +19,6 @@ class CarState(CarStateBase):
|
|||
self.acc_active_last = False
|
||||
self.low_speed_alert = False
|
||||
self.lkas_allowed_speed = False
|
||||
self.lkas_disabled = False
|
||||
|
||||
self.distance_button = 0
|
||||
|
||||
|
@ -107,7 +106,8 @@ class CarState(CarStateBase):
|
|||
self.crz_btns_counter = cp.vl["CRZ_BTNS"]["CTR"]
|
||||
|
||||
# camera signals
|
||||
self.lkas_disabled = cp_cam.vl["CAM_LANEINFO"]["LANE_LINES"] == 0
|
||||
# TODO: is this needed anymore?
|
||||
ret.lkasDisabled = cp_cam.vl["CAM_LANEINFO"]["LANE_LINES"] == 0
|
||||
self.cam_lkas = cp_cam.vl["CAM_LKAS"]
|
||||
self.cam_laneinfo = cp_cam.vl["CAM_LANEINFO"]
|
||||
ret.steerFaultPermanent = cp_cam.vl["CAM_LKAS"]["ERR_BIT_1"] == 1
|
||||
|
|
|
@ -109,10 +109,11 @@ class CarState(CarStateBase):
|
|||
can_gear = int(cp.vl["GEARBOX"]["GEAR_SHIFTER"])
|
||||
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None))
|
||||
|
||||
# TODO: is this needed anymore?
|
||||
if self.CP.carFingerprint == CAR.NISSAN_ALTIMA:
|
||||
self.lkas_enabled = bool(cp.vl["LKAS_SETTINGS"]["LKAS_ENABLED"])
|
||||
ret.lkasEnabled = bool(cp.vl["LKAS_SETTINGS"]["LKAS_ENABLED"])
|
||||
else:
|
||||
self.lkas_enabled = bool(cp_adas.vl["LKAS_SETTINGS"]["LKAS_ENABLED"])
|
||||
ret.lkasEnabled = bool(cp_adas.vl["LKAS_SETTINGS"]["LKAS_ENABLED"])
|
||||
|
||||
self.cruise_throttle_msg = copy.copy(cp.vl["CRUISE_THROTTLE"])
|
||||
|
||||
|
|
|
@ -75,6 +75,8 @@ class CarState:
|
|||
steeringPressed: bool = auto_field() # if the user is using the steering wheel
|
||||
steerFaultTemporary: bool = auto_field() # temporary EPS fault
|
||||
steerFaultPermanent: bool = auto_field() # permanent EPS fault
|
||||
lkasDisabled: bool = auto_field() # LKAS being enabled is required to control car
|
||||
lkasEnabled: bool = auto_field() # LKAS being disabled is required to control car
|
||||
stockAeb: bool = auto_field()
|
||||
stockFcw: bool = auto_field()
|
||||
espDisabled: bool = auto_field()
|
||||
|
|
Loading…
Reference in New Issue