From 6129a92f38a7256cda5e1785ded784ab1d937df5 Mon Sep 17 00:00:00 2001 From: Jason Young <46612682+jyoung8607@users.noreply.github.com> Date: Thu, 4 Mar 2021 19:48:36 -0500 Subject: [PATCH] VW MQB: Add support for blind spot monitoring radar (#20242) * Get steering rate-change sign from the right signal * Temp remove network-switching reference prior to upstream * Additional description of BSM signals * Simplify expression * Typo * Update ref_commit * update refs after merge Co-authored-by: Adeeb Shihadeh --- selfdrive/car/volkswagen/carstate.py | 16 ++++++++++++++++ selfdrive/test/process_replay/ref_commit | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/selfdrive/car/volkswagen/carstate.py b/selfdrive/car/volkswagen/carstate.py index 90d20b406a..b847d246de 100644 --- a/selfdrive/car/volkswagen/carstate.py +++ b/selfdrive/car/volkswagen/carstate.py @@ -60,6 +60,18 @@ class CarState(CarStateBase): # We use the speed preference for OP. self.displayMetricUnits = not pt_cp.vl["Einheiten_01"]["KBI_MFA_v_Einheit_02"] + # Consume blind-spot monitoring info/warning LED states, if available. The + # info signal (LED on) is enabled whenever a vehicle is detected in the + # driver's blind spot. The warning signal (LED flashing) is enabled if the + # driver shows possibly hazardous intent toward a BSM detected vehicle, by + # setting the turn signal in that direction, or (for cars with factory Lane + # Assist) approaches the lane boundary in that direction. Size of the BSM + # detection box is dynamic based on speed and road curvature. + # Refer to VW Self Study Program 890253: Volkswagen Driver Assist Systems, + # pages 32-35. + ret.leftBlindspot = bool(pt_cp.vl["SWA_01"]["SWA_Infostufe_SWA_li"]) or bool(pt_cp.vl["SWA_01"]["SWA_Warnung_SWA_li"]) + ret.rightBlindspot = bool(pt_cp.vl["SWA_01"]["SWA_Infostufe_SWA_re"]) or bool(pt_cp.vl["SWA_01"]["SWA_Warnung_SWA_re"]) + # Update ACC radar status. accStatus = pt_cp.vl["TSK_06"]['TSK_Status'] if accStatus == 2: @@ -164,6 +176,10 @@ class CarState(CarStateBase): ("GRA_Tip_Stufe_2", "GRA_ACC_01", 0), # unknown related to stalk type ("GRA_ButtonTypeInfo", "GRA_ACC_01", 0), # unknown related to stalk type ("COUNTER", "GRA_ACC_01", 0), # GRA_ACC_01 CAN message counter + ("SWA_Infostufe_SWA_li", "SWA_01", 0), # Blind spot object info, left + ("SWA_Warnung_SWA_li", "SWA_01", 0), # Blind spot object warning, left + ("SWA_Infostufe_SWA_re", "SWA_01", 0), # Blind spot object info, right + ("SWA_Warnung_SWA_re", "SWA_01", 0), # Blind spot object warning, right ] checks = [ diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index b1eaf511d0..d80cfcacea 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -21cbc622d0389e09806b33f91912f1a28872cf07 \ No newline at end of file +4d9227b024fd223bb07e5910c6a84d7493c42270