Ford: fix counter in LateralMotionControl2 message (#31806)

The counter should be between 0-15 inclusive. This only affects CAN FD cars.
old-commit-hash: 682f16d1b5
chrysler-long2
Cameron Clough 1 year ago committed by GitHub
parent af33a383a5
commit b9980e5bcc
  1. 2
      selfdrive/car/ford/carcontroller.py

@ -73,7 +73,7 @@ class CarController(CarControllerBase):
if self.CP.flags & FordFlags.CANFD:
# TODO: extended mode
mode = 1 if CC.latActive else 0
counter = (self.frame // CarControllerParams.STEER_STEP) % 0xF
counter = (self.frame // CarControllerParams.STEER_STEP) % 0x10
can_sends.append(fordcan.create_lat_ctl2_msg(self.packer, self.CAN, mode, 0., 0., -apply_curvature, 0., counter))
else:
can_sends.append(fordcan.create_lat_ctl_msg(self.packer, self.CAN, CC.latActive, 0., 0., -apply_curvature, 0.))

Loading…
Cancel
Save