|
|
|
@ -4,7 +4,7 @@ from opendbc.can.can_define import CANDefine |
|
|
|
|
from common.conversions import Conversions as CV |
|
|
|
|
from selfdrive.car.interfaces import CarStateBase |
|
|
|
|
from opendbc.can.parser import CANParser |
|
|
|
|
from selfdrive.car.subaru.values import DBC, CAR, GLOBAL_GEN2, PREGLOBAL_CARS |
|
|
|
|
from selfdrive.car.subaru.values import DBC, CAR, GLOBAL_GEN2, PREGLOBAL_CARS, SubaruFlags |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CarState(CarStateBase): |
|
|
|
@ -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 in GLOBAL_GEN2: |
|
|
|
|
if self.CP.flags & SubaruFlags.SEND_INFOTAINMENT: |
|
|
|
|
self.es_infotainmentstatus_msg = copy.copy(cp_cam.vl["INFOTAINMENT_STATUS"]) |
|
|
|
|
|
|
|
|
|
return ret |
|
|
|
@ -299,13 +299,14 @@ class CarState(CarStateBase): |
|
|
|
|
("ES_LKAS_State", 10), |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
if CP.carFingerprint in GLOBAL_GEN2: |
|
|
|
|
signals += [("LKAS_State_Infotainment", "INFOTAINMENT_STATUS")] |
|
|
|
|
checks += [("INFOTAINMENT_STATUS", 10)] |
|
|
|
|
else: |
|
|
|
|
if CP.carFingerprint not in GLOBAL_GEN2: |
|
|
|
|
signals += CarState.get_global_es_distance_signals()[0] |
|
|
|
|
checks += CarState.get_global_es_distance_signals()[1] |
|
|
|
|
|
|
|
|
|
if CP.flags & SubaruFlags.SEND_INFOTAINMENT: |
|
|
|
|
signals.append(("LKAS_State_Infotainment", "INFOTAINMENT_STATUS")) |
|
|
|
|
checks.append(("INFOTAINMENT_STATUS", 10)) |
|
|
|
|
|
|
|
|
|
return CANParser(DBC[CP.carFingerprint]["pt"], signals, checks, 2) |
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
|