From 2b59d8e35b8300f65bbc90a741e8fa26d750bf8b Mon Sep 17 00:00:00 2001 From: 1okko <15377594951@189.cn> Date: Wed, 7 Oct 2026 19:48:33 +0800 Subject: [PATCH] volkswagen: add Audi RS3 2026 MQB EVO Gen2 Add AUDI_A3_MK4 (Audi RS3 2026) on the MQB EVO Gen2 path, select vw_mqbevo_2024, and honor CLUSTER_NO_TA_LANES in the VW LKA HUD. --- opendbc_repo/opendbc/car/tests/routes.py | 1 + .../opendbc/car/torque_data/override.toml | 2 ++ .../opendbc/car/volkswagen/carcontroller.py | 8 ++++++-- .../opendbc/car/volkswagen/fingerprints.py | 9 +++++++++ opendbc_repo/opendbc/car/volkswagen/mebcan.py | 4 ++-- opendbc_repo/opendbc/car/volkswagen/values.py | 11 ++++++++++ .../opendbc/sunnypilot/car/car_list.json | 20 +++++++++++++++++++ 7 files changed, 51 insertions(+), 4 deletions(-) diff --git a/opendbc_repo/opendbc/car/tests/routes.py b/opendbc_repo/opendbc/car/tests/routes.py index d048024bf..8bab66fd6 100644 --- a/opendbc_repo/opendbc/car/tests/routes.py +++ b/opendbc_repo/opendbc/car/tests/routes.py @@ -53,6 +53,7 @@ non_tested_cars = [ GM.CHEVROLET_TRAILBLAZER_NON_ACC_2ND_GEN, GM.CHEVROLET_MALIBU_NON_ACC_9TH_GEN, GM.CADILLAC_XT5_NON_ACC_1ST_GEN, + VOLKSWAGEN.AUDI_A3_MK4, VOLKSWAGEN.VOLKSWAGEN_GOLF_MK8, VOLKSWAGEN.SEAT_LEON_MK4, ] diff --git a/opendbc_repo/opendbc/car/torque_data/override.toml b/opendbc_repo/opendbc/car/torque_data/override.toml index 68a17ea80..6d739a256 100644 --- a/opendbc_repo/opendbc/car/torque_data/override.toml +++ b/opendbc_repo/opendbc/car/torque_data/override.toml @@ -120,3 +120,5 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"] "VOLKSWAGEN_GOLF_MK8" = [nan, 2.5, nan] "SEAT_LEON_MK4" = [nan, 2.5, nan] + +"AUDI_A3_MK4" = [nan, 2.5, nan] diff --git a/opendbc_repo/opendbc/car/volkswagen/carcontroller.py b/opendbc_repo/opendbc/car/volkswagen/carcontroller.py index 1ab06b383..6a02ca58c 100644 --- a/opendbc_repo/opendbc/car/volkswagen/carcontroller.py +++ b/opendbc_repo/opendbc/car/volkswagen/carcontroller.py @@ -177,8 +177,12 @@ class CarController(CarControllerBase): hud_alert = 0 if hud_control.visualAlert in (VisualAlert.steerRequired, VisualAlert.ldw): hud_alert = self.CCP.LDW_MESSAGES["laneAssistTakeOver"] - can_sends.append(self.CCS.create_lka_hud_control(self.packer_pt, self.CAN.pt, CS.ldw_stock_values, CC.latActive, - CS.out.steeringPressed, hud_alert, hud_control)) + if self.CP.flags & VolkswagenFlags.MQB_EVO_GEN2: + can_sends.append(mebcan.create_lka_hud_control(self.packer_pt, self.CAN.pt, self.CP, CS.ldw_stock_values, + CC.latActive, CS.out.steeringPressed, hud_alert, hud_control)) + else: + can_sends.append(self.CCS.create_lka_hud_control(self.packer_pt, self.CAN.pt, CS.ldw_stock_values, CC.latActive, + CS.out.steeringPressed, hud_alert, hud_control)) if hud_control.leadDistanceBars != self.lead_distance_bars_last: self.distance_bar_frame = self.frame diff --git a/opendbc_repo/opendbc/car/volkswagen/fingerprints.py b/opendbc_repo/opendbc/car/volkswagen/fingerprints.py index f773f3b4b..25695146f 100644 --- a/opendbc_repo/opendbc/car/volkswagen/fingerprints.py +++ b/opendbc_repo/opendbc/car/volkswagen/fingerprints.py @@ -8,6 +8,15 @@ Ecu = CarParams.Ecu FW_VERSIONS = { + CAR.AUDI_A3_MK4: { + (Ecu.engine, 0x7e0, None): [], + (Ecu.transmission, 0x7e1, None): [], + (Ecu.srs, 0x715, None): [], + (Ecu.eps, 0x712, None): [], + (Ecu.fwdRadar, 0x757, None): [ + b'\xf1\x871N3907567E \xf1\x890550', + ], + }, CAR.VOLKSWAGEN_GOLF_MK8: { (Ecu.engine, 0x7e0, None): [], (Ecu.transmission, 0x7e1, None): [], diff --git a/opendbc_repo/opendbc/car/volkswagen/mebcan.py b/opendbc_repo/opendbc/car/volkswagen/mebcan.py index d7eda1e1f..08ba5ac32 100644 --- a/opendbc_repo/opendbc/car/volkswagen/mebcan.py +++ b/opendbc_repo/opendbc/car/volkswagen/mebcan.py @@ -35,8 +35,8 @@ def create_eps_update(packer, bus, eps_stock_values, ea_simulated_torque): return packer.make_can_msg("LH_EPS_03", bus, values) -def create_lka_hud_control(packer, bus, ldw_stock_values, lat_active, steering_pressed, hud_alert, hud_control, sound_alert=False): - display_mode = 1 if lat_active else 0 # travel assist style showing yellow lanes when op is active +def create_lka_hud_control(packer, bus, CP, ldw_stock_values, lat_active, steering_pressed, hud_alert, hud_control, sound_alert=False): + display_mode = 1 if lat_active and not (CP.flags & VolkswagenFlags.CLUSTER_NO_TA_LANES) else 0 # travel assist style showing yellow lanes when op is active values = {} if len(ldw_stock_values): diff --git a/opendbc_repo/opendbc/car/volkswagen/values.py b/opendbc_repo/opendbc/car/volkswagen/values.py index b848a2e8a..22b8c5bc2 100644 --- a/opendbc_repo/opendbc/car/volkswagen/values.py +++ b/opendbc_repo/opendbc/car/volkswagen/values.py @@ -230,6 +230,8 @@ class VolkswagenFlags(IntFlag): MEB = 16 MEB_GEN2 = 128 MQB_EVO = 256 + MQB_EVO_GEN2 = 8192 + CLUSTER_NO_TA_LANES = 65536 @dataclass @@ -272,6 +274,8 @@ class VolkswagenMQBevoPlatformConfig(PlatformConfig): def init(self): self.flags |= VolkswagenFlags.MQB_EVO + if self.flags & VolkswagenFlags.MQB_EVO_GEN2: + self.dbc_dict = {Bus.pt: 'vw_mqbevo_2024', Bus.radar: 'vw_mqbevo_2024'} @dataclass @@ -519,6 +523,13 @@ class CAR(Platforms): chassis_codes={"8V", "FF"}, wmis={WMI.AUDI_GERMANY_CAR, WMI.AUDI_SPORT, WMI.VOLKSWAGEN_CHINA_FAW}, ) + AUDI_A3_MK4 = VolkswagenMQBevoPlatformConfig( + [VWCarDocs("Audi RS3 2026")], + VolkswagenCarSpecs(mass=1650, wheelbase=2.631), + chassis_codes={"GY"}, + wmis={WMI.AUDI_EUROPE_MPV}, + flags=VolkswagenFlags.MQB_EVO_GEN2 | VolkswagenFlags.CLUSTER_NO_TA_LANES, + ) AUDI_Q2_MK1 = VolkswagenMQBPlatformConfig( [VWCarDocs("Audi Q2 2018")], VolkswagenCarSpecs(mass=1205, wheelbase=2.61), diff --git a/opendbc_repo/opendbc/sunnypilot/car/car_list.json b/opendbc_repo/opendbc/sunnypilot/car/car_list.json index e68a32216..c07585041 100644 --- a/opendbc_repo/opendbc/sunnypilot/car/car_list.json +++ b/opendbc_repo/opendbc/sunnypilot/car/car_list.json @@ -4911,5 +4911,25 @@ "2025" ], "package": "Adaptive Cruise Control (ACC) & Lane Assist" + }, + "Audi RS3 2026": { + "platform": "AUDI_A3_MK4", + "make": "Audi", + "brand": "volkswagen", + "model": "RS3", + "year": [ + "2026" + ], + "package": "Adaptive Cruise Control (ACC) & Lane Assist" + }, + "Volkswagen MQBevo Gen 2 2026": { + "platform": "AUDI_A3_MK4", + "make": "Volkswagen", + "brand": "volkswagen", + "model": "MQBevo Gen 2", + "year": [ + "2026" + ], + "package": "Adaptive Cruise Control (ACC) & Lane Assist" } }