mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 08:16:06 +08:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user