Skip to content

Commit

Permalink
VW PQ: forgot motor2 doesnt have a counter..
Browse files Browse the repository at this point in the history
  • Loading branch information
dkiiv committed Dec 4, 2024
1 parent 5d99c89 commit 54f41b7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def __init__(self, dbc_name, CP, VM):

self.apply_steer_last = 0
self.gra_acc_counter_last = None
self.motor2_counter_last = None
self.bremse8_counter_last = None
self.bremse11_counter_last = None
self.acc_sys_counter_last = None
Expand Down Expand Up @@ -278,15 +277,16 @@ def update(self, CC, CS, now_nanos):
can_sends.append(self.CCS.create_epb_control(self.packer_pt, CANBUS.br, self.EPB_brake, self.EPB_enable))
can_sends.append(self.CCS.filter_epb1(self.packer_pt, CANBUS.cam, stopped)) # in custom module, filter the gateway fwd EPB msg
can_sends.append(self.CCS.filter_ACC_System(self.packer_pt, CANBUS.pt, CS.acc_sys_stock, self.EPB_enable))
if CS.motor2_stock["COUNTER"] != self.motor2_counter_last:
if self.motor2_frame % 2 or CS.motor2_stock != getattr(self, 'motor2_last', CS.motor2_stock): # 50hz / 20ms
can_sends.append(self.CCS.filter_motor2(self.packer_pt, CANBUS.cam, CS.motor2_stock, self.EPB_enable))
if CS.bremse8_stock["COUNTER"] != self.bremse8_counter_last:
can_sends.append(self.CCS.filter_bremse8(self.packer_pt, CANBUS.cam, CS.bremse8_stock, self.EPB_enable))
if CS.bremse11_stock["COUNTER"] != self.bremse11_counter_last:
can_sends.append(self.CCS.filter_bremse11(self.packer_pt, CANBUS.cam, CS.bremse11_stock, stopped))

self.motor2_last = CS.motor2_stock
self.motor2_frame += 1
self.acc_sys_counter_last = CS.acc_sys_stock["COUNTER"]
self.motor2_counter_last = CS.motor2_stock["COUNTER"]
self.bremse8_counter_last = CS.bremse8_stock["COUNTER"]
self.bremse11_counter_last = CS.bremse11_stock["COUNTER"]

Expand Down

0 comments on commit 54f41b7

Please sign in to comment.