Subaru cleanup (#1809)

old-commit-hash: 30d6d77e26
commatwo_master
Adeeb Shihadeh 5 years ago committed by GitHub
parent 0f718e462b
commit e50c6ad58d
  1. 6
      selfdrive/car/subaru/carcontroller.py
  2. 7
      selfdrive/car/subaru/carstate.py
  3. 5
      selfdrive/car/subaru/interface.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))

@ -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 = [

@ -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()

Loading…
Cancel
Save