From e5086e246d4b30a3cd60a9e0440af1458d69d08b Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 23 Aug 2022 13:54:33 -0700 Subject: [PATCH] it's not really cruise/pcm, but acc remove improt --- selfdrive/car/tests/test_models.py | 1 - selfdrive/car/toyota/carstate.py | 8 ++++---- selfdrive/car/toyota/interface.py | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 03b4a115a8..a655f2fb3e 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -19,7 +19,6 @@ from selfdrive.car.tests.routes import non_tested_cars, routes, TestRoute from selfdrive.test.openpilotci import get_url from tools.lib.logreader import LogReader from tools.lib.route import Route -from selfdrive.car.toyota.values import TSS2_CAR from panda.tests.safety import libpandasafety_py from panda.tests.safety.common import package_can_msg diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index 41a7053259..843e7806dc 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -94,11 +94,11 @@ class CarState(CarStateBase): ret.cruiseState.available = cp.vl["PCM_CRUISE_2"]["MAIN_ON"] != 0 ret.cruiseState.speed = cp.vl["PCM_CRUISE_2"]["SET_SPEED"] * CV.KPH_TO_MS - cp_cruise = cp_cam if self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR) else cp + cp_acc = cp_cam if self.CP.carFingerprint in (TSS2_CAR - RADAR_ACC_CAR) else cp if self.CP.carFingerprint in (TSS2_CAR | RADAR_ACC_CAR): - self.acc_type = cp_cruise.vl["ACC_CONTROL"]["ACC_TYPE"] - ret.stockFcw = bool(cp_cruise.vl["ACC_HUD"]["FCW"]) + self.acc_type = cp_acc.vl["ACC_CONTROL"]["ACC_TYPE"] + ret.stockFcw = bool(cp_acc.vl["ACC_HUD"]["FCW"]) # some TSS2 cars have low speed lockout permanently set, so ignore on those cars # these cars are identified by an ACC_TYPE value of 2. @@ -122,7 +122,7 @@ class CarState(CarStateBase): ret.espDisabled = cp.vl["ESP_CONTROL"]["TC_DISABLED"] != 0 if not self.CP.enableDsu: - ret.stockAeb = bool(cp_cruise.vl["PRE_COLLISION"]["PRECOLLISION_ACTIVE"] and cp_cruise.vl["PRE_COLLISION"]["FORCE"] < -1e-5) + ret.stockAeb = bool(cp_acc.vl["PRE_COLLISION"]["PRECOLLISION_ACTIVE"] and cp_acc.vl["PRE_COLLISION"]["FORCE"] < -1e-5) if self.CP.enableBsm: ret.leftBlindspot = (cp.vl["BSM"]["L_ADJACENT"] == 1) or (cp.vl["BSM"]["L_APPROACHING"] == 1) diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 29e5eea34a..642c39952e 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -212,7 +212,6 @@ class CarInterface(CarInterfaceBase): smartDsu = 0x2FF in fingerprint[0] # In TSS2 cars the camera does long control found_ecus = [fw.ecu for fw in car_fw] - print((len(found_ecus) > 0), (Ecu.dsu not in found_ecus), (candidate not in NO_DSU_CAR), (not smartDsu)) ret.enableDsu = (len(found_ecus) > 0) and (Ecu.dsu not in found_ecus) and (candidate not in NO_DSU_CAR) and (not smartDsu) ret.enableGasInterceptor = 0x201 in fingerprint[0] # if the smartDSU is detected, openpilot can send ACC_CMD (and the smartDSU will block it from the DSU) or not (the DSU is "connected")