Skip to content

Commit

Permalink
golf varient haxs (ACC equipped)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkiiv authored and Comma Device committed Feb 3, 2024
1 parent f103838 commit 38834e9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 2 additions & 0 deletions launch_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion opendbc/vw_golf_mk4.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -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" ;
Expand Down
2 changes: 1 addition & 1 deletion panda/board/safety/safety_volkswagen_pq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 3 additions & 6 deletions selfdrive/car/volkswagen/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,15 @@ 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:
# https://github.com/pd0wm/pq-flasher
# 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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/volkswagen/pqcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit 38834e9

Please sign in to comment.