|
|
@ -203,7 +203,7 @@ class CarState(CarStateBase): |
|
|
|
self.is_metric = cp.vl["CLUSTER_INFO"]["DISTANCE_UNIT"] != 1 |
|
|
|
self.is_metric = cp.vl["CLUSTER_INFO"]["DISTANCE_UNIT"] != 1 |
|
|
|
if not self.CP.openpilotLongitudinalControl: |
|
|
|
if not self.CP.openpilotLongitudinalControl: |
|
|
|
speed_factor = CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS |
|
|
|
speed_factor = CV.KPH_TO_MS if self.is_metric else CV.MPH_TO_MS |
|
|
|
cp_cruise_info = cp if self.CP.flags & HyundaiFlags.CANFD_HDA2 else cp_cam |
|
|
|
cp_cruise_info = cp if self.CP.flags & (HyundaiFlags.CANFD_HDA2 | ~HyundaiFlags.CANFD_CAMERA_SCC) else cp_cam |
|
|
|
ret.cruiseState.speed = cp_cruise_info.vl["CRUISE_INFO"]["SET_SPEED"] * speed_factor |
|
|
|
ret.cruiseState.speed = cp_cruise_info.vl["CRUISE_INFO"]["SET_SPEED"] * speed_factor |
|
|
|
ret.cruiseState.standstill = cp_cruise_info.vl["CRUISE_INFO"]["CRUISE_STANDSTILL"] == 1 |
|
|
|
ret.cruiseState.standstill = cp_cruise_info.vl["CRUISE_INFO"]["CRUISE_STANDSTILL"] == 1 |
|
|
|
self.cruise_info = copy.copy(cp_cruise_info.vl["CRUISE_INFO"]) |
|
|
|
self.cruise_info = copy.copy(cp_cruise_info.vl["CRUISE_INFO"]) |
|
|
@ -462,7 +462,7 @@ class CarState(CarStateBase): |
|
|
|
("DOORS_SEATBELTS", 4), |
|
|
|
("DOORS_SEATBELTS", 4), |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
if CP.flags & HyundaiFlags.CANFD_HDA2 and not CP.openpilotLongitudinalControl: |
|
|
|
if CP.flags & (HyundaiFlags.CANFD_HDA2 | ~HyundaiFlags.CANFD_CAMERA_SCC) and not CP.openpilotLongitudinalControl: |
|
|
|
signals += [ |
|
|
|
signals += [ |
|
|
|
("SET_SPEED", "CRUISE_INFO"), |
|
|
|
("SET_SPEED", "CRUISE_INFO"), |
|
|
|
("CRUISE_STANDSTILL", "CRUISE_INFO"), |
|
|
|
("CRUISE_STANDSTILL", "CRUISE_INFO"), |
|
|
@ -498,11 +498,13 @@ class CarState(CarStateBase): |
|
|
|
|
|
|
|
|
|
|
|
@staticmethod |
|
|
|
@staticmethod |
|
|
|
def get_cam_can_parser_canfd(CP): |
|
|
|
def get_cam_can_parser_canfd(CP): |
|
|
|
|
|
|
|
signals = [] |
|
|
|
|
|
|
|
checks = [] |
|
|
|
if CP.flags & HyundaiFlags.CANFD_HDA2: |
|
|
|
if CP.flags & HyundaiFlags.CANFD_HDA2: |
|
|
|
signals = [(f"BYTE{i}", "CAM_0x2a4") for i in range(3, 24)] |
|
|
|
signals += [(f"BYTE{i}", "CAM_0x2a4") for i in range(3, 24)] |
|
|
|
checks = [("CAM_0x2a4", 20)] |
|
|
|
checks += [("CAM_0x2a4", 20)] |
|
|
|
else: |
|
|
|
elif CP.flags & HyundaiFlags.CANFD_CAMERA_SCC: |
|
|
|
signals = [ |
|
|
|
signals += [ |
|
|
|
("COUNTER", "CRUISE_INFO"), |
|
|
|
("COUNTER", "CRUISE_INFO"), |
|
|
|
("NEW_SIGNAL_1", "CRUISE_INFO"), |
|
|
|
("NEW_SIGNAL_1", "CRUISE_INFO"), |
|
|
|
("CRUISE_MAIN", "CRUISE_INFO"), |
|
|
|
("CRUISE_MAIN", "CRUISE_INFO"), |
|
|
@ -516,7 +518,7 @@ class CarState(CarStateBase): |
|
|
|
("NEW_SIGNAL_4", "CRUISE_INFO"), |
|
|
|
("NEW_SIGNAL_4", "CRUISE_INFO"), |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
checks = [ |
|
|
|
checks += [ |
|
|
|
("CRUISE_INFO", 50), |
|
|
|
("CRUISE_INFO", 50), |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|