Toyota: prepare to disable radar (#29541)

* try to disable radar

* fix bug and bump panda

* prep

* always attempt longitudinal for testers

* fix rav4

* send ACC_HUD

* bump panda

* revert

* check for failure to disable

* fix arg

* bump to master

* revert to master

* comments only
old-commit-hash: 61653bf343
beeps
Shane Smiskol 2 years ago committed by GitHub
parent 1a29920369
commit 1acbc2c55a
  1. 5
      selfdrive/car/toyota/carcontroller.py
  2. 9
      selfdrive/car/toyota/interface.py
  3. 2
      selfdrive/car/toyota/toyotacan.py

@ -166,6 +166,7 @@ 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))
@ -174,6 +175,10 @@ 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

@ -261,6 +261,15 @@ 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)

@ -56,7 +56,7 @@ def create_acc_cancel_command(packer):
def create_fcw_command(packer, fcw):
values = {
"PCS_INDICATOR": 1,
"PCS_INDICATOR": 1, # PCS turned off
"FCW": fcw,
"SET_ME_X20": 0x20,
"SET_ME_X10": 0x10,

Loading…
Cancel
Save