From 38834e90b9706d06d0ceecc5a417790126499dce Mon Sep 17 00:00:00 2001 From: actuallylemoncurd Date: Fri, 2 Feb 2024 20:17:09 -0500 Subject: [PATCH] golf varient haxs (ACC equipped) --- launch_env.sh | 2 ++ opendbc/vw_golf_mk4.dbc | 2 +- panda/board/safety/safety_volkswagen_pq.h | 2 +- selfdrive/car/volkswagen/interface.py | 9 +++------ selfdrive/car/volkswagen/pqcan.py | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/launch_env.sh b/launch_env.sh index c16f06191294d88..851bd362c6e22c6 100755 --- a/launch_env.sh +++ b/launch_env.sh @@ -5,6 +5,8 @@ export MKL_NUM_THREADS=1 export NUMEXPR_NUM_THREADS=1 export OPENBLAS_NUM_THREADS=1 export VECLIB_MAXIMUM_THREADS=1 +export SKIP_FW_QUERY=1 +export FINGERPRINT="VOLKSWAGEN PASSAT NMS" if [ -z "$AGNOS_VERSION" ]; then export AGNOS_VERSION="9.1" diff --git a/opendbc/vw_golf_mk4.dbc b/opendbc/vw_golf_mk4.dbc index 131a4b763c76cb9..cc7cdd39b86bce8 100644 --- a/opendbc/vw_golf_mk4.dbc +++ b/opendbc/vw_golf_mk4.dbc @@ -1620,7 +1620,7 @@ VAL_ 872 ACS_Fehler 1 "Fehlerspeichereintrag" 0 "kein_Fehlerspeichereintrag" ; VAL_ 872 ACS_zul_Regelabw 254 "ADR_nicht_aktiv" 255 "Fehler" ; VAL_ 872 ACS_max_AendGrad 254 "Neutralwert" 0 "Neutralwert" 255 "Fehler" ; -VAL_ 978 LH2_Sta_HCA 0 "disabled" 1 "initializing" 2 "fault" 3 "ready" 4 "rejected" 5 "active"; +VAL_ 978 LH2_Sta_HCA 0 "disabled" 1 "initializing" 2 "fault" 3 "ready" 4 "rejected" 5 "active" 7 "active"; VAL_ 1088 Waehlhebelposition__Getriebe_1_ 8 "P" 7 "R" 6 "N" 5 "D" 9 "U" 12 "S" 14 "T" 10 "T" 11 "T"; VAL_ 1386 ACA_StaACC 6 "ACC_rev_aus" 0 "Hauptschalter_aus" 4 "ACC_im_Hintergrund" 3 "ACC_aktiv" 1 "Reserve" 2 "ACC_passiv" 7 "ACC_irrev_aus" 5 "frei" ; diff --git a/panda/board/safety/safety_volkswagen_pq.h b/panda/board/safety/safety_volkswagen_pq.h index fc57447dfa1431f..d45f86749670352 100644 --- a/panda/board/safety/safety_volkswagen_pq.h +++ b/panda/board/safety/safety_volkswagen_pq.h @@ -185,7 +185,7 @@ static bool volkswagen_pq_tx_hook(const CANPacket_t *to_send) { } uint32_t hca_status = ((GET_BYTE(to_send, 1) >> 4) & 0xFU); - bool steer_req = (hca_status == 5U); + bool steer_req = ((hca_status == 5U) || (hca_status == 7U)); if (steer_torque_cmd_checks(desired_torque, steer_req, VOLKSWAGEN_PQ_STEERING_LIMITS)) { tx = false; diff --git a/selfdrive/car/volkswagen/interface.py b/selfdrive/car/volkswagen/interface.py index 32d04a45de55750..1e60c67a9fb5e69 100644 --- a/selfdrive/car/volkswagen/interface.py +++ b/selfdrive/car/volkswagen/interface.py @@ -37,10 +37,7 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): else: ret.transmissionType = TransmissionType.manual - if any(msg in fingerprint[1] for msg in (0x1A0, 0xC2)): # Bremse_1, Lenkwinkel_1 - ret.networkLocation = NetworkLocation.gateway - else: - ret.networkLocation = NetworkLocation.fwdCamera + ret.networkLocation = NetworkLocation.gateway # The PQ port is in dashcam-only mode due to a fixed six-minute maximum timer on HCA steering. An unsupported # EPS flash update to work around this timer, and enable steering down to zero, is available from: @@ -48,7 +45,7 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): # It is documented in a four-part blog series: # https://blog.willemmelching.nl/carhacking/2022/01/02/vw-part1/ # Panda ALLOW_DEBUG firmware required. - ret.dashcamOnly = True + ret.dashcamOnly = False else: # Set global MQB parameters @@ -128,7 +125,7 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): elif candidate == CAR.PASSAT_NMS: ret.mass = 1503 - ret.wheelbase = 2.80 + ret.wheelbase = 2.62 ret.minEnableSpeed = 20 * CV.KPH_TO_MS # ACC "basic", no FtS ret.minSteerSpeed = 50 * CV.KPH_TO_MS ret.steerActuatorDelay = 0.2 diff --git a/selfdrive/car/volkswagen/pqcan.py b/selfdrive/car/volkswagen/pqcan.py index f42c3cf781c733c..7623b5569695a97 100644 --- a/selfdrive/car/volkswagen/pqcan.py +++ b/selfdrive/car/volkswagen/pqcan.py @@ -2,7 +2,7 @@ def create_steering_control(packer, bus, apply_steer, lkas_enabled): values = { "LM_Offset": abs(apply_steer), "LM_OffSign": 1 if apply_steer < 0 else 0, - "HCA_Status": 5 if (lkas_enabled and apply_steer != 0) else 3, + "HCA_Status": 7 if (lkas_enabled and apply_steer != 0) else 3, "Vib_Freq": 16, }