mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-31 13:13:44 +08:00
guard off frames.
This commit is contained in:
@@ -161,9 +161,11 @@ class CarController(CarControllerBase):
|
||||
# while frames remain, send off spoof if not colliding with steer
|
||||
if getattr(self, "off_spoof_frames", 0) > 0:
|
||||
if self.frame != self.last_steer_frame:
|
||||
# send off messages
|
||||
can_sends.append(gmcan.create_prndl2_command(self.packer_pt, CanBus.POWERTRAIN, False))
|
||||
can_sends.append(gmcan.create_regen_paddle_command(self.packer_pt, CanBus.POWERTRAIN, False))
|
||||
self.off_spoof_frames -= 1
|
||||
# decrement only when sent
|
||||
self.off_spoof_frames -= 1
|
||||
|
||||
# Update regen_active state
|
||||
self.last_regen_active = regen_active
|
||||
|
||||
Reference in New Issue
Block a user