diff --git a/opendbc/car/volkswagen/carstate.py b/opendbc/car/volkswagen/carstate.py index 80eda638..fe59123c 100644 --- a/opendbc/car/volkswagen/carstate.py +++ b/opendbc/car/volkswagen/carstate.py @@ -146,7 +146,7 @@ class CarState(CarStateBase): ret = structs.CarState() # vEgo obtained from Bremse_1 vehicle speed rather than Bremse_3 wheel speeds because Bremse_3 isn't present on NSF - ret.vEgoRaw = pt_cp.vl["Bremse_1"]["Geschwindigkeit_neu__Bremse_1_"] * CV.KPH_TO_MS + ret.vEgoRaw = pt_cp.vl["Bremse_1"]["BR1_Rad_kmh"] * CV.KPH_TO_MS ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) ret.standstill = ret.vEgoRaw == 0 @@ -226,7 +226,7 @@ class CarState(CarStateBase): self.gra_stock_values = pt_cp.vl["GRA_Neu"] # Additional safety checks performed in CarInterface. - ret.espDisabled = bool(pt_cp.vl["Bremse_1"]["ESP_Passiv_getastet"]) + ret.espDisabled = bool(pt_cp.vl["Bremse_1"]["BR1_ESPASR_passive"]) ret.lowSpeedAlert = self.update_low_speed_alert(ret.vEgo) diff --git a/opendbc/dbc/vw_pq.dbc b/opendbc/dbc/vw_pq.dbc index d488a709..39a54d3f 100644 --- a/opendbc/dbc/vw_pq.dbc +++ b/opendbc/dbc/vw_pq.dbc @@ -938,31 +938,33 @@ BO_ 1440 Bremse_2: 8 XXX SG_ Timer m1 : 0|8@1+ (0.04,0) [0|10.2] "usec" XXX SG_ Querbeschleunigung m0 : 0|8@1+ (0.01,-1.27) [-1.27|1.27] "g" XXX -BO_ 416 Bremse_1: 8 XXX - SG_ Geschwindigkeitsersatzwert : 63|1@1+ (1,0) [0|0] "" XXX - SG_ ESP_Systemstatus_4_1 : 62|1@1+ (1,0) [0|0] "" XXX - SG_ ESP_Passiv_getastet : 61|1@1+ (1,0) [0|0] "" XXX - SG_ ASR_Steuerger_t : 60|1@1+ (1,0) [0|0] "" XXX - SG_ COUNTER : 56|4@1+ (1,0) [0|15] "" XXX - SG_ MSR_Eingriffsmoment : 48|8@1+ (0.39,0) [0|99.06] "MDI" XXX - SG_ ASR_Eingriffsmoment_schnell : 40|8@1+ (0.39,0) [0|99.06] "MDI" XXX - SG_ ASR_Eingriffsmoment_langsam : 32|8@1+ (0.39,0) [0|99.06] "MDI" XXX - SG_ Geschwindigkeit_neu__Bremse_1_ : 17|15@1+ (0.01,0) [0|326.39] "km/h" XXX - SG_ Aktiver_Bremskraftverstaerker : 16|1@1+ (1,0) [0|0] "" XXX - SG_ ABS_in_Diagnose : 15|1@1+ (1,0) [0|0] "" XXX - SG_ Fehlerstatus_Schlechtwegausblen : 14|1@1+ (1,0) [0|0] "" XXX - SG_ Schlechtwegausblendung : 13|1@1+ (1,0) [0|0] "" XXX - SG_ Fahrer_bremst__Bremse_1___4_1_ : 11|1@1+ (1,0) [0|0] "" XXX - SG_ Bremskontroll_Lampe : 10|1@1+ (1,0) [0|0] "" XXX - SG_ Lampe_ASR___ESP : 9|1@1+ (1,0) [0|0] "" XXX - SG_ Lampe_ABS : 8|1@1+ (1,0) [0|0] "" XXX - SG_ EBV_Eingriff : 7|1@1+ (1,0) [0|0] "" XXX - SG_ ASR_Schaltbeeinflussung : 5|2@1+ (1,0) [0|0] "" XXX - SG_ ESP_Eingriff : 4|1@1+ (1,0) [0|0] "" XXX - SG_ EDS_Eingriff : 3|1@1+ (1,0) [0|0] "" XXX - SG_ ABS_Bremsung__4_1_ : 2|1@1+ (1,0) [0|0] "" XXX - SG_ MSR_Anforderung : 1|1@1+ (1,0) [0|0] "" XXX - SG_ ASR_Anforderung : 0|1@1+ (1,0) [0|0] "" XXX +BO_ 416 Bremse_1: 8 ABS + SG_ BR1_ASR_Anf : 0|1@1+ (1,0) [0|1] "" Motor + SG_ BR1_MSR_Anf M : 1|1@1+ (1,0) [0|1] "" Motor + SG_ BR1_ABS_Brems : 2|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_EDS_Ongr : 3|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_ESP_Ongr : 4|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_ASR_Ongr : 5|2@1+ (1,0) [0|3] "" Transmission + SG_ BR1_EBV_Ongr : 7|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Lampe_ABS : 8|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Lampe_ASR : 9|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Lampe_BK : 10|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Lichtschalt : 11|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_StaDruckschw : 12|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_MAD : 13|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Sta_MAD : 14|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Diagnose : 15|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_BKV_active : 16|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Rad_kmh : 17|15@1+ (0.01,0) [0|326.39] "km/h" XXX + SG_ BR1_ASRMo_sl : 32|8@1+ (0.39,0) [0|99.06] "%" Motor + SG_ BR1_ASRMo_fa m0 : 40|8@1+ (0.39,0) [0|99.06] "%" Motor + SG_ BR1_MSR_Mo_inv m1 : 40|8@1+ (-0.39,99.45) [0|99.06] "%" Motor + SG_ BR1_MSR_Mo : 48|8@1+ (0.39,0) [0|99.06] "%" Motor + SG_ BR1_Zaehler : 56|4@1+ (1,0) [0|15] "" XXX + SG_ BR1_ASR_ESP : 60|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_ESPASR_passive : 61|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Sta_ESP : 62|1@1+ (1,0) [0|1] "" XXX + SG_ BR1_Ersatz_Kmh : 63|1@1+ (1,0) [0|1] "" XXX BO_ 680 Bremsbooster_1: 3 XXX SG_ Fehlerspeichereintrag_Booster : 23|1@1+ (1,0) [0|0] "" XXX @@ -1501,7 +1503,32 @@ CM_ SG_ 210 LM_Offset "centiNewton-meters for ease of calculation without FP mat CM_ SG_ 210 Vib_Amp "Steering wheel haptic, amplitude"; CM_ SG_ 210 Vib_Freq "Steering wheel haptic, frequency"; -CM_ SG_ 416 Zaehler_Bremse_1 "Counter Bremse_1"; +CM_ SG_ 416 BR1_ASR_Anf "ASR request to engine - requests in bytes 5 and 6 to be executed"; +CM_ SG_ 416 BR1_MSR_Anf "MSR request - when set, byte 6 contains inverse MSR torque"; +CM_ SG_ 416 BR1_ABS_Brems "ABS control active (including pressure reduction)"; +CM_ SG_ 416 BR1_EDS_Ongr "Electronic differential lock intervention"; +CM_ SG_ 416 BR1_ESP_Ongr "ESP driving dynamics control intervention"; +CM_ SG_ 416 BR1_ASR_Ongr "ASR transmission switching influence"; +CM_ SG_ 416 BR1_EBV_Ongr "Electronic brake force distribution intervention"; +CM_ SG_ 416 BR1_Lampe_ABS "ABS safety warning lamp"; +CM_ SG_ 416 BR1_Lampe_ASR "ASR/ESP lamp (including flashing info)"; +CM_ SG_ 416 BR1_Lampe_BK "Brake control lamp (red)"; +CM_ SG_ 416 BR1_Lichtschalt "Brake light switch / brake pressure threshold exceeded"; +CM_ SG_ 416 BR1_StaDruckschw "Brake test switch / pressure threshold status"; +CM_ SG_ 416 BR1_MAD "OBD rough road suppression"; +CM_ SG_ 416 BR1_Sta_MAD "Rough road suppression status"; +CM_ SG_ 416 BR1_Diagnose "ABS diagnosis mode active"; +CM_ SG_ 416 BR1_BKV_active "Active brake booster installed and not faulty"; +CM_ SG_ 416 BR1_Rad_kmh "Vehicle speed (mean of driven wheels or ABS reference)"; +CM_ SG_ 416 BR1_ASRMo_sl "ASR engagement torque slow (0-99.06%)"; +CM_ SG_ 416 BR1_ASRMo_fa "ASR engagement torque fast when MSR_Anf=0 (0-99.06%)"; +CM_ SG_ 416 BR1_MSR_Mo_inv "Inverse MSR torque when MSR_Anf=1 (99.06-0%)"; +CM_ SG_ 416 BR1_MSR_Mo "MSR engagement torque (0-99.06%)"; +CM_ SG_ 416 BR1_Zaehler "Message counter to mark intervention moment"; +CM_ SG_ 416 BR1_ASR_ESP "Control unit type: 0=ABS/EDS, 1=ASR/ESP/MABS"; +CM_ SG_ 416 BR1_ESPASR_passive "ESP/ASR passive or deactivated by driver"; +CM_ SG_ 416 BR1_Sta_ESP "ESP error status (fault memory entry)"; +CM_ SG_ 416 BR1_Ersatz_Kmh "Speed is substitute value (sensor defect)"; CM_ SG_ 640 inneres_Motor_Moment "Engine Indicated Torque"; CM_ SG_ 640 Fahrerwunschmoment "Driver Requested Torque"; @@ -1608,6 +1635,30 @@ CM_ SG_ 1470 XX_DLCORTLC2 "Might be DLC or TLC, might have wrong size"; CM_ SG_ 1550 MFA_v_Signal_02 "0=km/h, 1=mph"; +SG_MUL_VAL_ 416 BR1_ASRMo_fa BR1_MSR_Anf 0-0; +SG_MUL_VAL_ 416 BR1_MSR_Mo_inv BR1_MSR_Anf 1-1; + +VAL_ 416 BR1_ASR_Anf 0 "no_requirement" 1 "ASR_requirement"; +VAL_ 416 BR1_MSR_Anf 0 "no_requirement" 1 "MSR_requirement"; +VAL_ 416 BR1_ABS_Brems 0 "no_ABS_control" 1 "ABS_control"; +VAL_ 416 BR1_EDS_Ongr 0 "no_EDS_intervention" 1 "EDS_intervention"; +VAL_ 416 BR1_ESP_Ongr 0 "no_ESP_intervention" 1 "ESP_intervention"; +VAL_ 416 BR1_ASR_Ongr 0 "no_requirement" 1 "ASR_shift_map" 2 "Downshift" 3 "Switching_ban"; +VAL_ 416 BR1_EBV_Ongr 0 "no_EBV_intervention" 1 "EBV_intervention"; +VAL_ 416 BR1_Lampe_ABS 0 "Lamp_off" 1 "Lamp_on"; +VAL_ 416 BR1_Lampe_ASR 0 "Lamp_off" 1 "Lamp_on"; +VAL_ 416 BR1_Lampe_BK 0 "Lamp_off" 1 "Lamp_on"; +VAL_ 416 BR1_Lichtschalt 0 "no_Bremsen_Schw_unterschr" 1 "Bremse_betaetigt_Schw_ueberschr"; +VAL_ 416 BR1_StaDruckschw 0 "Sta_guel_BKV_n_angest_k_Br" 1 "Sta_n_verf_BKV_angest_Br"; +VAL_ 416 BR1_MAD 0 "no_Offblendung" 1 "Offblendung"; +VAL_ 416 BR1_Sta_MAD 0 "valid" 1 "invalid"; +VAL_ 416 BR1_Diagnose 0 "no" 1 "in_Diagnose"; +VAL_ 416 BR1_BKV_active 0 "BKV_not_installed_or_fault" 1 "BKV_installed_and_not_fault"; +VAL_ 416 BR1_ASR_ESP 0 "ABS_ABS_EDS" 1 "ASR_ESP_MABS"; +VAL_ 416 BR1_ESPASR_passive 0 "ESP_ASR_activated" 1 "ESP_oder_ASR_passive_get_oder_Fktumsch_oder_Rollenmodus"; +VAL_ 416 BR1_Sta_ESP 0 "ok" 1 "Failure"; +VAL_ 416 BR1_Ersatz_Kmh 0 "OK" 1 "Substitute_value"; + VAL_ 870 AWV_Text 0 "kein_Text" 1 "FrontAssist_aus" 2 "FrontAssist_startet" 3 "FrontAssist_Warnung" 4 "FrontAssist_Sens_reinig" 5 "FrontAssist_Failure" 6 "FrontAssist_Demo" 7 "Vorhalt" 8 "Bremsung_wird_gerade_durchgefuehrt" 9 "Sensor_not_verfuegbar" 10 "Sensor_reinigen" 11 "Service_notwendig_Failure" 12 "Funktion_vom_Fahrer_deactivated" 13 "Funktion_vom_Fahrer_activated" 14 "FrontAssist_zur_Zeit_not_verfuegbar__rev_Failure"; VAL_ 870 AWV_1_Freigabe 0 "nicht_freigegeben" 1 "freigegeben"; VAL_ 870 AWV_1_Prefill 0 "keine_Prefill_Anf" 1 "Prefill_Anf"; diff --git a/opendbc/safety/tests/test_volkswagen_pq.py b/opendbc/safety/tests/test_volkswagen_pq.py index b00e62f4..201b83b7 100755 --- a/opendbc/safety/tests/test_volkswagen_pq.py +++ b/opendbc/safety/tests/test_volkswagen_pq.py @@ -38,7 +38,7 @@ class TestVolkswagenPqSafetyBase(common.PandaCarSafetyTest, common.DriverTorqueS # Ego speed (Bremse_1) def _speed_msg(self, speed): - values = {"Geschwindigkeit_neu__Bremse_1_": speed} + values = {"BR1_Rad_kmh": speed} return self.packer.make_can_msg_panda("Bremse_1", 0, values) # Brake light switch (shared message Motor_2)