Skip to content

Commit

Permalink
allow tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
eFiniLan committed Jul 19, 2024
1 parent 1b33136 commit 2f75640
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
6 changes: 5 additions & 1 deletion selfdrive/car/toyota/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):

tune = ret.longitudinalTuning
# dp
if Params().get_bool("dp_toyota_pcm_compensation"):
try:
dp_toyota_pcm_compensation = Params().get_bool("dp_toyota_pcm_compensation")
except:
dp_toyota_pcm_compensation = False
if dp_toyota_pcm_compensation:
# on stock Toyota this is -2.5
if candidate in TSS2_CAR:
ret.stopAccel = -1.2
Expand Down
11 changes: 9 additions & 2 deletions selfdrive/car/volkswagen/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ def __init__(self, dbc_name, CP, VM):

# dp
params = Params()
self.dp_vag_sng = params.get_bool("dp_vag_sng")
self.dp_vag_pq_steering_patch = Params().get_bool("dp_vag_pq_steering_patch")
try:
self.dp_vag_sng = params.get_bool("dp_vag_sng")
except:
self.dp_vag_sng = False
# this is not used in MQB, only PQ, checking status is 7 instead of 5
try:
self.dp_vag_pq_steering_patch = 7 if Params().get_bool("dp_vag_pq_steering_patch") else 5
except:
self.dp_vag_pq_steering_patch = 5

def update(self, CC, CS, now_nanos):
actuators = CC.actuators
Expand Down
6 changes: 5 additions & 1 deletion selfdrive/car/volkswagen/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def _get_params(ret, candidate: CAR, fingerprint, car_fw, experimental_long, doc
# ret.dashcamOnly = False

# dp - For modified PQ steering
if Params().get_bool("dp_vag_pq_steering_patch"):
try:
dp_vag_pq_steering_patch = Params().get_bool("dp_vag_pq_steering_patch")
except:
dp_vag_pq_steering_patch = False
if dp_vag_pq_steering_patch:
ret.networkLocation = NetworkLocation.gateway
# patched steering should allow steer to 0.
ret.minSteerSpeed = 0.
Expand Down
12 changes: 2 additions & 10 deletions selfdrive/car/volkswagen/pqcan.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
def create_steering_control(packer, bus, apply_steer, lkas_enabled, dp_vag_pq_steering_patch=False):
# dp
if dp_vag_pq_steering_patch:
hca_status = 7 if (lkas_enabled and apply_steer != 0) else 3,
else:
# stock value
hca_status = 5 if (lkas_enabled and apply_steer != 0) else 3,
def create_steering_control(packer, bus, apply_steer, lkas_enabled, dp_vag_pq_steering_patch):
values = {
"LM_Offset": abs(apply_steer),
"LM_OffSign": 1 if apply_steer < 0 else 0,
# dp - for use var above
# "HCA_Status": 5 if (lkas_enabled and apply_steer != 0) else 3,
"HCA_Status": hca_status,
"HCA_Status": dp_vag_pq_steering_patch if (lkas_enabled and apply_steer != 0) else 3,
"Vib_Freq": 16,
}

Expand Down

0 comments on commit 2f75640

Please sign in to comment.