Skip to content

Commit

Permalink
golf 6 kombi haxs (ACC equipped) (#53)
Browse files Browse the repository at this point in the history
* golf varient haxs (ACC equipped) (#50)

* golf varient haxs (ACC equipped) (#49)

* golf varient haxs (ACC equipped)

* re-enable UDS FW query on ign

* remove min steer speed, oops

* omit accFault check until radar is fixed

* omit ret.minEnableSpeed for PASSAT_NMS
  • Loading branch information
dkiiv committed Apr 11, 2024
1 parent 1fa291d commit a02b022
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
1 change: 1 addition & 0 deletions launch_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1
export FINGERPRINT="VOLKSWAGEN PASSAT NMS"

if [ -z "$AGNOS_VERSION" ]; then
export AGNOS_VERSION="9.7"
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 @@ -1627,7 +1627,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 @@ -193,7 +193,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
4 changes: 0 additions & 4 deletions selfdrive/car/volkswagen/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ def update_pq(self, pt_cp, cam_cp, ext_cp, trans_type, frogpilot_variables):
self.acc_type = ext_cp.vl["ACC_System"]["ACS_Typ_ACC"]
ret.cruiseState.available = bool(pt_cp.vl["Motor_5"]["GRA_Hauptschalter"])
ret.cruiseState.enabled = pt_cp.vl["Motor_2"]["GRA_Status"] in (1, 2)
if self.CP.pcmCruise:
ret.accFaulted = ext_cp.vl["ACC_GRA_Anzeige"]["ACA_StaACC"] in (6, 7)
else:
ret.accFaulted = pt_cp.vl["Motor_2"]["GRA_Status"] == 3

# Update ACC setpoint. When the setpoint reads as 255, the driver has not
# yet established an ACC setpoint, so treat it as zero.
Expand Down
12 changes: 4 additions & 8 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, params, candidate, fingerprint, car_fw, experimental_long,
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,9 +125,8 @@ def _get_params(ret, params, candidate, fingerprint, car_fw, experimental_long,

elif candidate == CAR.PASSAT_NMS:
ret.mass = 1503
ret.wheelbase = 2.80
ret.minEnableSpeed = 20 * CV.KPH_TO_MS # ACC "basic", no FtS
ret.minSteerSpeed = 50 * CV.KPH_TO_MS
ret.wheelbase = 2.62
#ret.minEnableSpeed = 20 * CV.KPH_TO_MS # ACC "basic", no FtS
ret.steerActuatorDelay = 0.2
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)

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 a02b022

Please sign in to comment.