From ada18f0da75f91ccb5ef4f098bb315c148f5a801 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 22 Aug 2023 19:50:24 -0700 Subject: [PATCH] Revert "Toyota: prepare to disable radar (#29541)" This reverts commit 2d56016f4c25f7672ff770958ea65c6bc023e387. old-commit-hash: cb368163158fe8133b317273f99f011ce1fa2288 --- selfdrive/car/toyota/carcontroller.py | 5 ----- selfdrive/car/toyota/interface.py | 9 --------- selfdrive/car/toyota/toyotacan.py | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index ab7e4b9d85..c625c2e493 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -166,7 +166,6 @@ class CarController: hud_control.rightLaneVisible, hud_control.leftLaneDepart, hud_control.rightLaneDepart, CC.enabled, CS.lkas_hud)) - # TODO: send when disabling the radar to avoid a fault if (self.frame % 100 == 0 or send_ui) and self.CP.enableDsu: can_sends.append(create_fcw_command(self.packer, fcw_alert)) @@ -175,10 +174,6 @@ class CarController: if self.frame % fr_step == 0 and self.CP.enableDsu and self.CP.carFingerprint in cars: can_sends.append(make_can_msg(addr, vl, bus)) - # uncomment to keep radar disabled, rate can be tuned: - # if self.frame % 20 == 0: - # can_sends.append([0x750, 0, b"\x0F\x02\x3E\x00\x00\x00\x00\x00", 0]) - new_actuators = actuators.copy() new_actuators.steer = apply_steer / self.params.STEER_MAX new_actuators.steerOutputCan = apply_steer diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 6b8977f9f1..c78479a97e 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -261,15 +261,6 @@ class CarInterface(CarInterfaceBase): return ret - # uncomment to disable radar: - # @staticmethod - # def init(CP, logcan, sendcan): - # # a diagnostic mode of SESSION_TYPE.PROGRAMMING disabled the ECU on its own. car did not accept DISABLE_RX_DISABLE_TX, but it did not matter. - # # a diagnostic mode of SESSION_TYPE.EXTENDED_DIAGNOSTIC and CONTROL_TYPE.ENABLE_RX_DISABLE_TX did work, so use that - # # TODO: add a flag, radarUnavailable shouldn't be used as "radar acc" right now - # if CP.openpilotLongitudinalControl and CP.radarUnavailable: - # disable_ecu(logcan, sendcan, bus=0, addr=0x750, sub_addr=0xf, com_cont_req=b'\x28\x01\x01') - # returns a car.CarState def _update(self, c): ret = self.CS.update(self.cp, self.cp_cam) diff --git a/selfdrive/car/toyota/toyotacan.py b/selfdrive/car/toyota/toyotacan.py index 0792ac869f..0c3330efa2 100644 --- a/selfdrive/car/toyota/toyotacan.py +++ b/selfdrive/car/toyota/toyotacan.py @@ -56,7 +56,7 @@ def create_acc_cancel_command(packer): def create_fcw_command(packer, fcw): values = { - "PCS_INDICATOR": 1, # PCS turned off + "PCS_INDICATOR": 1, "FCW": fcw, "SET_ME_X20": 0x20, "SET_ME_X10": 0x10,