From 0da55d93aedc290e6dc2a9d9ad3f4090aeaaa325 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Mon, 23 Nov 2026 17:01:30 -0600 Subject: [PATCH] Ramp Honda Fit steering torque after EPS pauses --- opendbc_repo/opendbc/car/honda/carcontroller.py | 6 +++++- opendbc_repo/opendbc/car/honda/carstate.py | 5 +++++ prebuilt.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/opendbc_repo/opendbc/car/honda/carcontroller.py b/opendbc_repo/opendbc/car/honda/carcontroller.py index 3dd58b86c3..64bc8dc9ac 100644 --- a/opendbc_repo/opendbc/car/honda/carcontroller.py +++ b/opendbc_repo/opendbc/car/honda/carcontroller.py @@ -146,6 +146,10 @@ class CarController(CarControllerBase): self.params.STEER_DELTA_UP * DT_CTRL) _projection_previous = self.last_torque if _projection is not None else 0. self.last_torque = limited_torque + if self.CP.carFingerprint == CAR.HONDA_FIT and CS.out.canValid and not CS.out.canTimeout: + observed, expires = CS.eps_inactive_window + if 0 < observed <= now_nanos < expires: + self.last_torque = 0.0 # *** apply brake hysteresis *** pre_limit_brake, self.braking, self.brake_steady = actuator_hysteresis(brake, self.braking, self.brake_steady) @@ -284,7 +288,7 @@ class CarController(CarControllerBase): new_actuators.accel = self.accel new_actuators.gas = self.gas new_actuators.brake = self.brake - new_actuators.torque = self.last_torque + new_actuators.torque = limited_torque new_actuators.torqueOutputCan = apply_torque self.frame += 1 diff --git a/opendbc_repo/opendbc/car/honda/carstate.py b/opendbc_repo/opendbc/car/honda/carstate.py index a3b2adbccc..1596885224 100644 --- a/opendbc_repo/opendbc/car/honda/carstate.py +++ b/opendbc_repo/opendbc/car/honda/carstate.py @@ -39,6 +39,8 @@ class CarState(CarStateBase): self.steer_status_values = defaultdict(lambda: "UNKNOWN", can_define.dv["STEER_STATUS"]["STEER_STATUS"]) + self.eps_inactive_window = (0, 0) + self.brake_switch_prev = False self.brake_switch_active = False self.low_speed_alert = False @@ -104,6 +106,9 @@ class CarState(CarStateBase): ret.seatbeltUnlatched = bool(cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LAMP"] or not cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LATCHED"]) steer_status = self.steer_status_values[cp.vl["STEER_STATUS"]["STEER_STATUS"]] + if self.CP.carFingerprint == CAR.HONDA_FIT: + self.eps_inactive_window = (parser_expiry(cp, "STEER_STATUS", "STEER_CONTROL_ACTIVE") + if not cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"] else (0, 0)) ret.steerFaultPermanent = steer_status not in ("NORMAL", "NO_TORQUE_ALERT_1", "NO_TORQUE_ALERT_2", "LOW_SPEED_LOCKOUT", "TMP_FAULT") if self.CP.flags & HondaFlags.BOSCH_ALT_RADAR: # TODO: See if this logic works for all other Honda diff --git a/prebuilt.json b/prebuilt.json index 74fa971c18..9c35a26e6c 100644 --- a/prebuilt.json +++ b/prebuilt.json @@ -1 +1 @@ -{"protected_inventory_sha256": "3e4859b63d8b1a6300a7caa99d5329925152c9098f4157f4e93ea4e1d00ca019", "schema_version": 1} +{"protected_inventory_sha256": "67a2f12c7f0d4997461cde13e0908a0cc565bdeace0729bada60f3e89d088a99", "schema_version": 1}