Skip to content

Commit

Permalink
Hmm, clutch matches while braking, but still doesn't capture forces n…
Browse files Browse the repository at this point in the history
…ear a stop well
  • Loading branch information
sshane committed Oct 18, 2024
1 parent 9a206ed commit c001a5c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions opendbc/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def update(self, cp, cp_cam, *_) -> structs.CarState:
# CLUTCH->ACCEL_NET is only accurate for gas, PCM_CRUISE->ACCEL_NET is only accurate for brake
# These signals only have meaning when ACC is active
if self.CP.flags & ToyotaFlags.RAISED_ACCEL_LIMIT:
self.pcm_accel_net = max(cp.vl["CLUTCH"]["ACCEL_NET"], 0.0)
self.pcm_accel_net = cp.vl["CLUTCH"]["ACCEL_NET"]

# Sometimes ACC_BRAKING can be 1 while showing we're applying gas already
if cp.vl["PCM_CRUISE"]["ACC_BRAKING"]:
self.pcm_accel_net += min(cp.vl["PCM_CRUISE"]["ACCEL_NET"], 0.0)
# # Sometimes ACC_BRAKING can be 1 while showing we're applying gas already
# if cp.vl["PCM_CRUISE"]["ACC_BRAKING"]:
# self.pcm_accel_net += min(cp.vl["PCM_CRUISE"]["ACCEL_NET"], 0.0)

# add creeping force at low speeds only for braking, CLUTCH->ACCEL_NET already shows this
neutral_accel = max(cp.vl["PCM_CRUISE"]["NEUTRAL_FORCE"] / self.CP.mass, 0.0)
Expand Down

0 comments on commit c001a5c

Please sign in to comment.