Subaru: remove unused backoff rate calculation (#29368)

* cancel rate

* Update selfdrive/car/subaru/carcontroller.py

Co-authored-by: Shane Smiskol <shane@smiskol.com>

* leave it as it was for now

* cleanup

---------

Co-authored-by: Shane Smiskol <shane@smiskol.com>
old-commit-hash: fc9a623d69
beeps
Justin Newberry 2 years ago committed by GitHub
parent 1d47429f8e
commit 8abf2d1637
  1. 4
      selfdrive/car/subaru/carcontroller.py

@ -12,7 +12,6 @@ class CarController:
self.frame = 0
self.cruise_button_prev = 0
self.last_cancel_frame = 0
self.p = CarControllerParams(CP)
self.packer = CANPacker(DBC[CP.carFingerprint]['pt'])
@ -100,10 +99,9 @@ class CarController:
can_sends.append(subarucan.create_es_distance(self.packer, CS.es_distance_msg, 0, pcm_cancel_cmd,
self.CP.openpilotLongitudinalControl, cruise_brake > 0, cruise_throttle))
else:
if pcm_cancel_cmd and (self.frame - self.last_cancel_frame) > 0.2:
if pcm_cancel_cmd:
bus = CanBus.alt if self.CP.carFingerprint in GLOBAL_GEN2 else CanBus.main
can_sends.append(subarucan.create_es_distance(self.packer, CS.es_distance_msg, bus, pcm_cancel_cmd))
self.last_cancel_frame = self.frame
new_actuators = actuators.copy()
new_actuators.steer = self.apply_steer_last / self.p.STEER_MAX

Loading…
Cancel
Save