mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 17:43:54 +08:00
HKG: 2019 Kia Niro PHEV (#21481)
* Testing addition of 2019 Kira Niro PHEV
* Testing addition of 2019 Kia Niro PHEV
* Fix typos
* Remove bad Optima fw, switch Niro to FPv2
* Set minimum steer speed for 2019 Kia Niro HEV/PHEV
* Add 2019 Kia Niro PHEV to README
* Fix typo
* apparently we get trailing garbage sometimes
* No FCA11 message, also use ELECT_GEAR
* i am not good with alphabet
* Add test route for Niro HEV
* Remove LFA for 2019; no legacy safety
* minSteerSpeed handling
* vehicle disengages SCC below 10mph
* no longer need Genesis specific code for minSteerSpeed
* simplify
old-commit-hash: cfe97fcc49
This commit is contained in:
@@ -156,7 +156,7 @@ Community Maintained Cars and Features
|
||||
| Holden | Astra 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
|
||||
| Hyundai | Elantra 2017-19 | SCC + LKAS | Stock | 19mph | 34mph |
|
||||
| Hyundai | Elantra 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Elantra Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Elantra Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Hyundai | Genesis 2015-16 | SCC + LKAS | Stock | 19mph | 37mph |
|
||||
| Hyundai | Ioniq Electric 2019 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Hyundai | Ioniq Electric 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
@@ -170,6 +170,7 @@ Community Maintained Cars and Features
|
||||
| Jeep | Grand Cherokee 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
|
||||
| Kia | Forte 2018-2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Niro EV 2020 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Niro PHEV 2019 | SCC + LKAS | Stock | 10mph | 32mph |
|
||||
| Kia | Optima 2017 | SCC + LKAS | Stock | 0mph | 32mph |
|
||||
| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
| Kia | Seltos 2021 | SCC + LKAS | Stock | 0mph | 0mph |
|
||||
|
||||
@@ -49,12 +49,8 @@ class CarController():
|
||||
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, self.p)
|
||||
self.steer_rate_limited = new_steer != apply_steer
|
||||
|
||||
# disable when temp fault is active
|
||||
lkas_active = enabled and not CS.out.steerWarning
|
||||
|
||||
# fix for Genesis hard fault at low speed
|
||||
if CS.out.vEgo < 16.7 and self.car_fingerprint == CAR.HYUNDAI_GENESIS:
|
||||
lkas_active = False
|
||||
# disable when temp fault is active, or below LKA minimum speed
|
||||
lkas_active = enabled and not CS.out.steerWarning and CS.out.vEgo >= CS.CP.minSteerSpeed
|
||||
|
||||
if not lkas_active:
|
||||
apply_steer = 0
|
||||
|
||||
@@ -143,7 +143,7 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.steerRatio = 14.4 * 1.1 # 10% 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]]
|
||||
elif candidate == CAR.KIA_NIRO_EV:
|
||||
elif candidate in [CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV]:
|
||||
ret.lateralTuning.pid.kf = 0.00006
|
||||
ret.mass = 1737. + STD_CARGO_KG
|
||||
ret.wheelbase = 2.7
|
||||
@@ -151,6 +151,8 @@ class CarInterface(CarInterfaceBase):
|
||||
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]]
|
||||
if candidate == CAR.KIA_NIRO_HEV:
|
||||
ret.minSteerSpeed = 32 * CV.MPH_TO_MS
|
||||
elif candidate == CAR.KIA_SELTOS:
|
||||
ret.mass = 1337. + STD_CARGO_KG
|
||||
ret.wheelbase = 2.63
|
||||
|
||||
@@ -40,6 +40,7 @@ class CAR:
|
||||
# Kia
|
||||
KIA_FORTE = "KIA FORTE E 2018 & GT 2021"
|
||||
KIA_NIRO_EV = "KIA NIRO EV 2020"
|
||||
KIA_NIRO_HEV = "KIA NIRO HYBRID 2019"
|
||||
KIA_OPTIMA = "KIA OPTIMA SX 2019 & 2016"
|
||||
KIA_OPTIMA_H = "KIA OPTIMA HYBRID 2017 & SPORTS 2019"
|
||||
KIA_SELTOS = "KIA SELTOS 2021"
|
||||
@@ -384,13 +385,6 @@ FW_VERSIONS = {
|
||||
b'\xf1\x87WAJTE17552812CH4vfFffvfVeT5DwvvVVdFeegeg\x88\x88o\xff\x1a]\xf1\x81E21\x00\x00\x00\x00\x00\x00\x00\xf1\x00bcsh8p54 E21\x00\x00\x00\x00\x00\x00\x00TCK2T20NB1\x19\xd2\x00\x94',
|
||||
],
|
||||
},
|
||||
CAR.KIA_OPTIMA_H: {
|
||||
(Ecu.fwdRadar, 0x7d0, None): [b'\xf1\x00DEhe SCC H-CUP 1.01 1.02 96400-G5100 ',],
|
||||
(Ecu.engine, 0x7e0, None): [b'\xf1\x816H6F4051\x00\x00\x00\x00\x00\x00\x00\x00',],
|
||||
(Ecu.eps, 0x7d4, None): [b'\xf1\x00DE MDPS C 1.00 1.09 56310G5301\x00 4DEHC109',],
|
||||
(Ecu.fwdCamera, 0x7c4, None): [b'\xf1\x00DEP MFC AT USA LHD 1.00 1.01 95740-G5010 170424',],
|
||||
(Ecu.transmission, 0x7e1, None): [b"\xf1\x816U3J2051\x00\x00\xf1\x006U3H0_C2\x00\x006U3J2051\x00\x00PDE0G16NS2\xf4'\\\x91",],
|
||||
},
|
||||
CAR.PALISADE: {
|
||||
(Ecu.fwdRadar, 0x7d0, None): [
|
||||
b'\xf1\000LX2_ SCC F-CUP 1.00 1.05 99110-S8100 \xf1\xa01.05',
|
||||
@@ -569,6 +563,24 @@ FW_VERSIONS = {
|
||||
b'\xf1\x00OSE LKAS AT EUR LHD 1.00 1.00 95740-K4100 W40',
|
||||
],
|
||||
},
|
||||
CAR.KIA_NIRO_HEV: {
|
||||
(Ecu.engine, 0x7e0, None): [
|
||||
b'\xf1\x816H6F4051\000\000\000\000\000\000\000\000',
|
||||
],
|
||||
(Ecu.transmission, 0x7e1, None): [
|
||||
b"\xf1\x816U3J2051\000\000\xf1\0006U3H0_C2\000\0006U3J2051\000\000PDE0G16NS2\xf4\'\\\x91",
|
||||
b'\xf1\x816U3J2051\000\000\xf1\0006U3H0_C2\000\0006U3J2051\000\000PDE0G16NS2\000\000\000\000',
|
||||
],
|
||||
(Ecu.eps, 0x7D4, None): [
|
||||
b'\xf1\000DE MDPS C 1.00 1.09 56310G5301\000 4DEHC109',
|
||||
],
|
||||
(Ecu.fwdCamera, 0x7C4, None): [
|
||||
b'\xf1\000DEP MFC AT USA LHD 1.00 1.01 95740-G5010 170424',
|
||||
],
|
||||
(Ecu.fwdRadar, 0x7D0, None): [
|
||||
b'\xf1\000DEhe SCC H-CUP 1.01 1.02 96400-G5100 ',
|
||||
],
|
||||
},
|
||||
CAR.KIA_SELTOS: {
|
||||
(Ecu.fwdRadar, 0x7d0, None): [b'\xf1\x8799110Q5100\xf1\000SP2_ SCC FHCUP 1.01 1.05 99110-Q5100 \xf1\xa01.05',],
|
||||
(Ecu.esp, 0x7d1, None): [
|
||||
@@ -652,13 +664,13 @@ FEATURES = {
|
||||
# which message has the gear
|
||||
"use_cluster_gears": set([CAR.ELANTRA, CAR.ELANTRA_GT_I30, CAR.KONA]),
|
||||
"use_tcu_gears": set([CAR.KIA_OPTIMA, CAR.SONATA_LF, CAR.VELOSTER]),
|
||||
"use_elect_gears": set([CAR.KIA_NIRO_EV, CAR.KIA_OPTIMA_H, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.IONIQ, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021]),
|
||||
"use_elect_gears": set([CAR.KIA_NIRO_EV, CAR.KIA_NIRO_HEV, CAR.KIA_OPTIMA_H, CAR.IONIQ_EV_LTD, CAR.KONA_EV, CAR.IONIQ, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021]),
|
||||
|
||||
# these cars use the FCA11 message for the AEB and FCW signals, all others use SCC12
|
||||
"use_fca": set([CAR.SONATA, CAR.ELANTRA, CAR.ELANTRA_2021, CAR.ELANTRA_HEV_2021, CAR.ELANTRA_GT_I30, CAR.KIA_STINGER, CAR.IONIQ, CAR.IONIQ_EV_2020, CAR.IONIQ_PHEV, CAR.KONA_EV, CAR.KIA_FORTE, CAR.KIA_NIRO_EV, CAR.PALISADE, CAR.GENESIS_G70, CAR.KONA, CAR.SANTA_FE, CAR.KIA_SELTOS]),
|
||||
}
|
||||
|
||||
HYBRID_CAR = set([CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021]) # these cars use a different gas signal
|
||||
HYBRID_CAR = set([CAR.IONIQ_PHEV, CAR.ELANTRA_HEV_2021, CAR.KIA_NIRO_HEV]) # these cars use a different gas signal
|
||||
EV_CAR = set([CAR.IONIQ_EV_2020, CAR.IONIQ_EV_LTD, CAR.IONIQ, CAR.KONA_EV, CAR.KIA_NIRO_EV])
|
||||
|
||||
DBC = {
|
||||
@@ -676,6 +688,7 @@ DBC = {
|
||||
CAR.IONIQ: dbc_dict('hyundai_kia_generic', None),
|
||||
CAR.KIA_FORTE: dbc_dict('hyundai_kia_generic', None),
|
||||
CAR.KIA_NIRO_EV: dbc_dict('hyundai_kia_generic', None),
|
||||
CAR.KIA_NIRO_HEV: 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_SELTOS: dbc_dict('hyundai_kia_generic', None),
|
||||
|
||||
@@ -83,6 +83,7 @@ routes = [
|
||||
TestRoute("5dddcbca6eb66c62|2020-07-26--13-24-19", HYUNDAI.KIA_STINGER),
|
||||
TestRoute("d624b3d19adce635|2020-08-01--14-59-12", HYUNDAI.VELOSTER),
|
||||
TestRoute("50c6c9b85fd1ff03|2020-10-26--17-56-06", HYUNDAI.KIA_NIRO_EV),
|
||||
TestRoute("173219cf50acdd7b|2021-07-05--10-27-41", HYUNDAI.KIA_NIRO_HEV),
|
||||
TestRoute("50a2212c41f65c7b|2021-05-24--16-22-06", HYUNDAI.KIA_FORTE),
|
||||
TestRoute("c5ac319aa9583f83|2021-06-01--18-18-31", HYUNDAI.ELANTRA),
|
||||
TestRoute("82e9cdd3f43bf83e|2021-05-15--02-42-51", HYUNDAI.ELANTRA_2021),
|
||||
|
||||
Reference in New Issue
Block a user