Skip to content

Commit

Permalink
try something else
Browse files Browse the repository at this point in the history
  • Loading branch information
sshane committed Oct 9, 2024
1 parent 946cf4c commit 71854a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions opendbc/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ def update(self, CC, CS, now_nanos):
self.pcm_accel_compensation = rate_limit(pcm_accel_compensation, self.pcm_accel_compensation, -0.01, 0.01)
pcm_accel_cmd = actuators.accel - self.pcm_accel_compensation

# prevent request from deviating too far from current pcm accel net
pcm_accel_cmd = max(pcm_accel_cmd, CS.pcm_accel_net - 0.5)

# Along with rate limiting positive jerk below, this greatly improves gas response time
# Consider the net acceleration request that the PCM should be applying (pitch included)
if net_acceleration_request < 0.1:
Expand Down
7 changes: 4 additions & 3 deletions opendbc/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ def update(self, cp, cp_cam, *_) -> structs.CarState:
if cp.vl["PCM_CRUISE"]["ACC_BRAKING"]:
self.pcm_accel_net += min(cp.vl["PCM_CRUISE"]["ACCEL_NET"], 0.0)

# this 0.8x seems consistent with the pitch compensated accel net, TODO: figure out what this is
if cp.vl["VSC1S29"]["ICBACT"]:
self.pcm_accel_net *= 0.8
# # this 0.8x seems consistent with the pitch compensated accel net, TODO: figure out what this is
# TODO: no it doesn't, is it request rate based?
# if cp.vl["VSC1S29"]["ICBACT"]:
# self.pcm_accel_net *= 0.8

# add creeping force at low speeds only for braking, CLUTCH->ACCEL_NET already shows this
# TODO: with ICBACT maybe we can always add neutral force for engine braking at high speed now!
Expand Down

0 comments on commit 71854a3

Please sign in to comment.