From bce19bf187ed9c444bca834f64460f1648abe587 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 12 Jun 2023 23:03:04 -0700 Subject: [PATCH] Subaru: use latActive for steer request bit (#28453) * subaru: use latactive * Update ref_commit --- selfdrive/car/subaru/carcontroller.py | 6 +++--- selfdrive/car/subaru/subarucan.py | 8 ++++---- selfdrive/test/process_replay/ref_commit | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py index ae3305fbe4..c6ef0f11da 100644 --- a/selfdrive/car/subaru/carcontroller.py +++ b/selfdrive/car/subaru/carcontroller.py @@ -36,9 +36,9 @@ class CarController: apply_steer = 0 if self.CP.carFingerprint in PREGLOBAL_CARS: - can_sends.append(subarucan.create_preglobal_steering_control(self.packer, apply_steer)) + can_sends.append(subarucan.create_preglobal_steering_control(self.packer, apply_steer, CC.latActive)) else: - can_sends.append(subarucan.create_steering_control(self.packer, apply_steer)) + can_sends.append(subarucan.create_steering_control(self.packer, apply_steer, CC.latActive)) self.apply_steer_last = apply_steer @@ -76,7 +76,7 @@ class CarController: can_sends.append(subarucan.create_es_lkas_state(self.packer, CS.es_lkas_state_msg, CC.enabled, hud_control.visualAlert, hud_control.leftLaneVisible, hud_control.rightLaneVisible, hud_control.leftLaneDepart, hud_control.rightLaneDepart)) - + if self.CP.flags & SubaruFlags.SEND_INFOTAINMENT: can_sends.append(subarucan.create_infotainmentstatus(self.packer, CS.es_infotainmentstatus_msg, hud_control.visualAlert)) diff --git a/selfdrive/car/subaru/subarucan.py b/selfdrive/car/subaru/subarucan.py index bc9bf4c0a0..033ba7f76b 100644 --- a/selfdrive/car/subaru/subarucan.py +++ b/selfdrive/car/subaru/subarucan.py @@ -3,10 +3,10 @@ from cereal import car VisualAlert = car.CarControl.HUDControl.VisualAlert -def create_steering_control(packer, apply_steer): +def create_steering_control(packer, apply_steer, steer_req): values = { "LKAS_Output": apply_steer, - "LKAS_Request": 1 if apply_steer != 0 else 0, + "LKAS_Request": steer_req, "SET_1": 1 } return packer.make_can_msg("ES_LKAS", 0, values) @@ -174,10 +174,10 @@ def subaru_preglobal_checksum(packer, values, addr): return (sum(dat[:7])) % 256 -def create_preglobal_steering_control(packer, apply_steer): +def create_preglobal_steering_control(packer, apply_steer, steer_req): values = { "LKAS_Command": apply_steer, - "LKAS_Active": 1 if apply_steer != 0 else 0 + "LKAS_Active": steer_req, } values["Checksum"] = subaru_preglobal_checksum(packer, values, "ES_LKAS") diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index f3a9408671..a7d5b333d2 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -67bcd498f0432252a3f11a9fd2b59b344ee214ba +05b4467181f826f934a7ee4aada003fb241bbdff