From 8abf2d1637666604d9fdac9d8c0252bf4041ed18 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Mon, 21 Aug 2023 13:31:57 -0700 Subject: [PATCH] Subaru: remove unused backoff rate calculation (#29368) * cancel rate * Update selfdrive/car/subaru/carcontroller.py Co-authored-by: Shane Smiskol * leave it as it was for now * cleanup --------- Co-authored-by: Shane Smiskol old-commit-hash: fc9a623d69919897c3e070ed11309c92651611a8 --- selfdrive/car/subaru/carcontroller.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py index 3aba25fe8d..b00e38c807 100644 --- a/selfdrive/car/subaru/carcontroller.py +++ b/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