From e50c6ad58dfecb18a1f0afd72eeb90fe6ff9436f Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com> Date: Thu, 2 Jul 2020 13:37:53 -0700 Subject: [PATCH] Subaru cleanup (#1809) old-commit-hash: 30d6d77e26e2608ff9ad607a7353fadc0347d419 --- selfdrive/car/subaru/carcontroller.py | 6 +----- selfdrive/car/subaru/carstate.py | 7 +++---- selfdrive/car/subaru/interface.py | 5 ----- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py index 0997b1200c..06863b71cd 100644 --- a/selfdrive/car/subaru/carcontroller.py +++ b/selfdrive/car/subaru/carcontroller.py @@ -24,8 +24,6 @@ class CarController(): self.es_lkas_cnt = -1 self.steer_rate_limited = False - # Setup detection helper. Routes commands to - # an appropriate CAN bus number. self.params = CarControllerParams() self.packer = CANPacker(DBC[CP.carFingerprint]['pt']) @@ -50,9 +48,7 @@ class CarController(): apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P) self.steer_rate_limited = new_steer != apply_steer - lkas_enabled = enabled - - if not lkas_enabled: + if not enabled: apply_steer = 0 can_sends.append(subarucan.create_steering_control(self.packer, apply_steer, frame, P.STEER_STEP)) diff --git a/selfdrive/car/subaru/carstate.py b/selfdrive/car/subaru/carstate.py index a1dc3b5cc2..d7a34d3625 100644 --- a/selfdrive/car/subaru/carstate.py +++ b/selfdrive/car/subaru/carstate.py @@ -57,9 +57,9 @@ class CarState(CarStateBase): ret.seatbeltUnlatched = cp.vl["Dashlights"]['SEATBELT_FL'] == 1 ret.doorOpen = any([cp.vl["BodyInfo"]['DOOR_OPEN_RR'], - cp.vl["BodyInfo"]['DOOR_OPEN_RL'], - cp.vl["BodyInfo"]['DOOR_OPEN_FR'], - cp.vl["BodyInfo"]['DOOR_OPEN_FL']]) + cp.vl["BodyInfo"]['DOOR_OPEN_RL'], + cp.vl["BodyInfo"]['DOOR_OPEN_FR'], + cp.vl["BodyInfo"]['DOOR_OPEN_FL']]) self.es_distance_msg = copy.copy(cp_cam.vl["ES_Distance"]) self.es_lkas_msg = copy.copy(cp_cam.vl["ES_LKAS_State"]) @@ -137,7 +137,6 @@ class CarState(CarStateBase): ("Traffic_light_Ahead", "ES_LKAS_State", 0), ("Right_Depart", "ES_LKAS_State", 0), ("Signal5", "ES_LKAS_State", 0), - ] checks = [ diff --git a/selfdrive/car/subaru/interface.py b/selfdrive/car/subaru/interface.py index 4a0438f620..66a5d99513 100644 --- a/selfdrive/car/subaru/interface.py +++ b/selfdrive/car/subaru/interface.py @@ -78,11 +78,6 @@ class CarInterface(CarInterfaceBase): ret.canValid = self.cp.can_valid and self.cp_cam.can_valid ret.steeringRateLimited = self.CC.steer_rate_limited if self.CC is not None else False - buttonEvents = [] - be = car.CarState.ButtonEvent.new_message() - be.type = car.CarState.ButtonEvent.Type.accelCruise - buttonEvents.append(be) - ret.events = self.create_common_events(ret).to_msg() self.CS.out = ret.as_reader()