From 81fbb8adce622c79f95baa31946330b2a99b1f03 Mon Sep 17 00:00:00 2001 From: MVL Date: Thu, 8 Jan 2026 20:11:50 -0500 Subject: [PATCH] allow 10 seconds for startup cruisefaults to clear --- opendbc/car/honda/carstate.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/opendbc/car/honda/carstate.py b/opendbc/car/honda/carstate.py index 334491968fe..69539d456a4 100644 --- a/opendbc/car/honda/carstate.py +++ b/opendbc/car/honda/carstate.py @@ -2,7 +2,7 @@ from collections import defaultdict from opendbc.can import CANDefine, CANParser -from opendbc.car import Bus, create_button_events, structs +from opendbc.car import Bus, create_button_events, structs, DT_CTRL from opendbc.car.common.conversions import Conversions as CV from opendbc.car.honda.hondacan import CanBus from opendbc.car.honda.values import CAR, DBC, STEER_THRESHOLD, HONDA_BOSCH, HONDA_BOSCH_ALT_RADAR, HONDA_BOSCH_CANFD, \ @@ -49,6 +49,9 @@ def __init__(self, CP): # However, on cars without a digital speedometer this is not always present (HRV, FIT, CRV 2016, ILX and RDX) self.dash_speed_seen = False + self.initial_accFault_cleared = False + self.initial_accFault_cleared_timer = int(10 / DT_CTRL) # 10 seconds after startup for initial faults to clear + def update(self, can_parsers) -> structs.CarState: cp = can_parsers[Bus.pt] cp_cam = can_parsers[Bus.cam] @@ -187,6 +190,18 @@ def update(self, can_parsers) -> structs.CarState: ret.cruiseState.enabled = cp.vl["POWERTRAIN_DATA"]["ACC_STATUS"] != 0 ret.cruiseState.available = bool(cp.vl[self.car_state_scm_msg]["MAIN_ON"]) + # Bosch cars take a few minutes after startup to clear prior faults + if ret.accFaulted: + if (self.CP.carFingerprint in HONDA_BOSCH) and not self.initial_accFault_cleared: + # block via cruiseState since accFaulted is not reversible until offroad + ret.accFaulted = False + ret.cruiseState.available = False + elif self.initial_accFault_cleared_timer == 0: + self.initial_accFault_cleared = True + + if self.initial_accFault_cleared_timer > 0: + self.initial_accFault_cleared_timer -= 1 + # Gets rid of Pedal Grinding noise when brake is pressed at slow speeds for some models if self.CP.carFingerprint in (CAR.HONDA_PILOT, CAR.HONDA_RIDGELINE): if ret.brake > 0.1: