VAG Avoid EPS Lockout - 2025/05/17

This commit is contained in:
Rick Lan
2025-05-12 15:13:25 +08:00
parent 87972fb990
commit e99675400e
9 changed files with 23 additions and 4 deletions
+1
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_avoid_eps_lockout", PERSISTENT},
};
+1
View File
@@ -22,4 +22,5 @@ CarParamsT = capnp.lib.capnp._StructModule
class DPFlags:
LateralALKA = 1
ExtRadar = 2
VagAvoidEPSLockout = 2 ** 2
pass
@@ -13,7 +13,7 @@ LongCtrlState = structs.CarControl.Actuators.LongControlState
class CarController(CarControllerBase):
def __init__(self, dbc_names, CP):
super().__init__(dbc_names, CP)
self.CCP = CarControllerParams(CP)
self.CCP = CarControllerParams(CP, CP.flags & VolkswagenFlags.AVOID_EPS_LOCKOUT)
self.CCS = pqcan if CP.flags & VolkswagenFlags.PQ else mqbcan
self.packer_pt = CANPacker(dbc_names[Bus.pt])
self.ext_bus = CANBUS.pt if CP.networkLocation == structs.CarParams.NetworkLocation.fwdCamera else CANBUS.cam
@@ -87,4 +87,7 @@ class CarInterface(CarInterfaceBase):
ret.vEgoStopping = 0.5
ret.autoResumeSng = ret.minEnableSpeed == -1
if dp_params & structs.DPFlags.VagAvoidEPSLockout:
ret.flags |= VolkswagenFlags.AVOID_EPS_LOCKOUT.value
return ret
@@ -27,7 +27,8 @@ class CarControllerParams:
# MQB vs PQ maximums are shared, but rate-of-change limited differently
# based on safety requirements driven by lateral accel testing.
STEER_MAX = 300 # Max heading control assist torque 3.00 Nm
# rick - move to init so we can overwrite it with avoid eps lockout
# STEER_MAX = 300 # Max heading control assist torque 3.00 Nm
STEER_DRIVER_MULTIPLIER = 3 # weight driver torque heavily
STEER_DRIVER_FACTOR = 1 # from dbc
@@ -40,8 +41,9 @@ class CarControllerParams:
ACCEL_MAX = 2.0 # 2.0 m/s max acceleration
ACCEL_MIN = -3.5 # 3.5 m/s max deceleration
def __init__(self, CP):
def __init__(self, CP, avoid_eps_lockout = False):
can_define = CANDefine(DBC[CP.carFingerprint][Bus.pt])
self.STEER_MAX = 300 if not avoid_eps_lockout else 288
if CP.flags & VolkswagenFlags.PQ:
self.LDW_STEP = 5 # LDW_1 message frequency 20Hz
@@ -144,6 +146,8 @@ class VolkswagenFlags(IntFlag):
# Static flags
PQ = 2
AVOID_EPS_LOCKOUT = 2 ** 2
@dataclass
class VolkswagenMQBPlatformConfig(PlatformConfig):
+3
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_avoid_eps_lockout"):
dp_params |= structs.DPFlags.VagAvoidEPSLockout
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
+2 -1
View File
@@ -2,8 +2,9 @@ import numpy as np
from abc import abstractmethod, ABC
from openpilot.common.realtime import DT_CTRL
from openpilot.common.params import Params
MIN_LATERAL_CONTROL_SPEED = 0.3 # m/s
MIN_LATERAL_CONTROL_SPEED = 2.5 if Params().get_bool("dp_vag_avoid_eps_lockout") else 0.3 # m/s
class LatControl(ABC):
+5
View File
@@ -40,6 +40,11 @@ void DPPanel::add_vag_toggles() {
QString::fromUtf8("🐉 ") + tr("VW / Audi / Skoda"),
"",
},
{
"dp_vag_avoid_eps_lockout",
tr("Avoid EPS Lockout"),
"",
},
};
QWidget *label = nullptr;
+1
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_avoid_eps_lockout", "0"),
]
if params.get_bool("RecordFrontLock"):