diff --git a/selfdrive/car/volkswagen/carcontroller.py b/selfdrive/car/volkswagen/carcontroller.py index a38b0f8b5d6c61..f9f0ef8c886f8c 100644 --- a/selfdrive/car/volkswagen/carcontroller.py +++ b/selfdrive/car/volkswagen/carcontroller.py @@ -20,7 +20,7 @@ def limit_jerk(accel, prev_accel, max_jerk, dt): return prev_accel + delta_accel def EPB_handler(CS, self, ACS_Sta_ADR, ACS_Sollbeschl, vEgo, stopping): - if ACS_Sta_ADR == 1 and ACS_Sollbeschl <= 0 and vEgo <= (18 * CV.KPH_TO_MS): + if ACS_Sta_ADR == 1 and ACS_Sollbeschl < 0 and vEgo <= (18 * CV.KPH_TO_MS): if not self.EPB_enable: # First frame of EPB entry self.EPB_counter = 0 self.EPB_brake = 0 @@ -308,9 +308,9 @@ def update(self, CC, CS, now_nanos): 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)) if self.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_active)) + can_sends.append(self.CCS.filter_motor2(self.packer_pt, CANBUS.cam, CS.motor2_stock, active = CS.acc_sys_stock["ACS_Sta_ADR"] == 1)) 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_active)) + can_sends.append(self.CCS.filter_bremse8(self.packer_pt, CANBUS.cam, CS.bremse8_stock, active = CS.acc_sys_stock["ACS_Sta_ADR"] == 1)) if CS.bremse11_stock["COUNTER"] != self.bremse11_counter_last: 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: diff --git a/selfdrive/car/volkswagen/pqcan.py b/selfdrive/car/volkswagen/pqcan.py index ea03e6442fbf81..9f9c9b4f4290b7 100644 --- a/selfdrive/car/volkswagen/pqcan.py +++ b/selfdrive/car/volkswagen/pqcan.py @@ -128,17 +128,17 @@ def create_motor2_control(packer, bus, motor2_stock): # Bremse_8 : BR8_StaBrSyst 1 --> 0 # Motor_2 : GRA_Status 1 --> 0 -def filter_motor2(packer, bus, motor2_car, epb_freigabe): # bus 0 --> 2 +def filter_motor2(packer, bus, motor2_car, active): # bus 0 --> 2 values = motor2_car - if epb_freigabe: + if active: values.update({ "GRA_Status": 1, }) return packer.make_can_msg("Motor_2", bus, values) -def filter_bremse8(packer, bus, bremse8_car, epb_freigabe): # bus 0 --> 2 +def filter_bremse8(packer, bus, bremse8_car, active): # bus 0 --> 2 values = bremse8_car - if epb_freigabe: + if active: values.update({ "BR8_Sta_ACC_Anf": 1, "BR8_Verz_EPB_akt": 0,