mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-05 09:05:43 +08:00
Merge branch 'master' into dev-priv/master
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user