Skip to content

Commit

Permalink
VW PQ: add b11 hydhalten, make signals dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
dkiiv committed Dec 19, 2024
1 parent 376a6e9 commit 3d7de75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def update(self, CC, CS, now_nanos):
if CS.acc_sys_stock["COUNTER"] != self.acc_sys_counter_last:
# EPB_handler(CS, self, CS.acc_sys_stock["ACS_Sta_ADR"], CS.acc_sys_stock["ACS_Sollbeschl"], CS.out.vEgoRaw, self.stopping)
can_sends.append(self.CCS.filter_ACC_System(self.packer_pt, CANBUS.pt, CS.acc_sys_stock, self.EPB_active))
can_sends.append(self.CCS.create_epb_control(self.packer_pt, CANBUS.br, self.EPB_brake, self.EPB_enable))
can_sends.append(self.CCS.create_epb_control(self.packer_pt, CANBUS.br, self.EPB_brake, self.EPB_enable, self.stopped))
can_sends.append(self.CCS.filter_epb1(self.packer_pt, CANBUS.cam, self.stopped)) # in custom module, filter the gateway fwd EPB msg
if CS.acc_anz_stock["COUNTER"] != self.acc_anz_counter_last:
can_sends.append(self.CCS.filter_ACC_Anzeige(self.packer_pt, CANBUS.pt, CS.acc_anz_stock, self.ACC_anz_blind))
Expand All @@ -312,7 +312,7 @@ def update(self, CC, CS, now_nanos):
if CS.bremse8_stock["COUNTER"] != self.bremse8_counter_last:
can_sends.append(self.CCS.filter_bremse8(self.packer_pt, CANBUS.cam, CS.bremse8_stock, False))
if self.frame % 10 or CS.bremse11_stock != self.bremse11_last:
can_sends.append(self.CCS.filter_bremse11(self.packer_pt, CANBUS.cam, CS.bremse11_stock, False))
can_sends.append(self.CCS.filter_bremse11(self.packer_pt, CANBUS.cam, CS.bremse11_stock, self.stopped))
if CS.gra_stock_values["COUNTER"] != self.gra_acc_counter_last:
can_sends.append(self.CCS.filter_GRA_Neu(self.packer_pt, CANBUS.cam, CS.gra_stock_values, resume = self.stopped and (self.frame % 100 < 50)))

Expand Down
6 changes: 3 additions & 3 deletions selfdrive/car/volkswagen/pqcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def filter_epb1(packer, bus, stopped): # bus 0 --> 2
"EP1_Verzoegerung": 0,
"EP1_Freigabe_Ver": 0,
"EP1_Bremslicht": 0,
"EP1_HydrHalten": 1,
"EP1_HydrHalten": 1 if stopped else 0,
"EP1_AutoHold_aktiv": 1,
}
return packer.make_can_msg("EPB_1", bus, values)
Expand Down Expand Up @@ -191,12 +191,12 @@ def filter_GRA_Neu(packer, bus, gra_car, resume): # bus 2 --> 0
})
return packer.make_can_msg("GRA_Neu", bus, values)

def create_epb_control(packer, bus, apply_brake, epb_enabled): # bus 1
def create_epb_control(packer, bus, apply_brake, epb_enabled, stopped): # bus 1
values = {
"EP1_Verzoegerung": 0,
"EP1_Freigabe_Ver": 0,
"EP1_Bremslicht": 0,
"EP1_HydrHalten": 1,
"EP1_HydrHalten": 1 if stopped else 0,
"EP1_AutoHold_aktiv": 1,
}
return packer.make_can_msg("EPB_1", bus, values)

0 comments on commit 3d7de75

Please sign in to comment.