VAG PQ Steering Patch - init

This commit is contained in:
Rick Lan
2025-05-12 15:10:00 +08:00
parent 87972fb990
commit 49c5184e73
10 changed files with 20 additions and 4 deletions

View File

@@ -140,4 +140,5 @@ inline static std::unordered_map<std::string, uint32_t> keys = {
{"dp_lon_no_gas_gating", PERSISTENT},
{"dp_device_auto_shutdown_in", PERSISTENT},
{"dp_ui_radar_tracks", PERSISTENT},
{"dp_vag_pq_steering_patch", PERSISTENT},
};

View File

@@ -22,4 +22,5 @@ CarParamsT = capnp.lib.capnp._StructModule
class DPFlags:
LateralALKA = 1
ExtRadar = 2
VAGPQSteeringPatch = 2 ** 2
pass

View File

@@ -24,6 +24,7 @@ class CarController(CarControllerBase):
self.eps_timer_soft_disable_alert = False
self.hca_frame_timer_running = 0
self.hca_frame_same_torque = 0
self.dp_vag_pq_steering_patch = 7 if CP.flags & VolkswagenFlags.PQSteeringPatch else 5
def update(self, CC, CS, now_nanos):
actuators = CC.actuators
@@ -63,7 +64,7 @@ class CarController(CarControllerBase):
self.eps_timer_soft_disable_alert = self.hca_frame_timer_running > self.CCP.STEER_TIME_ALERT / DT_CTRL
self.apply_torque_last = apply_torque
can_sends.append(self.CCS.create_steering_control(self.packer_pt, CANBUS.pt, apply_torque, hca_enabled))
can_sends.append(self.CCS.create_steering_control(self.packer_pt, CANBUS.pt, apply_torque, hca_enabled, self.dp_vag_pq_steering_patch))
if self.CP.flags & VolkswagenFlags.STOCK_HCA_PRESENT:
# Pacify VW Emergency Assist driver inactivity detection by changing its view of driver steering input torque

View File

@@ -87,4 +87,7 @@ class CarInterface(CarInterfaceBase):
ret.vEgoStopping = 0.5
ret.autoResumeSng = ret.minEnableSpeed == -1
if ret.flags & VolkswagenFlags.PQ and dp_params & structs.DPFlags.VAGPQSteeringPatch:
ret.flags |= VolkswagenFlags.PQSteeringPatch.value
return ret

View File

@@ -1,4 +1,4 @@
def create_steering_control(packer, bus, apply_torque, lkas_enabled):
def create_steering_control(packer, bus, apply_torque, lkas_enabled, dp_vag_pq_steering_patch):
values = {
"HCA_01_Status_HCA": 5 if lkas_enabled else 3,
"HCA_01_LM_Offset": abs(apply_torque),

View File

@@ -1,8 +1,8 @@
def create_steering_control(packer, bus, apply_torque, lkas_enabled):
def create_steering_control(packer, bus, apply_torque, lkas_enabled, dp_vag_pq_steering_patch = 5):
values = {
"LM_Offset": abs(apply_torque),
"LM_OffSign": 1 if apply_torque < 0 else 0,
"HCA_Status": 5 if (lkas_enabled and apply_torque != 0) else 3,
"HCA_Status": dp_vag_pq_steering_patch if (lkas_enabled and apply_torque != 0) else 3,
"Vib_Freq": 16,
}

View File

@@ -144,6 +144,7 @@ class VolkswagenFlags(IntFlag):
# Static flags
PQ = 2
PQSteeringPatch = 2 ** 2
@dataclass
class VolkswagenMQBPlatformConfig(PlatformConfig):

View File

@@ -102,6 +102,9 @@ class Car:
if self.params.get_bool("dp_lat_alka"):
dp_params |= structs.DPFlags.LateralALKA
if self.params.get_bool("dp_vag_pq_steering_patch"):
dp_params |= structs.DPFlags.VAGPQSteeringPatch
self.CI = get_car(*self.can_callbacks, obd_callback(self.params), experimental_long_allowed, num_pandas, dp_params, cached_params)
self.RI = interfaces[self.CI.CP.carFingerprint].RadarInterface(self.CI.CP)
self.CP = self.CI.CP

View File

@@ -40,6 +40,11 @@ void DPPanel::add_vag_toggles() {
QString::fromUtf8("🐉 ") + tr("VW / Audi / Skoda"),
"",
},
{
"dp_vag_pq_steering_patch",
tr("PQ Steering Patch"),
""
},
};
QWidget *label = nullptr;

View File

@@ -62,6 +62,7 @@ def manager_init() -> None:
("dp_lon_no_gas_gating", "0"),
("dp_device_auto_shutdown_in", "-5"),
("dp_ui_radar_tracks", "0"),
("dp_vag_pq_steering_patch", "0"),
]
if params.get_bool("RecordFrontLock"):