Skip to content

VW MLB: Add support for Audi Q5 Mk1#3138

Merged
jyoung8607 merged 26 commits intocommaai:masterfrom
Dennis-NL:MLB_B8
Mar 29, 2026
Merged

VW MLB: Add support for Audi Q5 Mk1#3138
jyoung8607 merged 26 commits intocommaai:masterfrom
Dennis-NL:MLB_B8

Conversation

@Dennis-NL
Copy link
Copy Markdown
Contributor

@Dennis-NL Dennis-NL commented Feb 17, 2026

Validation

  • Dongle ID: 5432d2499e17e646
  • Route: 000005e9--ca7e3768cc
  • Use alt bus because certain signals are not present on Audi B8
  • Tested on Porsche Macan S95 & Audi Q5 8R
  • Should work on A4/S4 B8, A5/S5 8K , Q5/SQ5 8R, Macan 95B with EPS. (Only Macan and Q5 tested and fingerprinted)

Re-do of: #2905

@github-actions github-actions bot added DBC signals car related to opendbc/car/ volkswagen car safety vehicle-specific safety code labels Feb 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 17, 2026

Car behavior report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

Testing 130 segments for: VOLKSWAGEN_ARTEON_MK1, VOLKSWAGEN_ATLAS_MK1, VOLKSWAGEN_CRAFTER_MK2, VOLKSWAGEN_GOLF_MK7, VOLKSWAGEN_JETTA_MK7, VOLKSWAGEN_PASSAT_MK8, VOLKSWAGEN_PASSAT_NMS, VOLKSWAGEN_POLO_MK6, VOLKSWAGEN_TAOS_MK1, VOLKSWAGEN_TIGUAN_MK2, VOLKSWAGEN_TOURAN_MK2, VOLKSWAGEN_TRANSPORTER_T61, VOLKSWAGEN_TROC_MK1

✅ 0 changed, 130 passed, 0 errors

@oscarmcnulty
Copy link
Copy Markdown

Something like this should fix tests:

(opendbc) om@om-desktop:~/openpilot/opendbc_repo$ git diff
diff --git a/opendbc/safety/tests/test_volkswagen_mlb.py b/opendbc/safety/tests/test_volkswagen_mlb.py
index 562bfce6..4b379f6c 100755
--- a/opendbc/safety/tests/test_volkswagen_mlb.py
+++ b/opendbc/safety/tests/test_volkswagen_mlb.py
@@ -50,11 +50,16 @@ class TestVolkswagenMlbSafetyBase(common.CarSafetyTest, common.DriverTorqueSteer
   def _user_gas_msg(self, gas):
     return self._motor_03_msg(gas_signal=gas)
 
-  # ACC engagement status
+  # ACC engagement status (Macan: ACC_05 on bus 2)
   def _tsk_status_msg(self, enable, main_switch=True):
     values = {"ACC_Status_ACC": 1 if not main_switch else 3 if enable else 2}
     return self.packer.make_can_msg_safety("ACC_05", 2, values)
 
+  # ACC engagement status (Audi B8: TSK_02 on bus 0)
+  def _tsk_02_status_msg(self, enable=False, main_switch=True):
+    values = {"TSK_Status": 3 if not main_switch else 1 if enable else 0}
+    return self.packer.make_can_msg_safety("TSK_02", 0, values)
+
   def _pcm_status_msg(self, enable):
     return self._tsk_status_msg(enable)
 
@@ -136,6 +141,41 @@ class TestVolkswagenMlbStockSafety(TestVolkswagenMlbSafetyBase):
     self._rx(self._ls_01_msg(cancel=True, bus=0))
     self.assertFalse(self.safety.get_controls_allowed(), "controls allowed after cancel")
 
+  def test_acc_main_switch_off_disables_controls_acc05(self):
+    # Macan: ACC_05 on bus 2, main switch off should disable controls
+    self._rx(self._tsk_status_msg(True))
+    self.assertTrue(self.safety.get_controls_allowed())
+    self._rx(self._tsk_status_msg(False, main_switch=False))
+    self.assertFalse(self.safety.get_controls_allowed())
+
+  def test_tsk_02_cruise_status(self):
+    # Audi B8: TSK_02 on bus 0, TSK_Status values:
+    #   0 = main on, not engaged
+    #   1 = engaged
+    #   2 = engaged
+    #   3 = main off
+
+    # acc_status=1 engages cruise
+    self._rx(self._tsk_02_status_msg(enable=False))
+    self._rx(self._tsk_02_status_msg(enable=True))
+    self.assertTrue(self.safety.get_controls_allowed())
+    self.assertTrue(self.safety.get_acc_main_on())
+
+    # acc_status=0 disengages cruise, main stays on
+    self._rx(self._tsk_02_status_msg(enable=False))
+    self.assertFalse(self.safety.get_controls_allowed())
+    self.assertTrue(self.safety.get_acc_main_on())
+
+    # acc_status=2 also engages cruise
+    self._rx(self.packer.make_can_msg_safety("TSK_02", 0, {"TSK_Status": 2}))
+    self.assertTrue(self.safety.get_controls_allowed())
+    self.assertTrue(self.safety.get_acc_main_on())
+
+    # acc_status=3 = main off, disengages
+    self._rx(self._tsk_02_status_msg(main_switch=False))
+    self.assertFalse(self.safety.get_controls_allowed())
+    self.assertFalse(self.safety.get_acc_main_on())
+
 
 if __name__ == "__main__":
   unittest.main()

@Dennis-NL Dennis-NL marked this pull request as ready for review February 23, 2026 21:21
Copy link
Copy Markdown
Collaborator

@jyoung8607 jyoung8607 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll definitely merge this car once we work through questions about various signals, but we need to work through those questions first. We've spent an enormous amount of time cleaning up complicated, buggy, unnecessary signal sprawl on other car ports. I want to avoid that up front here.

I'm aware of some of the information sources you may be working from. They are not necessarily complete or applicable in all respects. We'll add anything that's proven necessary, but that final proof comes from examining live vehicle data with Cabana.

I'd like one uploaded route from this vehicle with all four of these tests together:

  • Driver's seatbelt on/off three times
  • Driver's door open/closed three times
  • Left turn signal three times
  • Right turn signal three times

@jyoung8607 jyoung8607 changed the title MLB: Add support for Audi B8 VW MLB: Add support for Audi Q5 Mk1 Mar 1, 2026
@Dennis-NL
Copy link
Copy Markdown
Contributor Author

We'll definitely merge this car once we work through questions about various signals, but we need to work through those questions first. We've spent an enormous amount of time cleaning up complicated, buggy, unnecessary signal sprawl on other car ports. I want to avoid that up front here.

I'm aware of some of the information sources you may be working from. They are not necessarily complete or applicable in all respects. We'll add anything that's proven necessary, but that final proof comes from examining live vehicle data with Cabana.

I'd like one uploaded route from this vehicle with all four of these tests together:

* Driver's seatbelt on/off three times

* Driver's door open/closed three times

* Left turn signal three times

* Right turn signal three times

Route: 5432d2499e17e646/00000001--a99353214f

I did the tests in the following order:

  1. Seatbelt on/off 3 times
  2. Driver door open 3 times
  3. Left indicator 3 times engaged then 3 times with a slight tap (Comfort)
  4. Right indicator 3 times engaged then 3 times with a slight tap (Comfort)
  5. Gear lever in P > R > N > D > P

Before every step i made a marker

@github-actions github-actions bot removed the car safety vehicle-specific safety code label Mar 29, 2026
@jyoung8607 jyoung8607 merged commit 279d834 into commaai:master Mar 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

car related to opendbc/car/ DBC signals volkswagen

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants