diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index 4c8cc1ebac..69ce3080e7 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -10,7 +10,7 @@ from selfdrive.car.honda.values import CAR, DBC, STEER_THRESHOLD, SPEED_FACTOR, TransmissionType = car.CarParams.TransmissionType -def get_can_signals(CP, gearbox_msg="GEARBOX"): +def get_can_signals(CP, gearbox_msg): # this function generates lists for signal, messages and initial values signals = [ ("XMISSION_SPEED", "ENGINE_DATA", 0), @@ -78,13 +78,11 @@ def get_can_signals(CP, gearbox_msg="GEARBOX"): if CP.carFingerprint in HONDA_BOSCH: signals += [ - ("CAR_GAS", "GAS_PEDAL_2", 0), ("MAIN_ON", "SCM_FEEDBACK", 0), ("EPB_STATE", "EPB_STATUS", 0), ] checks += [ ("EPB_STATUS", 50), - ("GAS_PEDAL_2", 100), ] if not CP.openpilotLongitudinalControl: @@ -126,43 +124,22 @@ def get_can_signals(CP, gearbox_msg="GEARBOX"): ] if CP.carFingerprint == CAR.CIVIC: - signals += [("CAR_GAS", "GAS_PEDAL_2", 0), - ("MAIN_ON", "SCM_FEEDBACK", 0), + signals += [("MAIN_ON", "SCM_FEEDBACK", 0), ("IMPERIAL_UNIT", "HUD_SETTING", 0), ("EPB_STATE", "EPB_STATUS", 0)] checks += [ ("HUD_SETTING", 50), ("EPB_STATUS", 50), - ("GAS_PEDAL_2", 100), - ] - elif CP.carFingerprint == CAR.ACURA_ILX: - signals += [("CAR_GAS", "GAS_PEDAL_2", 0), - ("MAIN_ON", "SCM_BUTTONS", 0)] - checks += [ - ("GAS_PEDAL_2", 100), ] - elif CP.carFingerprint in (CAR.CRV, CAR.CRV_EU, CAR.ACURA_RDX, CAR.PILOT_2019, CAR.RIDGELINE): + elif CP.carFingerprint in (CAR.ACURA_ILX, CAR.CRV, CAR.CRV_EU, CAR.ACURA_RDX, CAR.PILOT, CAR.PILOT_2019, CAR.RIDGELINE): signals += [("MAIN_ON", "SCM_BUTTONS", 0)] - elif CP.carFingerprint == CAR.FIT: - signals += [("CAR_GAS", "GAS_PEDAL_2", 0), - ("MAIN_ON", "SCM_BUTTONS", 0), - ("BRAKE_HOLD_ACTIVE", "VSA_STATUS", 0)] - checks += [ - ("GAS_PEDAL_2", 100), - ] - elif CP.carFingerprint == CAR.HRV: + elif CP.carFingerprint in (CAR.FIT, CAR.HRV): signals += [("MAIN_ON", "SCM_BUTTONS", 0), ("BRAKE_HOLD_ACTIVE", "VSA_STATUS", 0)] elif CP.carFingerprint == CAR.ODYSSEY: signals += [("MAIN_ON", "SCM_FEEDBACK", 0), ("EPB_STATE", "EPB_STATUS", 0)] checks += [("EPB_STATUS", 50)] - elif CP.carFingerprint == CAR.PILOT: - signals += [("MAIN_ON", "SCM_BUTTONS", 0), - ("CAR_GAS", "GAS_PEDAL_2", 0)] - checks += [ - ("GAS_PEDAL_2", 0), # TODO: fix this freq, seems this signal isn't present at all on some models - ] elif CP.carFingerprint == CAR.ODYSSEY_CHN: signals += [("MAIN_ON", "SCM_BUTTONS", 0), ("EPB_STATE", "EPB_STATUS", 0)] @@ -277,20 +254,15 @@ class CarState(CarStateBase): gear = int(cp.vl[self.gearbox_msg]["GEAR_SHIFTER"]) ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(gear, None)) - pedal_gas = cp.vl["POWERTRAIN_DATA"]["PEDAL_GAS"] - # crv doesn't include cruise control - if self.CP.carFingerprint in (CAR.CRV, CAR.CRV_EU, CAR.HRV, CAR.ODYSSEY, CAR.ACURA_RDX, CAR.RIDGELINE, CAR.PILOT_2019, CAR.ODYSSEY_CHN): - ret.gas = pedal_gas / 256. - else: - ret.gas = cp.vl["GAS_PEDAL_2"]["CAR_GAS"] / 256. + ret.gas = cp.vl["POWERTRAIN_DATA"]["PEDAL_GAS"] # this is a hack for the interceptor. This is now only used in the simulation # TODO: Replace tests by toyota so this can go away if self.CP.enableGasInterceptor: user_gas = (cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2. - ret.gasPressed = user_gas > 1e-5 # this works because interceptor read < 0 when pedal position is 0. Once calibrated, this will change + ret.gasPressed = user_gas > 1e-5 # this works because interceptor reads < 0 when pedal position is 0. Once calibrated, this will change else: - ret.gasPressed = pedal_gas > 1e-5 + ret.gasPressed = ret.gas > 1e-5 ret.steeringTorque = cp.vl["STEER_STATUS"]["STEER_TORQUE_SENSOR"] ret.steeringTorqueEps = cp.vl["STEER_MOTOR_TORQUE"]["MOTOR_TORQUE"] diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index c77d97e8b4..7009ebee3f 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -68db6ee0d2afb80b0d271788b3028de6db2da45e \ No newline at end of file +b631f006877b2576163e66435d800fc0a565189f \ No newline at end of file