From c001a5caf75a9e7f5f19e2c36417febab27cba36 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 17 Oct 2024 20:02:50 -0700 Subject: [PATCH] Hmm, clutch matches while braking, but still doesn't capture forces near a stop well --- opendbc/car/toyota/carstate.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opendbc/car/toyota/carstate.py b/opendbc/car/toyota/carstate.py index 438ee088b8..0390706570 100644 --- a/opendbc/car/toyota/carstate.py +++ b/opendbc/car/toyota/carstate.py @@ -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)