Skip to content

Commit

Permalink
Merge commit 'b9daff809a5b8efdb7d9b69dff27235fbf5cef58'
Browse files Browse the repository at this point in the history
# Conflicts:
#	opendbc/car/toyota/interface.py
  • Loading branch information
ikawaoka committed Dec 6, 2024
2 parents e6303b9 + b9daff8 commit 11a3bf3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
workflow_dispatch:

env:
DAYS_BEFORE_PR_CLOSE: 2
DAYS_BEFORE_PR_STALE: 9
DAYS_BEFORE_PR_CLOSE: 7
DAYS_BEFORE_PR_STALE: 60

jobs:
stale:
Expand Down
1 change: 1 addition & 0 deletions opendbc/car/hyundai/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@
b'\xf1\x00OS MDPS C 1.00 1.04 56310/K4550 4OEDC104',
b'\xf1\x00OS MDPS C 1.00 1.04 56310K4000\x00 4OEDC104',
b'\xf1\x00OS MDPS C 1.00 1.04 56310K4050\x00 4OEDC104',
b'\xf1\x00OS MDPS C 1.00 1.05 56310K4000\x00 4OEDC105',
],
(Ecu.fwdRadar, 0x7d0, None): [
b'\xf1\x00OSev SCC F-CUP 1.00 1.00 99110-K4000 ',
Expand Down
6 changes: 3 additions & 3 deletions opendbc/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# The up limit allows the brakes/gas to unwind quickly leaving a stop,
# the down limit roughly matches the rate of ACCEL_NET, reducing PCM compensation windup
ACCEL_WINDUP_LIMIT = 6.0 * DT_CTRL * 3 # m/s^2 / frame
ACCEL_WINDUP_LIMIT = 4.0 * DT_CTRL * 3 # m/s^2 / frame
ACCEL_WINDDOWN_LIMIT = -4.0 * DT_CTRL * 3 # m/s^2 / frame

# LKA limits
Expand Down Expand Up @@ -360,9 +360,9 @@ def update(self, CC, CS, now_nanos):
# Along with rate limiting positive jerk above, this greatly improves gas response time
# Consider the net acceleration request that the PCM should be applying (pitch included)
net_acceleration_request_min = min(actuators.accel + accel_due_to_pitch, net_acceleration_request)
if net_acceleration_request_min < 0.1 or stopping or not CC.longActive:
if net_acceleration_request_min < 0.2 or stopping or not CC.longActive:
self.permit_braking = True
elif net_acceleration_request_min > 0.2:
elif net_acceleration_request_min > 0.3:
self.permit_braking = False

pcm_accel_cmd = clip(pcm_accel_cmd, self.params.ACCEL_MIN, self.params.ACCEL_MAX)
Expand Down
12 changes: 8 additions & 4 deletions opendbc/car/toyota/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
ret.enableDsu = len(found_ecus) > 0 and Ecu.dsu not in found_ecus and candidate not in (NO_DSU_CAR | UNSUPPORTED_DSU_CAR) \
and not (ret.flags & ToyotaFlags.SMART_DSU) and not (ret.flags & ToyotaFlags.DSU_BYPASS.value)

if Params().get_bool("AccelMethodSwitch") == True: # and candidate in (CAR.LEXUS_ES_TSS2,) and Ecu.hybrid not in found_ecus:
if Ecu.hybrid in found_ecus:
ret.flags |= ToyotaFlags.HYBRID.value

if Params().get_bool("AccelMethodSwitch") == True: # and candidate in (CAR.LEXUS_ES_TSS2,) and not (ret.flags & ToyotaFlags.HYBRID.value):
ret.flags |= ToyotaFlags.RAISED_ACCEL_LIMIT.value

if candidate == CAR.TOYOTA_PRIUS:
Expand Down Expand Up @@ -154,9 +157,6 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
if not ret.openpilotLongitudinalControl:
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_TOYOTA_STOCK_LONGITUDINAL

if Ecu.hybrid in found_ecus: #ハイブリッド判定法
ret.flags |= ToyotaFlags.HYBRID.value

# min speed to enable ACC. if car can do stop and go, then set enabling speed
# to a negative value, so it won't matter.
ret.minEnableSpeed = -1. if stop_and_go else MIN_ACC_SPEED
Expand All @@ -170,6 +170,10 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
ret.vEgoStarting = 0.25
ret.stoppingDecelRate = 0.3 # reach stopping target smoothly

# Hybrids have much quicker longitudinal actuator response
if ret.flags & ToyotaFlags.HYBRID.value:
ret.longitudinalActuatorDelay = 0.05

return ret

@staticmethod
Expand Down

0 comments on commit 11a3bf3

Please sign in to comment.