From 3d7de750f539d289461f65ddaed4fd77077a03ab Mon Sep 17 00:00:00 2001 From: cuj Date: Thu, 19 Dec 2024 11:39:16 -0500 Subject: [PATCH] VW PQ: add b11 hydhalten, make signals dynamic --- selfdrive/car/volkswagen/carcontroller.py | 4 ++-- selfdrive/car/volkswagen/pqcan.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index 688bff9eb5c0df..336aee7b785e38 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -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)) @@ -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))) diff --git a/selfdrive/car/volkswagen/pqcan.py b/selfdrive/car/volkswagen/pqcan.py index f93c997121b5c4..c09350021fb47b 100644 --- a/selfdrive/car/volkswagen/pqcan.py +++ b/selfdrive/car/volkswagen/pqcan.py @@ -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) @@ -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) \ No newline at end of file