From 2b2f41c213c53c32f95c8891088b193c515804b8 Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Thu, 13 Apr 2023 00:10:20 -0700 Subject: [PATCH] only global gen 2 --- selfdrive/car/subaru/carcontroller.py | 8 ++++---- selfdrive/car/subaru/carstate.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/selfdrive/car/subaru/carcontroller.py b/selfdrive/car/subaru/carcontroller.py index 8cfa48f1c9..c567324579 100644 --- a/selfdrive/car/subaru/carcontroller.py +++ b/selfdrive/car/subaru/carcontroller.py @@ -79,10 +79,6 @@ class CarController: if self.es_dashstatus_cnt != CS.es_dashstatus_msg["COUNTER"]: can_sends.append(subarucan.create_es_dashstatus(self.packer, CS.es_dashstatus_msg)) self.es_dashstatus_cnt = CS.es_dashstatus_msg["COUNTER"] - - if self.infotainmentstatus_cnt != CS.es_infotainmentstatus_msg["COUNTER"]: - can_sends.append(subarucan.create_infotainmentstatus(self.packer, CS.es_infotainmentstatus_msg, hud_control.visualAlert)) - self.infotainmentstatus_cnt = CS.es_infotainmentstatus_msg["COUNTER"] if self.es_lkas_cnt != CS.es_lkas_msg["COUNTER"]: can_sends.append(subarucan.create_es_lkas(self.packer, CS.es_lkas_msg, CC.enabled, hud_control.visualAlert, @@ -90,6 +86,10 @@ class CarController: hud_control.leftLaneDepart, hud_control.rightLaneDepart)) self.es_lkas_cnt = CS.es_lkas_msg["COUNTER"] + if self.infotainmentstatus_cnt != CS.es_infotainmentstatus_msg["COUNTER"] and self.CP.carFingerprint in GLOBAL_GEN2: + can_sends.append(subarucan.create_infotainmentstatus(self.packer, CS.es_infotainmentstatus_msg, hud_control.visualAlert)) + self.infotainmentstatus_cnt = CS.es_infotainmentstatus_msg["COUNTER"] + new_actuators = actuators.copy() new_actuators.steer = self.apply_steer_last / self.p.STEER_MAX new_actuators.steerOutputCan = self.apply_steer_last diff --git a/selfdrive/car/subaru/carstate.py b/selfdrive/car/subaru/carstate.py index bace7fe275..586708808a 100644 --- a/selfdrive/car/subaru/carstate.py +++ b/selfdrive/car/subaru/carstate.py @@ -82,7 +82,7 @@ class CarState(CarStateBase): cp_es_distance = cp_body if self.car_fingerprint in GLOBAL_GEN2 else cp_cam self.es_distance_msg = copy.copy(cp_es_distance.vl["ES_Distance"]) self.es_dashstatus_msg = copy.copy(cp_cam.vl["ES_DashStatus"]) - if self.CP.carFingerprint not in PREGLOBAL_CARS: + if self.CP.carFingerprint in GLOBAL_GEN2: self.es_infotainmentstatus_msg = copy.copy(cp_cam.vl["INFOTAINMENT_STATUS"]) return ret @@ -277,8 +277,6 @@ class CarState(CarStateBase): ("Far_Distance", "ES_DashStatus"), ("Cruise_State", "ES_DashStatus"), - ("LKAS_State_Infotainment", "INFOTAINMENT_STATUS"), - ("COUNTER", "ES_LKAS_State"), ("LKAS_Alert_Msg", "ES_LKAS_State"), ("Signal1", "ES_LKAS_State"), @@ -297,12 +295,14 @@ class CarState(CarStateBase): ] checks = [ - ("INFOTAINMENT_STATUS", 10), ("ES_DashStatus", 10), ("ES_LKAS_State", 10), ] - if CP.carFingerprint not in GLOBAL_GEN2: + if CP.carFingerprint in GLOBAL_GEN2: + signals += [("LKAS_State_Infotainment", "INFOTAINMENT_STATUS")] + checks += [("INFOTAINMENT_STATUS", 10)] + else: signals += CarState.get_global_es_distance_signals()[0] checks += CarState.get_global_es_distance_signals()[1]