更新 selfdrive/car/honda/carstate.py

This commit is contained in:
mawei 2024-06-19 10:09:21 +08:00
parent 34654a7409
commit 7887a156cb
1 changed files with 13 additions and 13 deletions

View File

@ -42,7 +42,7 @@ def get_can_messages(CP, gearbox_msg):
if CP.carFingerprint in (CAR.CRV_HYBRID, CAR.CIVIC_BOSCH_DIESEL, CAR.ACURA_RDX_3G, CAR.HONDA_E):
messages.append((gearbox_msg, 50))
else:
messages.append((gearbox_msg, 100))
pass#messages.append((gearbox_msg, 100))
if CP.carFingerprint in HONDA_BOSCH_ALT_BRAKE_SIGNAL:
messages.append(("BRAKE_MODULE", 50))
@ -58,10 +58,10 @@ def get_can_messages(CP, gearbox_msg):
("ACC_CONTROL", 50),
]
else: # Nidec signals
if CP.carFingerprint == CAR.ODYSSEY_CHN:
messages.append(("CRUISE_PARAMS", 10))
else:
messages.append(("CRUISE_PARAMS", 50))
pass#if CP.carFingerprint == CAR.ODYSSEY_CHN:
#messages.append(("CRUISE_PARAMS", 10))
#else:
#messages.append(("CRUISE_PARAMS", 50))
# TODO: clean this up
if CP.carFingerprint in (CAR.ACCORD, CAR.ACCORDH, CAR.CIVIC_BOSCH, CAR.CIVIC_BOSCH_DIESEL, CAR.CRV_HYBRID, CAR.INSIGHT,
@ -90,15 +90,15 @@ class CarState(CarStateBase):
def __init__(self, CP):
super().__init__(CP)
can_define = CANDefine(DBC[CP.carFingerprint]["pt"])
self.gearbox_msg = "GEARBOX"
if CP.carFingerprint == CAR.ACCORD and CP.transmissionType == TransmissionType.cvt:
self.gearbox_msg = "GEARBOX_15T"
#self.gearbox_msg = "GEARBOX"
#if CP.carFingerprint == CAR.ACCORD and CP.transmissionType == TransmissionType.cvt:
#self.gearbox_msg = "GEARBOX_15T"
self.main_on_sig_msg = "SCM_FEEDBACK"
if CP.carFingerprint in HONDA_NIDEC_ALT_SCM_MESSAGES:
self.main_on_sig_msg = "SCM_BUTTONS"
self.shifter_values = can_define.dv[self.gearbox_msg]["GEAR_SHIFTER"]
#self.shifter_values = can_define.dv[self.gearbox_msg]["GEAR_SHIFTER"]
self.steer_status_values = defaultdict(lambda: "UNKNOWN", can_define.dv["STEER_STATUS"]["STEER_STATUS"])
self.brake_switch_prev = False
@ -192,7 +192,7 @@ class CarState(CarStateBase):
if self.CP.carFingerprint in (HONDA_BOSCH | {CAR.CIVIC, CAR.ODYSSEY, CAR.ODYSSEY_CHN, CAR.CLARITY}):
ret.parkingBrake = cp.vl["EPB_STATUS"]["EPB_STATE"] != 0
gear = int(cp.vl[self.gearbox_msg]["GEAR_SHIFTER"])
#gear = int(cp.vl[self.gearbox_msg]["GEAR_SHIFTER"])
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(gear, None))
if self.CP.enableGasInterceptor:
@ -296,9 +296,9 @@ class CarState(CarStateBase):
return ret
def get_can_parser(self, CP):
messages = get_can_messages(CP, self.gearbox_msg)
return CANParser(DBC[CP.carFingerprint]["pt"], messages, get_pt_bus(CP.carFingerprint))
#def get_can_parser(self, CP):
#messages = get_can_messages(CP, self.gearbox_msg)
#return CANParser(DBC[CP.carFingerprint]["pt"], messages, get_pt_bus(CP.carFingerprint))
@staticmethod
def get_cam_can_parser(CP):