diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py index 20374468ee..7b7c707108 100644 --- a/selfdrive/car/subaru/carcontroller.py +++ b/selfdrive/car/subaru/carcontroller.py @@ -40,7 +40,7 @@ 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, self.frame, self.p.STEER_STEP)) else: can_sends.append(subarucan.create_steering_control(self.packer, apply_steer)) diff --git a/selfdrive/car/subaru/interface.py b/selfdrive/car/subaru/interface.py index f756bf3b4d..267f52c543 100644 --- a/selfdrive/car/subaru/interface.py +++ b/selfdrive/car/subaru/interface.py @@ -16,7 +16,6 @@ class CarInterface(CarInterfaceBase): def _get_params(ret, candidate, fingerprint, car_fw, experimental_long): ret.carName = "subaru" ret.radarUnavailable = True - ret.dashcamOnly = candidate in PREGLOBAL_CARS ret.autoResumeSng = False if candidate in PREGLOBAL_CARS: diff --git a/selfdrive/car/subaru/subarucan.py b/selfdrive/car/subaru/subarucan.py index 7ea5ff79f0..b0b8daaa7b 100644 --- a/selfdrive/car/subaru/subarucan.py +++ b/selfdrive/car/subaru/subarucan.py @@ -87,8 +87,12 @@ def subaru_preglobal_checksum(packer, values, addr): dat = packer.make_can_msg(addr, 0, values)[2] return (sum(dat[:7])) % 256 -def create_preglobal_steering_control(packer, apply_steer): +def create_preglobal_steering_control(packer, apply_steer, frame, steer_step): + + idx = (frame / steer_step) % 8 + values = { + "COUNTER": idx, "LKAS_Command": apply_steer, "LKAS_Active": 1 if apply_steer != 0 else 0 }