From 7d78cef34b0eea35c2e47f4aa91baf671ef39c43 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 15 Apr 2020 19:33:24 -0700 Subject: [PATCH] Hyundai-Kia-Genesis (HKG) (#1362) * hkg * Cleanup * Update readme * more fixes and cleanup * Old genesis * Typoe * Test car models * Update comment * Fix brake pressed * Update release notes * Fix vEgo * Add sonata * Add sonata values * Temporarily remove doors check. It doesn't work * Sonata uses crc8 * Fix tests * Changes for LFA * Add comment * Does this improve the hud? * Proper signal name * Force the right value * some ui stuff * more comments * Show lane lines on sonata * cleanup dash * fix last ui issues * Fix doors * update CI Co-authored-by: Comma Device --- README.md | 12 +- RELEASES.md | 2 +- opendbc | 2 +- panda | 2 +- selfdrive/car/hyundai/carcontroller.py | 98 +++++++--- selfdrive/car/hyundai/carstate.py | 178 +++++++++++------- selfdrive/car/hyundai/hyundaican.py | 103 ++++++---- selfdrive/car/hyundai/interface.py | 82 ++++++-- selfdrive/car/hyundai/radar_interface.py | 74 +++++++- selfdrive/car/hyundai/values.py | 118 +++++++++--- selfdrive/test/process_replay/ref_commit | 2 +- .../test/process_replay/test_processes.py | 2 +- selfdrive/test/test_car_models.py | 19 +- 13 files changed, 515 insertions(+), 179 deletions(-) diff --git a/README.md b/README.md index 673996df12d53f..360ad90804bc2f 100644 --- a/README.md +++ b/README.md @@ -132,15 +132,23 @@ Community Maintained Cars and Features | Chrysler | Pacifica 2020 | Adaptive Cruise | Stock | 0mph | 39mph | | Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph | | Chrysler | Pacifica Hybrid 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph | +| Genesis | G80 20182 | All | Stock | 0mph | 0mph | +| Genesis | G90 20182 | All | Stock | 0mph | 0mph | | GMC | Acadia Denali 20183| Adaptive Cruise | openpilot | 0mph | 7mph | | Holden | Astra 20171 | Adaptive Cruise | openpilot | 0mph | 7mph | | Hyundai | Elantra 2017-192 | SCC + LKAS | Stock | 19mph | 34mph | -| Hyundai | Genesis 20182 | All | Stock | 19mph | 34mph | +| Hyundai | Genesis 2015-162 | SCC + LKAS | Stock | 19mph | 37mph | +| Hyundai | Ioniq 20172 | SCC + LKAS | Stock | 0mph | 32mph | +| Hyundai | Ioniq 2019 EV2 | SCC + LKAS | Stock | 0mph | 32mph | +| Hyundai | Kona 2017-192 | SCC + LKAS | Stock | 22mph | 0mph | +| Hyundai | Kona 2019 EV2 | SCC + LKAS | Stock | 0mph | 0mph | | Hyundai | Santa Fe 20192 | All | Stock | 0mph | 0mph | | Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph | | Jeep | Grand Cherokee 2019 | Adaptive Cruise | Stock | 0mph | 39mph | +| Kia | Forte 20182 | SCC + LKAS | Stock | 0mph | 0mph | +| Kia | Optima 20172 | SCC + LKAS/LDWS | Stock | 0mph | 32mph | | Kia | Optima 20192 | SCC + LKAS | Stock | 0mph | 0mph | -| Kia | Sorento 20182 | All | Stock | 0mph | 0mph | +| Kia | Sorento 20182 | SCC + LKAS | Stock | 0mph | 0mph | | Kia | Stinger 20182 | SCC + LKAS | Stock | 0mph | 0mph | | Nissan | Leaf 2019 | Propilot | Stock | 0mph | 0mph | | Nissan | X-Trail 2018 | Propilot | Stock | 0mph | 0mph | diff --git a/RELEASES.md b/RELEASES.md index 7c1b817ef6a856..853eddfdddad8e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,9 +1,9 @@ Version 0.7.5 (2020-xx-xx) ======================== * Right-Hand Drive support for both driving and driver monitoring! -* New driving model: * New driver monitoring model: overall improvement on comma two * Driver camera preview in settings to improve mounting position +* Added support for many Hyundai, Kia, Genesis models thanks to xx979xx! * 2019 Nissan X-Trail and 2018 Nissan Leaf support thanks to avolmensky! Version 0.7.4 (2020-03-20) diff --git a/opendbc b/opendbc index a57e7ddbd72c92..b69398525a4f3d 160000 --- a/opendbc +++ b/opendbc @@ -1 +1 @@ -Subproject commit a57e7ddbd72c92241d5d6442da9d47c55e95a8cf +Subproject commit b69398525a4f3d590305df171572415568e365aa diff --git a/panda b/panda index bc90b60f973ddf..435cabe7f7a02a 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit bc90b60f973ddf422ea78ce8fb83fbf88448694f +Subproject commit 435cabe7f7a02a0c732725b97cbb7192a68a406d diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index efd8796e0840aa..79d509a1da8b77 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -1,47 +1,103 @@ +from cereal import car from selfdrive.car import apply_std_steer_torque_limits -from selfdrive.car.hyundai.hyundaican import create_lkas11, create_clu11 -from selfdrive.car.hyundai.values import Buttons, SteerLimitParams +from selfdrive.car.hyundai.hyundaican import create_lkas11, create_clu11, create_lfa_mfa +from selfdrive.car.hyundai.values import Buttons, SteerLimitParams, CAR from opendbc.can.packer import CANPacker +VisualAlert = car.CarControl.HUDControl.VisualAlert + + +def process_hud_alert(enabled, fingerprint, visual_alert, left_lane, + right_lane, left_lane_depart, right_lane_depart): + sys_warning = (visual_alert == VisualAlert.steerRequired) + + # initialize to no line visible + sys_state = 1 + if left_lane and right_lane or sys_warning: #HUD alert only display when LKAS status is active + if enabled or sys_warning: + sys_state = 3 + else: + sys_state = 4 + elif left_lane: + sys_state = 5 + elif right_lane: + sys_state = 6 + + # initialize to no warnings + left_lane_warning = 0 + right_lane_warning = 0 + if left_lane_depart: + left_lane_warning = 1 if fingerprint in [CAR.GENESIS_G90, CAR.GENESIS_G80] else 2 + if right_lane_depart: + right_lane_warning = 1 if fingerprint in [CAR.GENESIS_G90, CAR.GENESIS_G80] else 2 + + return sys_warning, sys_state, left_lane_warning, right_lane_warning + class CarController(): def __init__(self, dbc_name, CP, VM): self.apply_steer_last = 0 self.car_fingerprint = CP.carFingerprint - self.lkas11_cnt = 0 - self.cnt = 0 - self.last_resume_cnt = 0 self.packer = CANPacker(dbc_name) self.steer_rate_limited = False + self.resume_cnt = 0 + self.last_resume_frame = 0 + self.last_lead_distance = 0 - def update(self, enabled, CS, actuators, pcm_cancel_cmd, hud_alert): - - ### Steering Torque + def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, visual_alert, + left_lane, right_lane, left_lane_depart, right_lane_depart): + # Steering Torque new_steer = actuators.steer * SteerLimitParams.STEER_MAX apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, SteerLimitParams) self.steer_rate_limited = new_steer != apply_steer - if not enabled: - apply_steer = 0 + # disable if steer angle reach 90 deg, otherwise mdps fault in some models + lkas_active = enabled and abs(CS.out.steeringAngle) < 90. + + # fix for Genesis hard fault at low speed + if CS.out.vEgo < 16.7 and self.car_fingerprint == CAR.HYUNDAI_GENESIS: + lkas_active = 0 - steer_req = 1 if enabled else 0 + if not lkas_active: + apply_steer = 0 self.apply_steer_last = apply_steer + sys_warning, sys_state, left_lane_warning, right_lane_warning =\ + process_hud_alert(enabled, self.car_fingerprint, visual_alert, + left_lane, right_lane, left_lane_depart, right_lane_depart) + can_sends = [] + can_sends.append(create_lkas11(self.packer, frame, self.car_fingerprint, apply_steer, lkas_active, + CS.lkas11, sys_warning, sys_state, enabled, + left_lane, right_lane, + left_lane_warning, right_lane_warning)) - self.lkas11_cnt = self.cnt % 0x10 - self.clu11_cnt = self.cnt % 0x10 + if pcm_cancel_cmd: + can_sends.append(create_clu11(self.packer, frame, CS.clu11, Buttons.CANCEL)) - can_sends.append(create_lkas11(self.packer, self.car_fingerprint, apply_steer, steer_req, self.lkas11_cnt, - enabled, CS.lkas11, hud_alert, keep_stock=True)) + elif CS.out.cruiseState.standstill: + # run only first time when the car stopped + if self.last_lead_distance == 0: + # get the lead distance from the Radar + self.last_lead_distance = CS.lead_distance + self.resume_cnt = 0 + # when lead car starts moving, create 6 RES msgs + elif CS.lead_distance != self.last_lead_distance and (frame - self.last_resume_frame) > 5: + can_sends.append(create_clu11(self.packer, frame, CS.clu11, Buttons.RES_ACCEL)) + self.resume_cnt += 1 + # interval after 6 msgs + if self.resume_cnt > 5: + self.last_resume_frame = frame + self.clu11_cnt = 0 + # reset lead distnce after the car starts moving + elif self.last_lead_distance != 0: + self.last_lead_distance = 0 - if pcm_cancel_cmd: - can_sends.append(create_clu11(self.packer, CS.clu11, Buttons.CANCEL)) - elif CS.out.cruiseState.standstill and (self.cnt - self.last_resume_cnt) > 5: - self.last_resume_cnt = self.cnt - can_sends.append(create_clu11(self.packer, CS.clu11, Buttons.RES_ACCEL)) - self.cnt += 1 + # 20 Hz LFA MFA message + if frame % 5 == 0 and self.car_fingerprint == CAR.SONATA: + can_sends.append(create_lfa_mfa(self.packer, frame, enabled)) + return can_sends diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 59c825f44d6a90..dcb5844c2ca1de 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -6,12 +6,14 @@ GearShifter = car.CarState.GearShifter -class CarState(CarStateBase): +class CarState(CarStateBase): def update(self, cp, cp_cam): ret = car.CarState.new_message() - ret.doorOpen = False # FIXME + ret.doorOpen = any([cp.vl["CGW1"]['CF_Gway_DrvDrSw'],cp.vl["CGW1"]['CF_Gway_AstDrSw'], + cp.vl["CGW2"]['CF_Gway_RLDrSw'], cp.vl["CGW2"]['CF_Gway_RRDrSw']]) + ret.seatbeltUnlatched = cp.vl["CGW1"]['CF_Gway_DrvSeatBeltSw'] == 0 ret.wheelSpeeds.fl = cp.vl["WHL_SPD11"]['WHL_SPD_FL'] * CV.KPH_TO_MS @@ -28,14 +30,15 @@ def update(self, cp, cp_cam): ret.yawRate = cp.vl["ESP12"]['YAW_RATE'] ret.leftBlinker = cp.vl["CGW1"]['CF_Gway_TSigLHSw'] != 0 ret.rightBlinker = cp.vl["CGW1"]['CF_Gway_TSigRHSw'] != 0 - ret.steeringTorque = cp.vl["MDPS11"]['CR_Mdps_DrvTq'] + ret.steeringTorque = cp.vl["MDPS12"]['CR_Mdps_StrColTq'] ret.steeringTorqueEps = cp.vl["MDPS12"]['CR_Mdps_OutTq'] ret.steeringPressed = abs(ret.steeringTorque) > STEER_THRESHOLD # cruise state - ret.cruiseState.enabled = cp.vl["SCC12"]['ACCMode'] != 0 ret.cruiseState.available = True + ret.cruiseState.enabled = cp.vl["SCC12"]['ACCMode'] != 0 ret.cruiseState.standstill = cp.vl["SCC11"]['SCCInfoDisplay'] == 4. + if ret.cruiseState.enabled: is_set_speed_in_mph = int(cp.vl["CLU11"]["CF_Clu_SPEED_UNIT"]) speed_conv = CV.MPH_TO_MS if is_set_speed_in_mph else CV.KPH_TO_MS @@ -43,56 +46,72 @@ def update(self, cp, cp_cam): else: ret.cruiseState.speed = 0 - ret.brake = 0 # FIXME + # TODO: Find brake pressure + ret.brake = 0 ret.brakePressed = cp.vl["TCS13"]['DriverBraking'] != 0 - ret.brakeLights = ret.brakePressed - ret.gas = cp.vl["EMS12"]['PV_AV_CAN'] / 100 - ret.gasPressed = cp.vl["EMS16"]["CF_Ems_AclAct"] != 0 - ret.espDisabled = cp.vl["TCS15"]['ESC_Off_Step'] != 0 - # Gear Selecton - This is not compatible with all Kia/Hyundai's, But is the best way for those it is compatible with - gear = cp.vl["LVR12"]["CF_Lvr_Gear"] - if gear == 5: - gear_shifter = GearShifter.drive - elif gear == 6: - gear_shifter = GearShifter.neutral - elif gear == 0: - gear_shifter = GearShifter.park - elif gear == 7: - gear_shifter = GearShifter.reverse - else: - gear_shifter = GearShifter.unknown + # TODO: Check this + ret.brakeLights = bool(cp.vl["TCS13"]['BrakeLight'] or ret.brakePressed) - # Gear Selection via Cluster - For those Kia/Hyundai which are not fully discovered, we can use the Cluster Indicator for Gear Selection, as this seems to be standard over all cars, but is not the preferred method. - if cp.vl["CLU15"]["CF_Clu_InhibitD"] == 1: - gear_shifter_cluster = GearShifter.drive - elif cp.vl["CLU15"]["CF_Clu_InhibitN"] == 1: - gear_shifter_cluster = GearShifter.neutral - elif cp.vl["CLU15"]["CF_Clu_InhibitP"] == 1: - gear_shifter_cluster = GearShifter.park - elif cp.vl["CLU15"]["CF_Clu_InhibitR"] == 1: - gear_shifter_cluster = GearShifter.reverse + #TODO: find pedal signal for EV/HYBRID Cars + if (cp.vl["TCS13"]["DriverOverride"] == 0 and cp.vl["TCS13"]['ACC_REQ'] == 1): + pedal_gas = 0 else: - gear_shifter_cluster = GearShifter.unknown + pedal_gas = cp.vl["EMS12"]['TPS'] - # Gear Selecton via TCU12 - gear2 = cp.vl["TCU12"]["CUR_GR"] - if gear2 == 0: - gear_tcu = GearShifter.park - elif gear2 == 14: - gear_tcu = GearShifter.reverse - elif gear2 > 0 and gear2 < 9: # unaware of anything over 8 currently - gear_tcu = GearShifter.drive - else: - gear_tcu = GearShifter.unknown + ret.gasPressed = pedal_gas > 1e-3 + ret.gas = pedal_gas - # gear shifter + # TODO: refactor gear parsing in function + # Gear Selection via Cluster - For those Kia/Hyundai which are not fully discovered, we can use the Cluster Indicator for Gear Selection, as this seems to be standard over all cars, but is not the preferred method. if self.CP.carFingerprint in FEATURES["use_cluster_gears"]: - ret.gearShifter = gear_shifter_cluster + if cp.vl["CLU15"]["CF_Clu_InhibitD"] == 1: + ret.gearShifter = GearShifter.drive + elif cp.vl["CLU15"]["CF_Clu_InhibitN"] == 1: + ret.gearShifter = GearShifter.neutral + elif cp.vl["CLU15"]["CF_Clu_InhibitP"] == 1: + ret.gearShifter = GearShifter.park + elif cp.vl["CLU15"]["CF_Clu_InhibitR"] == 1: + ret.gearShifter = GearShifter.reverse + else: + ret.gearShifter = GearShifter.unknown + # Gear Selecton via TCU12 elif self.CP.carFingerprint in FEATURES["use_tcu_gears"]: - ret.gearShifter = gear_tcu + gear = cp.vl["TCU12"]["CUR_GR"] + if gear == 0: + ret.gearShifter = GearShifter.park + elif gear == 14: + ret.gearShifter = GearShifter.reverse + elif gear > 0 and gear < 9: # unaware of anything over 8 currently + ret.gearShifter = GearShifter.drive + else: + ret.gearShifter = GearShifter.unknown + # Gear Selecton - This is only compatible with optima hybrid 2017 + elif self.CP.carFingerprint in FEATURES["use_elect_gears"]: + gear = cp.vl["ELECT_GEAR"]["Elect_Gear_Shifter"] + if gear in (5, 8): # 5: D, 8: sport mode + ret.gearShifter = GearShifter.drive + elif gear == 6: + ret.gearShifter = GearShifter.neutral + elif gear == 0: + ret.gearShifter = GearShifter.park + elif gear == 7: + ret.gearShifter = GearShifter.reverse + else: + ret.gearShifter = GearShifter.unknown + # Gear Selecton - This is not compatible with all Kia/Hyundai's, But is the best way for those it is compatible with else: - ret.gearShifter = gear_shifter + gear = cp.vl["LVR12"]["CF_Lvr_Gear"] + if gear in (5, 8): # 5: D, 8: sport mode + ret.gearShifter = GearShifter.drive + elif gear == 6: + ret.gearShifter = GearShifter.neutral + elif gear == 0: + ret.gearShifter = GearShifter.park + elif gear == 7: + ret.gearShifter = GearShifter.reverse + else: + ret.gearShifter = GearShifter.unknown # save the entire LKAS11 and CLU11 self.lkas11 = cp_cam.vl["LKAS11"] @@ -100,13 +119,12 @@ def update(self, cp, cp_cam): self.park_brake = cp.vl["CGW1"]['CF_Gway_ParkBrakeSw'] self.steer_state = cp.vl["MDPS12"]['CF_Mdps_ToiActive'] #0 NOT ACTIVE, 1 ACTIVE self.steer_warning = cp.vl["MDPS12"]['CF_Mdps_ToiUnavail'] - self.brake_error = 0 + self.lead_distance = cp.vl["SCC11"]['ACC_ObjDist'] return ret @staticmethod def get_can_parser(CP): - signals = [ # sig_name, sig_address, default ("WHL_SPD_FL", "WHL_SPD11", 0), @@ -119,16 +137,16 @@ def get_can_parser(CP): ("CF_Gway_DrvSeatBeltInd", "CGW4", 1), ("CF_Gway_DrvSeatBeltSw", "CGW1", 0), + ("CF_Gway_DrvDrSw", "CGW1", 0), # Driver Door + ("CF_Gway_AstDrSw", "CGW1", 0), # Passenger door + ("CF_Gway_RLDrSw", "CGW2", 0), # Rear reft door + ("CF_Gway_RRDrSw", "CGW2", 0), # Rear right door ("CF_Gway_TSigLHSw", "CGW1", 0), ("CF_Gway_TurnSigLh", "CGW1", 0), ("CF_Gway_TSigRHSw", "CGW1", 0), ("CF_Gway_TurnSigRh", "CGW1", 0), ("CF_Gway_ParkBrakeSw", "CGW1", 0), - ("BRAKE_ACT", "EMS12", 0), - ("PV_AV_CAN", "EMS12", 0), - ("CF_Ems_AclAct", "EMS16", 0), - ("CYL_PRES", "ESP12", 0), ("CF_Clu_CruiseSwState", "CLU11", 0), @@ -144,54 +162,76 @@ def get_can_parser(CP): ("CF_Clu_AmpInfo", "CLU11", 0), ("CF_Clu_AliveCnt1", "CLU11", 0), - ("CF_Clu_InhibitD", "CLU15", 0), - ("CF_Clu_InhibitP", "CLU15", 0), - ("CF_Clu_InhibitN", "CLU15", 0), - ("CF_Clu_InhibitR", "CLU15", 0), - - ("CF_Lvr_Gear", "LVR12",0), - ("CUR_GR", "TCU12",0), - ("ACCEnable", "TCS13", 0), + ("ACC_REQ", "TCS13", 0), + ("BrakeLight", "TCS13", 0), ("DriverBraking", "TCS13", 0), + ("DriverOverride", "TCS13", 0), ("ESC_Off_Step", "TCS15", 0), ("CF_Lvr_GearInf", "LVR11", 0), #Transmission Gear (0 = N or P, 1-8 = Fwd, 14 = Rev) - ("CR_Mdps_DrvTq", "MDPS11", 0), - ("CR_Mdps_StrColTq", "MDPS12", 0), ("CF_Mdps_ToiActive", "MDPS12", 0), ("CF_Mdps_ToiUnavail", "MDPS12", 0), ("CF_Mdps_FailStat", "MDPS12", 0), ("CR_Mdps_OutTq", "MDPS12", 0), + ("SAS_Angle", "SAS11", 0), + ("SAS_Speed", "SAS11", 0), + + ("MainMode_ACC", "SCC11", 0), ("VSetDis", "SCC11", 0), ("SCCInfoDisplay", "SCC11", 0), + ("ACC_ObjDist", "SCC11", 0), ("ACCMode", "SCC12", 1), - ("SAS_Angle", "SAS11", 0), - ("SAS_Speed", "SAS11", 0), + ("TPS", "EMS12", 0), ] checks = [ # address, frequency ("MDPS12", 50), - ("MDPS11", 100), - ("TCS15", 10), ("TCS13", 50), + ("TCS15", 10), ("CLU11", 50), ("ESP12", 100), - ("EMS12", 100), - ("EMS16", 100), ("CGW1", 10), ("CGW4", 5), ("WHL_SPD11", 50), + ("SAS11", 100), ("SCC11", 50), ("SCC12", 50), - ("SAS11", 100) + ("EMS12", 100), ] + if CP.carFingerprint in FEATURES["use_cluster_gears"]: + signals += [ + ("CF_Clu_InhibitD", "CLU15", 0), + ("CF_Clu_InhibitP", "CLU15", 0), + ("CF_Clu_InhibitN", "CLU15", 0), + ("CF_Clu_InhibitR", "CLU15", 0), + ] + checks += [ + ("CLU15", 5) + ] + elif CP.carFingerprint in FEATURES["use_tcu_gears"]: + signals += [ + ("CUR_GR", "TCU12",0) + ] + checks += [ + ("TCU12", 100) + ] + elif CP.carFingerprint in FEATURES["use_elect_gears"]: + signals += [("Elect_Gear_Shifter", "ELECT_GEAR", 0)] + checks += [("ELECT_GEAR", 20)] + else: + signals += [ + ("CF_Lvr_Gear","LVR12",0) + ] + checks += [ + ("LVR12", 100) + ] return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, 0) @@ -200,13 +240,13 @@ def get_cam_can_parser(CP): signals = [ # sig_name, sig_address, default + ("CF_Lkas_Bca_R", "LKAS11", 0), ("CF_Lkas_LdwsSysState", "LKAS11", 0), ("CF_Lkas_SysWarning", "LKAS11", 0), ("CF_Lkas_LdwsLHWarning", "LKAS11", 0), ("CF_Lkas_LdwsRHWarning", "LKAS11", 0), ("CF_Lkas_HbaLamp", "LKAS11", 0), ("CF_Lkas_FcwBasReq", "LKAS11", 0), - ("CF_Lkas_ToiFlt", "LKAS11", 0), ("CF_Lkas_HbaSysState", "LKAS11", 0), ("CF_Lkas_FcwOpt", "LKAS11", 0), ("CF_Lkas_HbaOpt", "LKAS11", 0), diff --git a/selfdrive/car/hyundai/hyundaican.py b/selfdrive/car/hyundai/hyundaican.py index 910e05ad7c7a4e..7a72145e03a339 100644 --- a/selfdrive/car/hyundai/hyundaican.py +++ b/selfdrive/car/hyundai/hyundaican.py @@ -1,31 +1,47 @@ import crcmod -from selfdrive.car.hyundai.values import CHECKSUM +from selfdrive.car.hyundai.values import CAR, CHECKSUM hyundai_checksum = crcmod.mkCrcFun(0x11D, initCrc=0xFD, rev=False, xorOut=0xdf) -def create_lkas11(packer, car_fingerprint, apply_steer, steer_req, cnt, enabled, lkas11, hud_alert, keep_stock=False): - values = { - "CF_Lkas_Bca_R": 3 if enabled else 0, - "CF_Lkas_LdwsSysState": 3 if steer_req else 1, - "CF_Lkas_SysWarning": hud_alert, - "CF_Lkas_LdwsLHWarning": lkas11["CF_Lkas_LdwsLHWarning"] if keep_stock else 0, - "CF_Lkas_LdwsRHWarning": lkas11["CF_Lkas_LdwsRHWarning"] if keep_stock else 0, - "CF_Lkas_HbaLamp": lkas11["CF_Lkas_HbaLamp"] if keep_stock else 0, - "CF_Lkas_FcwBasReq": lkas11["CF_Lkas_FcwBasReq"] if keep_stock else 0, - "CR_Lkas_StrToqReq": apply_steer, - "CF_Lkas_ActToi": steer_req, - "CF_Lkas_ToiFlt": 0, - "CF_Lkas_HbaSysState": lkas11["CF_Lkas_HbaSysState"] if keep_stock else 1, - "CF_Lkas_FcwOpt": lkas11["CF_Lkas_FcwOpt"] if keep_stock else 0, - "CF_Lkas_HbaOpt": lkas11["CF_Lkas_HbaOpt"] if keep_stock else 3, - "CF_Lkas_MsgCount": cnt, - "CF_Lkas_FcwSysState": lkas11["CF_Lkas_FcwSysState"] if keep_stock else 0, - "CF_Lkas_FcwCollisionWarning": lkas11["CF_Lkas_FcwCollisionWarning"] if keep_stock else 0, - "CF_Lkas_FusionState": lkas11["CF_Lkas_FusionState"] if keep_stock else 0, - "CF_Lkas_Chksum": 0, - "CF_Lkas_FcwOpt_USM": 2 if enabled else 1, - "CF_Lkas_LdwsOpt_USM": lkas11["CF_Lkas_LdwsOpt_USM"] if keep_stock else 3, - } + +def create_lkas11(packer, frame, car_fingerprint, apply_steer, steer_req, + lkas11, sys_warning, sys_state, enabled, + left_lane, right_lane, + left_lane_depart, right_lane_depart): + values = lkas11 + values["CF_Lkas_LdwsSysState"] = sys_state + values["CF_Lkas_SysWarning"] = 3 if sys_warning else 0 + values["CF_Lkas_LdwsLHWarning"] = left_lane_depart + values["CF_Lkas_LdwsRHWarning"] = right_lane_depart + values["CR_Lkas_StrToqReq"] = apply_steer + values["CF_Lkas_ActToi"] = steer_req + values["CF_Lkas_ToiFlt"] = 0 + values["CF_Lkas_MsgCount"] = frame % 0x10 + values["CF_Lkas_Chksum"] = 0 + + if car_fingerprint == CAR.SONATA: + values["CF_Lkas_Bca_R"] = int(left_lane) + (int(right_lane) << 1) + values["CF_Lkas_LdwsOpt_USM"] = 2 + + # FcwOpt_USM 5 = Orange blinking car + lanes + # FcwOpt_USM 4 = Orange car + lanes + # FcwOpt_USM 3 = Green blinking car + lanes + # FcwOpt_USM 2 = Green car + lanes + # FcwOpt_USM 1 = White car + lanes + # FcwOpt_USM 0 = No car + lanes + values["CF_Lkas_FcwOpt_USM"] = 2 if enabled else 1 + + # 4 is keep hands on wheel + # 5 is keep hands on wheel (red) + # 6 is keep hands on wheel (red) + beep + values["CF_Lkas_SysWarning"] = 4 if sys_warning else 0 + + elif car_fingerprint == CAR.HYUNDAI_GENESIS: + # This field is actually LdwsActivemode + # Genesis and Optima fault when forwarding while engaged + values["CF_Lkas_Bca_R"] = 2 + elif car_fingerprint == CAR.KIA_OPTIMA: + values["CF_Lkas_Bca_R"] = 0 dat = packer.make_can_msg("LKAS11", 0, values)[2] @@ -36,7 +52,7 @@ def create_lkas11(packer, car_fingerprint, apply_steer, steer_req, cnt, enabled, elif car_fingerprint in CHECKSUM["6B"]: # Checksum of first 6 Bytes, as seen on 2018 Kia Sorento checksum = sum(dat[:6]) % 256 - elif car_fingerprint in CHECKSUM["7B"]: + else: # Checksum of first 6 Bytes and last Byte as seen on 2018 Kia Stinger checksum = (sum(dat[:6]) + dat[7]) % 256 @@ -44,20 +60,29 @@ def create_lkas11(packer, car_fingerprint, apply_steer, steer_req, cnt, enabled, return packer.make_can_msg("LKAS11", 0, values) -def create_clu11(packer, clu11, button): + +def create_clu11(packer, frame, clu11, button): + values = clu11 + values["CF_Clu_CruiseSwState"] = button + values["CF_Clu_CruiseSwState"] = frame % 0x10 + return packer.make_can_msg("CLU11", 0, values) + + +def create_lfa_mfa(packer, frame, enabled): values = { - "CF_Clu_CruiseSwState": button, - "CF_Clu_CruiseSwMain": clu11["CF_Clu_CruiseSwMain"], - "CF_Clu_SldMainSW": clu11["CF_Clu_SldMainSW"], - "CF_Clu_ParityBit1": clu11["CF_Clu_ParityBit1"], - "CF_Clu_VanzDecimal": clu11["CF_Clu_VanzDecimal"], - "CF_Clu_Vanz": clu11["CF_Clu_Vanz"], - "CF_Clu_SPEED_UNIT": clu11["CF_Clu_SPEED_UNIT"], - "CF_Clu_DetentOut": clu11["CF_Clu_DetentOut"], - "CF_Clu_RheostatLevel": clu11["CF_Clu_RheostatLevel"], - "CF_Clu_CluInfo": clu11["CF_Clu_CluInfo"], - "CF_Clu_AmpInfo": clu11["CF_Clu_AmpInfo"], - "CF_Clu_AliveCnt1": 0, + "ACTIVE": enabled, } - return packer.make_can_msg("CLU11", 0, values) + # ACTIVE 1 = Green steering wheel icon + + # LFA_USM 2 & 3 = LFA cancelled, fast loud beeping + # LFA_USM 0 & 1 = No mesage + + # LFA_SysWarning 1 = "Switching to HDA", short beep + # LFA_SysWarning 2 = "Switching to Smart Cruise control", short beep + # LFA_SysWarning 3 = LFA error + + # ACTIVE2: nothing + # HDA_USM: nothing + + return packer.make_can_msg("LFAHDA_MFC", 0, values) diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index c8246e124fcb68..c1ff9221aa1bd2 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -2,7 +2,7 @@ from cereal import car from selfdrive.config import Conversions as CV from selfdrive.controls.lib.drive_helpers import EventTypes as ET, create_event -from selfdrive.car.hyundai.values import Ecu, ECU_FINGERPRINT, CAR, get_hud_alerts, FINGERPRINTS +from selfdrive.car.hyundai.values import Ecu, ECU_FINGERPRINT, CAR, FINGERPRINTS from selfdrive.car import STD_CARGO_KG, scale_rot_inertia, scale_tire_stiffness, is_ecu_disconnected, gen_empty_fingerprint from selfdrive.car.interfaces import CarInterfaceBase @@ -20,9 +20,6 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.safetyModel = car.CarParams.SafetyModel.hyundai ret.radarOffCan = True - # Hyundai port is a community feature, since we don't own one to test - ret.communityFeature = True - ret.steerActuatorDelay = 0.1 # Default delay ret.steerRateCost = 0.5 ret.steerLimitTimer = 0.4 @@ -32,14 +29,20 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.pid.kf = 0.00005 ret.mass = 3982. * CV.LB_TO_KG + STD_CARGO_KG ret.wheelbase = 2.766 - # Values from optimizer ret.steerRatio = 16.55 # 13.8 is spec end-to-end tire_stiffness_factor = 0.82 - ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[9., 22.], [9., 22.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.2, 0.35], [0.05, 0.09]] ret.minSteerSpeed = 0. + elif candidate == CAR.SONATA: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 1513. + STD_CARGO_KG + ret.wheelbase = 2.84 + ret.steerRatio = 13.27 * 1.15 # 15% higher at the center seems reasonable + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + ret.minSteerSpeed = 0. elif candidate == CAR.KIA_SORENTO: ret.lateralTuning.pid.kf = 0.00005 ret.mass = 1985. + STD_CARGO_KG @@ -48,7 +51,7 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] ret.minSteerSpeed = 0. - elif candidate == CAR.ELANTRA: + elif candidate in [CAR.ELANTRA, CAR.ELANTRA_GT_I30]: ret.lateralTuning.pid.kf = 0.00006 ret.mass = 1275. + STD_CARGO_KG ret.wheelbase = 2.7 @@ -57,15 +60,21 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] ret.minSteerSpeed = 32 * CV.MPH_TO_MS - elif candidate == CAR.GENESIS: + elif candidate == CAR.HYUNDAI_GENESIS: ret.lateralTuning.pid.kf = 0.00005 ret.mass = 2060. + STD_CARGO_KG ret.wheelbase = 3.01 ret.steerRatio = 16.5 ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.16], [0.01]] - ret.minSteerSpeed = 35 * CV.MPH_TO_MS - elif candidate == CAR.KIA_OPTIMA: + ret.minSteerSpeed = 60 * CV.KPH_TO_MS + elif candidate in [CAR.GENESIS_G90, CAR.GENESIS_G80]: + ret.mass = 2200 + ret.wheelbase = 3.15 + ret.steerRatio = 12.069 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.16], [0.01]] + elif candidate in [CAR.KIA_OPTIMA, CAR.KIA_OPTIMA_H]: ret.lateralTuning.pid.kf = 0.00005 ret.mass = 3558. * CV.LB_TO_KG ret.wheelbase = 2.80 @@ -81,6 +90,48 @@ def get_params(candidate, fingerprint=gen_empty_fingerprint(), has_relay=False, ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] ret.minSteerSpeed = 0. + elif candidate == CAR.KONA: + ret.lateralTuning.pid.kf = 0.00006 + ret.mass = 1275. + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.steerRatio = 13.73 #Spec + tire_stiffness_factor = 0.385 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.IONIQ: + ret.lateralTuning.pid.kf = 0.00006 + ret.mass = 1275. + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.steerRatio = 13.73 #Spec + tire_stiffness_factor = 0.385 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + ret.minSteerSpeed = 32 * CV.MPH_TO_MS + elif candidate == CAR.KONA_EV: + ret.lateralTuning.pid.kf = 0.00006 + ret.mass = 1685. + STD_CARGO_KG + ret.wheelbase = 2.7 + ret.steerRatio = 13.73 #Spec + tire_stiffness_factor = 0.385 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + elif candidate == CAR.IONIQ_EV_LTD: + ret.lateralTuning.pid.kf = 0.00006 + ret.mass = 1490. + STD_CARGO_KG #weight per hyundai site https://www.hyundaiusa.com/ioniq-electric/specifications.aspx + ret.wheelbase = 2.7 + ret.steerRatio = 13.73 #Spec + tire_stiffness_factor = 0.385 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] + ret.minSteerSpeed = 32 * CV.MPH_TO_MS + elif candidate == CAR.KIA_FORTE: + ret.lateralTuning.pid.kf = 0.00005 + ret.mass = 3558. * CV.LB_TO_KG + ret.wheelbase = 2.80 + ret.steerRatio = 13.75 + tire_stiffness_factor = 0.5 + ret.lateralTuning.pid.kiBP, ret.lateralTuning.pid.kpBP = [[0.], [0.]] + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.05]] ret.centerToFront = ret.wheelbase * 0.4 @@ -108,6 +159,7 @@ def update(self, c, can_strings): ret.buttonEvents = [] events = self.create_common_events(ret) + #TODO: addd abs(self.CS.angle_steers) > 90 to 'steerTempUnavailable' event # low speed steer alert hysteresis logic (only for cars with steer cut off above 10 m/s) if ret.vEgo < (self.CP.minSteerSpeed + 2.) and self.CP.minSteerSpeed > 10.: @@ -123,10 +175,8 @@ def update(self, c, can_strings): return self.CS.out def apply(self, c): - - hud_alert = get_hud_alerts(c.hudControl.visualAlert) - - can_sends = self.CC.update(c.enabled, self.CS, c.actuators, - c.cruiseControl.cancel, hud_alert) - + can_sends = self.CC.update(c.enabled, self.CS, self.frame, c.actuators, + c.cruiseControl.cancel, c.hudControl.visualAlert, c.hudControl.leftLaneVisible, + c.hudControl.rightLaneVisible, c.hudControl.leftLaneDepart, c.hudControl.rightLaneDepart) + self.frame += 1 return can_sends diff --git a/selfdrive/car/hyundai/radar_interface.py b/selfdrive/car/hyundai/radar_interface.py index b2f76511360320..444fab781f0413 100644 --- a/selfdrive/car/hyundai/radar_interface.py +++ b/selfdrive/car/hyundai/radar_interface.py @@ -1,5 +1,77 @@ #!/usr/bin/env python3 +import os +import time +from cereal import car +from opendbc.can.parser import CANParser from selfdrive.car.interfaces import RadarInterfaceBase +from selfdrive.car.hyundai.values import DBC + + +def get_radar_can_parser(CP): + signals = [ + # sig_name, sig_address, default + ("ACC_ObjStatus", "SCC11", 0), + ("ACC_ObjLatPos", "SCC11", 0), + ("ACC_ObjDist", "SCC11", 0), + ("ACC_ObjRelSpd", "SCC11", 0), + ] + checks = [ + # address, frequency + ("SCC11", 50), + ] + return CANParser(DBC[CP.carFingerprint]['pt'], signals, checks, 0) + class RadarInterface(RadarInterfaceBase): - pass + def __init__(self, CP): + # radar + self.pts = {} + self.delay = 0 # Delay of radar + self.rcp = get_radar_can_parser(CP) + self.updated_messages = set() + self.trigger_msg = 0x420 + self.track_id = 0 + self.radar_off_can = CP.radarOffCan + + def update(self, can_strings): + if self.radar_off_can: + if 'NO_RADAR_SLEEP' not in os.environ: + time.sleep(0.05) # radard runs on RI updates + + return car.RadarData.new_message() + + vls = self.rcp.update_strings(can_strings) + self.updated_messages.update(vls) + + if self.trigger_msg not in self.updated_messages: + return None + + rr = self._update(self.updated_messages) + self.updated_messages.clear() + + return rr + + def _update(self, updated_messages): + ret = car.RadarData.new_message() + cpt = self.rcp.vl + errors = [] + if not self.rcp.can_valid: + errors.append("canError") + ret.errors = errors + + valid = cpt["SCC11"]['ACC_ObjStatus'] + if valid: + for ii in range(2): + if ii not in self.pts: + self.pts[ii] = car.RadarData.RadarPoint.new_message() + self.pts[ii].trackId = self.track_id + self.track_id += 1 + self.pts[ii].dRel = cpt["SCC11"]['ACC_ObjDist'] # from front of car + self.pts[ii].yRel = -cpt["SCC11"]['ACC_ObjLatPos'] # in car frame's y axis, left is negative + self.pts[ii].vRel = cpt["SCC11"]['ACC_ObjRelSpd'] + self.pts[ii].aRel = float('nan') + self.pts[ii].yvRel = float('nan') + self.pts[ii].measured = True + + ret.points = list(self.pts.values()) + return ret diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 7fe689c623a49b..1358bed2a870e2 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -2,16 +2,7 @@ from selfdrive.car import dbc_dict Ecu = car.CarParams.Ecu -VisualAlert = car.CarControl.HUDControl.VisualAlert - -def get_hud_alerts(visual_alert): - if visual_alert == VisualAlert.steerRequired: - return 5 - else: - return 0 - # Steer torque limits - class SteerLimitParams: STEER_MAX = 255 # 409 is the max, 255 is stock STEER_DELTA_UP = 3 @@ -20,13 +11,26 @@ class SteerLimitParams: STEER_DRIVER_MULTIPLIER = 2 STEER_DRIVER_FACTOR = 1 + class CAR: ELANTRA = "HYUNDAI ELANTRA LIMITED ULTIMATE 2017" - GENESIS = "HYUNDAI GENESIS 2018" - KIA_OPTIMA = "KIA OPTIMA SX 2019" + ELANTRA_GT_I30 = "HYUNDAI I30 N LINE 2019 & GT 2018 DCT" + GENESIS_G80 = "GENESIS G80 2017" + GENESIS_G90 = "GENESIS G90 2017" + HYUNDAI_GENESIS = "HYUNDAI GENESIS 2015-2016" + IONIQ = "HYUNDAI IONIQ HYBRID PREMIUM 2017" + IONIQ_EV_LTD = "HYUNDAI IONIQ ELECTRIC LIMITED 2019" + KIA_FORTE = "KIA FORTE E 2018" + KIA_OPTIMA = "KIA OPTIMA SX 2019 & 2016" + KIA_OPTIMA_H = "KIA OPTIMA HYBRID 2017 & SPORTS 2019" KIA_SORENTO = "KIA SORENTO GT LINE 2018" KIA_STINGER = "KIA STINGER GT2 2018" + KONA = "HYUNDAI KONA 2019" + KONA_EV = "HYUNDAI KONA ELECTRIC 2019" SANTA_FE = "HYUNDAI SANTA FE LIMITED 2019" + SANTA_FE_1 = "HYUNDAI SANTA FE has no scc" + SONATA = "HYUNDAI SONATA 2020" + class Buttons: NONE = 0 @@ -38,12 +42,42 @@ class Buttons: CAR.ELANTRA: [{ 66: 8, 67: 8, 68: 8, 127: 8, 273: 8, 274: 8, 275: 8, 339: 8, 356: 4, 399: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 897: 8, 832: 8, 899: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1170: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1314: 8, 1322: 8, 1345: 8, 1349: 8, 1351: 8, 1353: 8, 1363: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1415: 8, 1419: 8, 1425: 2, 1427: 6, 1440: 8, 1456: 4, 1472: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8, 1532: 5, 2001: 8, 2003: 8, 2004: 8, 2009: 8, 2012: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 }], - CAR.GENESIS: [{ + CAR.ELANTRA_GT_I30: [{ + 66: 8, 67: 8, 68: 8, 127: 8, 128: 8, 129: 8, 273: 8, 274: 8, 275: 8, 339: 8, 354: 3, 356: 4, 399: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 884: 8, 897: 8, 899: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1193: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1356: 8, 1363: 8, 1365: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1415: 8, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8, 1952: 8, 1960: 8, 1988: 8, 2000: 8, 2001: 8, 2005: 8, 2008: 8, 2009: 8, 2013: 8, 2017: 8, 2025: 8 + }, + { + 66: 8, 67: 8, 68: 8, 127: 8, 128: 8, 129: 8, 273: 8, 274: 8, 275: 8, 339: 8, 354: 3, 356: 4, 399: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 832: 8, 897: 8, 899: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1356: 8, 1363: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1415: 8, 1419: 8, 1440: 8, 1456: 4, 1470: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8 + }, + { + 66: 8, 67: 8, 68: 8, 127: 8, 128: 8, 129: 8, 273: 8, 274: 8, 275: 8, 339: 8, 354: 3, 356: 4, 399: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 832: 8, 897: 8, 899: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1356: 8, 1363: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1486: 8, 1487: 8, 1491: 8, 1960: 8, 1990: 8, 1998: 8, 2000: 8, 2001: 8, 2004: 8, 2005: 8, 2008: 8, 2009: 8, 2012: 8, 2013: 8, 2015: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 + }], + CAR.HYUNDAI_GENESIS: [{ 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 916: 8, 1024: 2, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1342: 6, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 5, 1407: 8, 1419: 8, 1427: 6, 1434: 2, 1456: 4 }, { 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 916: 8, 1024: 2, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 3, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1378: 4, 1379: 8, 1384: 5, 1407: 8, 1419: 8, 1427: 6, 1434: 2, 1456: 4 + }, + { + 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 912: 7, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1268: 8, 1280: 1, 1281: 3, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 5, 1407: 8, 1419: 8, 1427: 6, 1434: 2, 1437: 8, 1456: 4 + }, + { + 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1378: 4, 1379: 8, 1384: 5, 1407: 8, 1425: 2, 1427: 6, 1437: 8, 1456: 4 + }, + { + 67: 8, 68: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 7, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 5, 897: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1287: 4, 1292: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1334: 8, 1335: 8, 1345: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 5, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1437: 8, 1456: 4 }], + CAR.SANTA_FE: [{ + 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 6, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1155: 8, 1156: 8, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1379: 8, 1384: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8 + }, + { + 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 6, 764: 8, 809: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1155: 8, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1180: 8, 1183: 8, 1186: 2, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1384: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8, 1988: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8 + }, + { + 67: 8, 68: 8, 80: 4, 160: 8, 161: 8, 272: 8, 288: 4, 339: 8, 356: 8, 357: 8, 399: 8, 544: 8, 608: 8, 672: 8, 688: 5, 704: 1, 790: 8, 809: 8, 848: 8, 880: 8, 898: 8, 900: 8, 901: 8, 904: 8, 1056: 8, 1064: 8, 1065: 8, 1072: 8, 1075: 8, 1087: 8, 1088: 8, 1151: 8, 1200: 8, 1201: 8, 1232: 4, 1264: 8, 1265: 8, 1266: 8, 1296: 8, 1306: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1348: 8, 1349: 8, 1369: 8, 1370: 8, 1371: 8, 1407: 8, 1415: 8, 1419: 8, 1440: 8, 1442: 4, 1461: 8, 1470: 8 + }], + CAR.SONATA: [ + {67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 545: 8, 546: 8, 547: 8, 548: 8, 549: 8, 550: 8, 576: 8, 593: 8, 608: 8, 688: 6, 809: 8, 832: 8, 854: 8, 865: 8, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 908: 8, 909: 8, 912: 7, 913: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1089: 5, 1107: 5, 1108: 8, 1114: 8, 1136: 8, 1145: 8, 1151: 8, 1155: 8, 1156: 8, 1157: 4, 1162: 8, 1164: 8, 1168: 8, 1170: 8, 1173: 8, 1180: 8, 1183: 8, 1184: 8, 1186: 2, 1191: 2, 1193: 8, 1210: 8, 1225: 8, 1227: 8, 1265: 4, 1268: 8, 1280: 8, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1330: 8, 1339: 8, 1342: 6, 1343: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1384: 8, 1394: 8, 1407: 8, 1419: 8, 1427: 6, 1446: 8, 1456: 4, 1460: 8, 1470: 8, 1485: 8, 1504: 3}, + ], CAR.KIA_OPTIMA: [ { 64: 8, 66: 8, 67: 8, 68: 8, 127: 8, 273: 8, 274: 8, 275: 8, 339: 8, 356: 4, 399: 8, 447: 8, 512: 6, 544: 8, 593: 8, 608: 8, 688: 5, 790: 8, 809: 8, 832: 8, 884: 8, 897: 8, 899: 8, 902: 8, 903: 6, 909: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1151: 6, 1168: 7, 1170: 8, 1186: 2, 1191: 2, 1253: 8, 1254: 8, 1255: 8, 1265: 4, 1280: 1, 1282: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1349: 8, 1351: 8, 1353: 8, 1363: 8, 1365: 8, 1366: 8, 1367: 8, 1369: 8, 1407: 8, 1414: 3, 1415: 8, 1419: 8, 1425: 2, 1427: 6, 1440: 8, 1456: 4, 1470: 8, 1472: 8, 1486: 8, 1487: 8, 1491: 8, 1530: 8, 1532: 5, 1952: 8, 1960: 8, 1988: 8, 1996: 8, 2001: 8, 2004: 8, 2008: 8, 2009: 8, 2012: 8, 2016: 8, 2017: 8, 2024: 8, 2025: 8 @@ -58,13 +92,39 @@ class Buttons: CAR.KIA_STINGER: [{ 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 359: 8, 544: 8, 576: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 4, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1378: 4, 1379: 8, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1456: 4, 1470: 8 }], - CAR.SANTA_FE: [{ - 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 6, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1155: 8, 1156: 8, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1379: 8, 1384: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8 + CAR.GENESIS_G80: [{ + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1024: 2, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1156: 8, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1191: 2, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1434: 2, 1456: 4, 1470: 8 }, { - 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 6, 764: 8, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1155: 8, 1162: 8, 1164: 8, 1168: 7, 1170: 8, 1173: 8, 1180: 8, 1183: 8, 1186: 2, 1227: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 8, 1384: 8, 1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8, 1988: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8 - } - ], + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 359: 8, 544: 8, 546: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 3, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1434: 2, 1437: 8, 1456: 4, 1470: 8 + }, + { + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1064: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1156: 8, 1157: 4, 1162: 8, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1193: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1437: 8, 1456: 4, 1470: 8 + }], + CAR.GENESIS_G90: [{ + 67: 8, 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 358: 6, 359: 8, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1107: 5, 1136: 8, 1151: 6, 1162: 4, 1168: 7, 1170: 8, 1173: 8, 1184: 8, 1265: 4, 1280: 1, 1281: 3, 1287: 4, 1290: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1370: 8, 1371: 8, 1378: 4, 1384: 8, 1407: 8, 1419: 8, 1425: 2, 1427: 6, 1434: 2, 1456: 4, 1470: 8, 1988: 8, 2000: 8, 2003: 8, 2004: 8, 2005: 8, 2008: 8, 2011: 8, 2012: 8, 2013: 8 + }], + CAR.IONIQ: [{ + 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 576: 8, 593: 8, 688: 5, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1173: 8, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1322: 8, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1419: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470:8, 1476: 8, 1535: 8 + }], + CAR.IONIQ_EV_LTD: [{ + 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 7, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1168: 7, 1173: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1407: 8, 1419: 8, 1425: 2, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1507: 8, 1535: 8 + }], + CAR.KONA: [{ + 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 354: 3, 356: 4, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 909: 8, 916: 8, 1040: 8, 1078: 4, 1107: 5, 1136: 8, 1156: 8, 1170: 8, 1173: 8, 1191: 2, 1265: 4, 1280: 1, 1287: 4, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1384: 8, 1394: 8,1407: 8, 1414: 3, 1419: 8, 1427: 6, 1456: 4, 1470: 8, 2004: 8, 2009: 8, 2012: 8 + }], + CAR.KONA_EV: [{ + 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 549: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 905: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 8, 1151: 6, 1168: 7, 1173: 8, 1183: 8, 1186: 2, 1191: 2, 1225: 8, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1307: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1378: 4, 1407: 8, 1419: 8, 1426: 8, 1427: 6, 1429: 8, 1430: 8, 1456: 4, 1470: 8, 1473: 8, 1507: 8, 1535: 8, 2000: 8, 2004: 8, 2008: 8, 2012: 8 + }], + CAR.KIA_FORTE: [{ + 67: 8, 127: 8, 304: 8, 320: 8, 339: 8, 356: 4, 544: 8, 593: 8, 608: 8, 688: 5, 809: 8, 832: 8, 854: 7, 870: 7, 871: 8, 872: 8, 897: 8, 902: 8, 903: 8, 909: 8, 916: 8, 1040: 8, 1042: 8, 1078: 4, 1107: 5, 1136: 8, 1156: 8, 1170: 8, 1173: 8, 1191: 2, 1225: 8, 1265: 4, 1280: 4, 1287: 4, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1363: 8, 1369: 8, 1384: 8, 1394: 8, 1407: 8, 1427: 6, 1456: 4, 1470: 8 + }], + CAR.KIA_OPTIMA_H: [{ + 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 593: 8, 688: 5, 832: 8, 881: 8, 882: 8, 897: 8, 902: 8, 903: 6, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1168: 7, 1173: 8, 1236: 2, 1265: 4, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1322: 8, 1331: 8, 1332: 8, 1333: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1407: 8, 1419: 8, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8 + }, + { + 68: 8, 127: 8, 304: 8, 320: 8, 339: 8, 352: 8, 356: 4, 544: 8, 576: 8, 593: 8, 688: 5, 881: 8, 882: 8, 897: 8, 902: 8, 903: 8, 909: 8, 912: 7, 916: 8, 1040: 8, 1056: 8, 1057: 8, 1078: 4, 1136: 6, 1151: 6, 1168: 7, 1173: 8, 1180: 8, 1186: 2, 1191: 2, 1265: 4, 1268: 8, 1280: 1, 1287: 4, 1290: 8, 1291: 8, 1292: 8, 1294: 8, 1312: 8, 1322: 8, 1342: 6, 1345: 8, 1348: 8, 1355: 8, 1363: 8, 1369: 8, 1371: 8, 1407: 8, 1419: 8, 1420: 8, 1425: 2, 1427: 6, 1429: 8, 1430: 8, 1448: 8, 1456: 4, 1470: 8, 1476: 8, 1535: 8 + }], } ECU_FINGERPRINT = { @@ -72,23 +132,33 @@ class Buttons: } CHECKSUM = { - "crc8": [CAR.SANTA_FE], - "6B": [CAR.KIA_SORENTO, CAR.GENESIS], - "7B": [CAR.KIA_STINGER, CAR.ELANTRA, CAR.KIA_OPTIMA], + "crc8": [CAR.SANTA_FE, CAR.SONATA], + "6B": [CAR.KIA_SORENTO, CAR.HYUNDAI_GENESIS], } FEATURES = { - "use_cluster_gears": [CAR.ELANTRA], # Use Cluster for Gear Selection, rather than Transmission - "use_tcu_gears": [CAR.KIA_OPTIMA], # Use TCU Message for Gear Selection + "use_cluster_gears": [CAR.ELANTRA, CAR.KONA, CAR.ELANTRA_GT_I30], # Use Cluster for Gear Selection, rather than Transmission + "use_tcu_gears": [CAR.KIA_OPTIMA], # Use TCU Message for Gear Selection + "use_elect_gears": [CAR.KIA_OPTIMA_H, CAR.IONIQ_EV_LTD, CAR.KONA_EV], # Use TCU Message for Gear Selection } DBC = { CAR.ELANTRA: dbc_dict('hyundai_kia_generic', None), - CAR.GENESIS: dbc_dict('hyundai_kia_generic', None), + CAR.ELANTRA_GT_I30: dbc_dict('hyundai_kia_generic', None), + CAR.GENESIS_G80: dbc_dict('hyundai_kia_generic', None), + CAR.GENESIS_G90: dbc_dict('hyundai_kia_generic', None), + CAR.HYUNDAI_GENESIS: dbc_dict('hyundai_kia_generic', None), + CAR.IONIQ: dbc_dict('hyundai_kia_generic', None), + CAR.IONIQ_EV_LTD: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_FORTE: dbc_dict('hyundai_kia_generic', None), CAR.KIA_OPTIMA: dbc_dict('hyundai_kia_generic', None), + CAR.KIA_OPTIMA_H: dbc_dict('hyundai_kia_generic', None), CAR.KIA_SORENTO: dbc_dict('hyundai_kia_generic', None), CAR.KIA_STINGER: dbc_dict('hyundai_kia_generic', None), + CAR.KONA: dbc_dict('hyundai_kia_generic', None), + CAR.KONA_EV: dbc_dict('hyundai_kia_generic', None), CAR.SANTA_FE: dbc_dict('hyundai_kia_generic', None), + CAR.SONATA: dbc_dict('hyundai_kia_generic', None), } -STEER_THRESHOLD = 100 +STEER_THRESHOLD = 150 diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit index c6b5354ad2d908..fb8118eea16d3a 100644 --- a/selfdrive/test/process_replay/ref_commit +++ b/selfdrive/test/process_replay/ref_commit @@ -1 +1 @@ -3523742130b9e0554bab4ac5bc5ab535f1342e90 \ No newline at end of file +9638f1d5495e92b2d633a193f00a65f8268b170c \ No newline at end of file diff --git a/selfdrive/test/process_replay/test_processes.py b/selfdrive/test/process_replay/test_processes.py index 6425d38a7f5f2a..68571ba601f053 100755 --- a/selfdrive/test/process_replay/test_processes.py +++ b/selfdrive/test/process_replay/test_processes.py @@ -19,7 +19,7 @@ ("TOYOTA", "77611a1fac303767|2020-02-29--13-29-33--3"), # TOYOTA.COROLLA_TSS2 ("GM", "7cc2a8365b4dd8a9|2018-12-02--12-10-44--2"), # GM.ACADIA ("CHRYSLER", "b6849f5cf2c926b1|2020-02-28--07-29-48--13"), # CHRYSLER.PACIFICA - ("HYUNDAI", "38bfd238edecbcd7|2018-08-29--22-02-15--4"), # HYUNDAI.SANTA_FE + ("HYUNDAI", "5b7c365c50084530|2020-04-15--16-13-24--3"), # HYUNDAI.SONATA #("CHRYSLER", "b6e1317e1bfbefa6|2020-03-04--13-11-40"), # CHRYSLER.JEEP_CHEROKEE ("SUBARU", "7873afaf022d36e2|2019-07-03--18-46-44--0"), # SUBARU.IMPREZA ("VOLKSWAGEN", "76b83eb0245de90e|2020-03-05--19-16-05--3"), # VW.GOLF diff --git a/selfdrive/test/test_car_models.py b/selfdrive/test/test_car_models.py index 23408cf057d039..3f2b81002c1742 100755 --- a/selfdrive/test/test_car_models.py +++ b/selfdrive/test/test_car_models.py @@ -172,6 +172,10 @@ def get_route_log(route_name): 'carFingerprint': HYUNDAI.KIA_OPTIMA, 'enableCamera': True, }, + "5b7c365c50084530|2020-04-15--16-13-24": { + 'carFingerprint': HYUNDAI.SONATA, + 'enableCamera': True, + }, "f7b6be73e3dfd36c|2019-05-12--18-07-16": { 'carFingerprint': TOYOTA.AVALON, 'enableCamera': False, @@ -336,6 +340,7 @@ def get_route_log(route_name): 'carFingerprint': NISSAN.LEAF, 'enableCamera': True, }, + } passive_routes = [ @@ -352,8 +357,8 @@ def get_route_log(route_name): CHRYSLER.JEEP_CHEROKEE, CHRYSLER.JEEP_CHEROKEE_2019, CHRYSLER.PACIFICA_2018, - CHRYSLER.PACIFICA_2020, CHRYSLER.PACIFICA_2018_HYBRID, + CHRYSLER.PACIFICA_2020, GM.CADILLAC_ATS, GM.HOLDEN_ASTRA, GM.MALIBU, @@ -361,9 +366,19 @@ def get_route_log(route_name): HONDA.CRV, HONDA.RIDGELINE, HYUNDAI.ELANTRA, - HYUNDAI.GENESIS, + HYUNDAI.ELANTRA_GT_I30, + HYUNDAI.GENESIS_G80, + HYUNDAI.GENESIS_G90, + HYUNDAI.HYUNDAI_GENESIS, + HYUNDAI.IONIQ, + HYUNDAI.IONIQ_EV_LTD, + HYUNDAI.KIA_FORTE, + HYUNDAI.KIA_OPTIMA, + HYUNDAI.KIA_OPTIMA_H, HYUNDAI.KIA_SORENTO, HYUNDAI.KIA_STINGER, + HYUNDAI.KONA, + HYUNDAI.KONA_EV, TOYOTA.CAMRYH, TOYOTA.CHR, TOYOTA.CHRH,