mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-19 00:33:52 +08:00
Merge branch 'brand/vag/avoid-eps-lockout' into pre-vag
This commit is contained in:
@@ -142,4 +142,5 @@ inline static std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"dp_ui_radar_tracks", PERSISTENT},
|
||||
{"dp_vag_a0_sng", PERSISTENT},
|
||||
{"dp_vag_pq_steering_patch", PERSISTENT},
|
||||
{"dp_vag_avoid_eps_lockout", PERSISTENT},
|
||||
};
|
||||
|
||||
@@ -23,5 +23,6 @@ class DPFlags:
|
||||
LateralALKA = 1
|
||||
ExtRadar = 2
|
||||
VagA0SnG = 2 ** 2
|
||||
VAGPQSteeringPatch = 2 ** 2
|
||||
VAGPQSteeringPatch = 2 ** 3
|
||||
VagAvoidEPSLockout = 2 ** 4
|
||||
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
|
||||
|
||||
@@ -93,4 +93,7 @@ class CarInterface(CarInterfaceBase):
|
||||
if ret.flags & VolkswagenFlags.PQ and dp_params & structs.DPFlags.VAGPQSteeringPatch:
|
||||
ret.flags |= VolkswagenFlags.PQSteeringPatch.value
|
||||
|
||||
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
|
||||
@@ -146,6 +148,8 @@ class VolkswagenFlags(IntFlag):
|
||||
|
||||
A0SnG = 2 ** 2
|
||||
PQSteeringPatch = 2 ** 3
|
||||
AVOID_EPS_LOCKOUT = 2 ** 4
|
||||
|
||||
|
||||
@dataclass
|
||||
class VolkswagenMQBPlatformConfig(PlatformConfig):
|
||||
|
||||
@@ -108,6 +108,9 @@ class Car:
|
||||
if self.params.get_bool("dp_vag_pq_steering_patch"):
|
||||
dp_params |= structs.DPFlags.VAGPQSteeringPatch
|
||||
|
||||
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,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):
|
||||
|
||||
@@ -50,6 +50,11 @@ void DPPanel::add_vag_toggles() {
|
||||
tr("PQ Steering Patch"),
|
||||
""
|
||||
},
|
||||
{
|
||||
"dp_vag_avoid_eps_lockout",
|
||||
tr("Avoid EPS Lockout"),
|
||||
"",
|
||||
},
|
||||
};
|
||||
|
||||
QWidget *label = nullptr;
|
||||
|
||||
@@ -64,6 +64,7 @@ def manager_init() -> None:
|
||||
("dp_ui_radar_tracks", "0"),
|
||||
("dp_vag_a0_sng", "0"),
|
||||
("dp_vag_pq_steering_patch", "0"),
|
||||
("dp_vag_avoid_eps_lockout", "0"),
|
||||
]
|
||||
|
||||
if params.get_bool("RecordFrontLock"):
|
||||
|
||||
Reference in New Issue
Block a user