platformconfig and carspecs are now required, carspecs no longer kwarg (#31667)

* required

* mock can be a platform!

* default is mock

* fix that

* and that one
old-commit-hash: b0eae8c1b7
chrysler-long2
Justin Newberry 1 year ago committed by GitHub
parent 3ec004d482
commit e9ca84c95c
  1. 5
      selfdrive/car/__init__.py
  2. 2
      selfdrive/car/body/values.py
  3. 15
      selfdrive/car/car_helpers.py
  4. 20
      selfdrive/car/chrysler/values.py
  5. 16
      selfdrive/car/ford/values.py
  6. 28
      selfdrive/car/gm/values.py
  7. 44
      selfdrive/car/honda/values.py
  8. 130
      selfdrive/car/hyundai/values.py
  9. 18
      selfdrive/car/interfaces.py
  10. 12
      selfdrive/car/mazda/values.py
  11. 16
      selfdrive/car/mock/values.py
  12. 10
      selfdrive/car/nissan/values.py
  13. 30
      selfdrive/car/subaru/values.py
  14. 4
      selfdrive/car/tesla/values.py
  15. 10
      selfdrive/car/tests/test_platform_configs.py
  16. 68
      selfdrive/car/toyota/values.py
  17. 56
      selfdrive/car/volkswagen/values.py
  18. 5
      selfdrive/controls/tests/test_state_machine.py

@ -266,10 +266,11 @@ class CarSpecs:
class PlatformConfig(Freezable):
platform_str: str
car_info: CarInfos
specs: CarSpecs
dbc_dict: DbcDict
flags: int = 0
specs: CarSpecs | None = None
flags: int = 0
def __hash__(self) -> int:
return hash(self.platform_str)

@ -23,8 +23,8 @@ class CAR(Platforms):
BODY = PlatformConfig(
"COMMA BODY",
CarInfo("comma body", package="All"),
CarSpecs(mass=9, wheelbase=0.406, steerRatio=0.5, centerToFrontRatio=0.44),
dbc_dict('comma_body', None),
specs=CarSpecs(mass=9, wheelbase=0.406, steerRatio=0.5, centerToFrontRatio=0.44)
)

@ -11,6 +11,7 @@ from openpilot.selfdrive.car.interfaces import get_interface_attr
from openpilot.selfdrive.car.fingerprints import eliminate_incompatible_cars, all_legacy_fingerprint_cars
from openpilot.selfdrive.car.vin import get_vin, is_valid_vin, VIN_UNKNOWN
from openpilot.selfdrive.car.fw_versions import get_fw_versions_ordered, get_present_ecus, match_fw_to_car, set_obd_multiplexing
from openpilot.selfdrive.car.mock.values import CAR as MOCK
from openpilot.common.swaglog import cloudlog
import cereal.messaging as messaging
from openpilot.selfdrive.car import gen_empty_fingerprint
@ -191,7 +192,7 @@ def fingerprint(logcan, sendcan, num_pandas):
fw_count=len(car_fw), ecu_responses=list(ecu_rx_addrs), vin_rx_addr=vin_rx_addr, vin_rx_bus=vin_rx_bus,
fingerprints=repr(finger), fw_query_time=fw_query_time, error=True)
car_platform = PLATFORMS.get(car_fingerprint, car_fingerprint)
car_platform = PLATFORMS.get(car_fingerprint, MOCK.MOCK)
return car_platform, finger, vin, car_fw, source, exact_match
@ -212,14 +213,14 @@ def get_car(logcan, sendcan, experimental_long_allowed, num_pandas=1):
return CarInterface(CP, CarController, CarState), CP
def write_car_param(fingerprint="mock"):
def write_car_param(platform=MOCK.MOCK):
params = Params()
CarInterface, _, _ = interfaces[fingerprint]
CP = CarInterface.get_non_essential_params(fingerprint)
CarInterface, _, _ = interfaces[platform]
CP = CarInterface.get_non_essential_params(platform)
params.put("CarParams", CP.to_bytes())
def get_demo_car_params():
fingerprint="mock"
CarInterface, _, _ = interfaces[fingerprint]
CP = CarInterface.get_non_essential_params(fingerprint)
platform = MOCK.MOCK
CarInterface, _, _ = interfaces[platform]
CP = CarInterface.get_non_essential_params(platform)
return CP

@ -35,22 +35,22 @@ class CAR(Platforms):
PACIFICA_2017_HYBRID = ChryslerPlatformConfig(
"CHRYSLER PACIFICA HYBRID 2017",
ChryslerCarInfo("Chrysler Pacifica Hybrid 2017"),
specs=ChryslerCarSpecs(mass=2242., wheelbase=3.089, steerRatio=16.2),
ChryslerCarSpecs(mass=2242., wheelbase=3.089, steerRatio=16.2),
)
PACIFICA_2018_HYBRID = ChryslerPlatformConfig(
"CHRYSLER PACIFICA HYBRID 2018",
ChryslerCarInfo("Chrysler Pacifica Hybrid 2018"),
specs=PACIFICA_2017_HYBRID.specs,
PACIFICA_2017_HYBRID.specs,
)
PACIFICA_2019_HYBRID = ChryslerPlatformConfig(
"CHRYSLER PACIFICA HYBRID 2019",
ChryslerCarInfo("Chrysler Pacifica Hybrid 2019-23"),
specs=PACIFICA_2017_HYBRID.specs,
PACIFICA_2017_HYBRID.specs,
)
PACIFICA_2018 = ChryslerPlatformConfig(
"CHRYSLER PACIFICA 2018",
ChryslerCarInfo("Chrysler Pacifica 2017-18"),
specs=PACIFICA_2017_HYBRID.specs,
PACIFICA_2017_HYBRID.specs,
)
PACIFICA_2020 = ChryslerPlatformConfig(
"CHRYSLER PACIFICA 2020",
@ -58,35 +58,35 @@ class CAR(Platforms):
ChryslerCarInfo("Chrysler Pacifica 2019-20"),
ChryslerCarInfo("Chrysler Pacifica 2021-23", package="All"),
],
specs=PACIFICA_2017_HYBRID.specs,
PACIFICA_2017_HYBRID.specs,
)
# Dodge
DODGE_DURANGO = ChryslerPlatformConfig(
"DODGE DURANGO 2021",
ChryslerCarInfo("Dodge Durango 2020-21"),
specs=PACIFICA_2017_HYBRID.specs,
PACIFICA_2017_HYBRID.specs,
)
# Jeep
JEEP_GRAND_CHEROKEE = ChryslerPlatformConfig( # includes 2017 Trailhawk
"JEEP GRAND CHEROKEE V6 2018",
ChryslerCarInfo("Jeep Grand Cherokee 2016-18", video_link="https://www.youtube.com/watch?v=eLR9o2JkuRk"),
specs=ChryslerCarSpecs(mass=1778., wheelbase=2.71, steerRatio=16.7),
ChryslerCarSpecs(mass=1778., wheelbase=2.71, steerRatio=16.7),
)
JEEP_GRAND_CHEROKEE_2019 = ChryslerPlatformConfig( # includes 2020 Trailhawk
"JEEP GRAND CHEROKEE 2019",
ChryslerCarInfo("Jeep Grand Cherokee 2019-21", video_link="https://www.youtube.com/watch?v=jBe4lWnRSu4"),
specs=JEEP_GRAND_CHEROKEE.specs,
JEEP_GRAND_CHEROKEE.specs,
)
# Ram
RAM_1500 = ChryslerPlatformConfig(
"RAM 1500 5TH GEN",
ChryslerCarInfo("Ram 1500 2019-24", car_parts=CarParts.common([CarHarness.ram])),
ChryslerCarSpecs(mass=2493., wheelbase=3.88, steerRatio=16.3, minSteerSpeed=14.5),
dbc_dict('chrysler_ram_dt_generated', None),
specs=ChryslerCarSpecs(mass=2493., wheelbase=3.88, steerRatio=16.3, minSteerSpeed=14.5),
)
RAM_HD = ChryslerPlatformConfig(
"RAM HD 5TH GEN",
@ -94,8 +94,8 @@ class CAR(Platforms):
ChryslerCarInfo("Ram 2500 2020-24", car_parts=CarParts.common([CarHarness.ram])),
ChryslerCarInfo("Ram 3500 2019-22", car_parts=CarParts.common([CarHarness.ram])),
],
ChryslerCarSpecs(mass=3405., wheelbase=3.785, steerRatio=15.61, minSteerSpeed=16.),
dbc_dict('chrysler_ram_hd_generated', None),
specs=ChryslerCarSpecs(mass=3405., wheelbase=3.785, steerRatio=15.61, minSteerSpeed=16.),
)

@ -87,7 +87,7 @@ class CAR(Platforms):
BRONCO_SPORT_MK1 = FordPlatformConfig(
"FORD BRONCO SPORT 1ST GEN",
FordCarInfo("Ford Bronco Sport 2021-22"),
specs=CarSpecs(mass=1625, wheelbase=2.67, steerRatio=17.7),
CarSpecs(mass=1625, wheelbase=2.67, steerRatio=17.7),
)
ESCAPE_MK4 = FordPlatformConfig(
"FORD ESCAPE 4TH GEN",
@ -99,7 +99,7 @@ class CAR(Platforms):
FordCarInfo("Ford Kuga Hybrid 2020-22", "Adaptive Cruise Control with Lane Centering"),
FordCarInfo("Ford Kuga Plug-in Hybrid 2020-22", "Adaptive Cruise Control with Lane Centering"),
],
specs=CarSpecs(mass=1750, wheelbase=2.71, steerRatio=16.7),
CarSpecs(mass=1750, wheelbase=2.71, steerRatio=16.7),
)
EXPLORER_MK6 = FordPlatformConfig(
"FORD EXPLORER 6TH GEN",
@ -109,7 +109,7 @@ class CAR(Platforms):
FordCarInfo("Lincoln Aviator 2020-23", "Co-Pilot360 Plus"),
FordCarInfo("Lincoln Aviator Plug-in Hybrid 2020-23", "Co-Pilot360 Plus"), # Grand Touring only
],
specs=CarSpecs(mass=2050, wheelbase=3.025, steerRatio=16.8),
CarSpecs(mass=2050, wheelbase=3.025, steerRatio=16.8),
)
F_150_MK14 = FordCANFDPlatformConfig(
"FORD F-150 14TH GEN",
@ -117,12 +117,12 @@ class CAR(Platforms):
FordCarInfo("Ford F-150 2023", "Co-Pilot360 Active 2.0"),
FordCarInfo("Ford F-150 Hybrid 2023", "Co-Pilot360 Active 2.0"),
],
specs=CarSpecs(mass=2000, wheelbase=3.69, steerRatio=17.0),
CarSpecs(mass=2000, wheelbase=3.69, steerRatio=17.0),
)
F_150_LIGHTNING_MK1 = FordCANFDPlatformConfig(
"FORD F-150 LIGHTNING 1ST GEN",
FordCarInfo("Ford F-150 Lightning 2021-23", "Co-Pilot360 Active 2.0"),
specs=CarSpecs(mass=2948, wheelbase=3.70, steerRatio=16.9),
CarSpecs(mass=2948, wheelbase=3.70, steerRatio=16.9),
)
FOCUS_MK4 = FordPlatformConfig(
"FORD FOCUS 4TH GEN",
@ -130,7 +130,7 @@ class CAR(Platforms):
FordCarInfo("Ford Focus 2018", "Adaptive Cruise Control with Lane Centering", footnotes=[Footnote.FOCUS]),
FordCarInfo("Ford Focus Hybrid 2018", "Adaptive Cruise Control with Lane Centering", footnotes=[Footnote.FOCUS]), # mHEV only
],
specs=CarSpecs(mass=1350, wheelbase=2.7, steerRatio=15.0),
CarSpecs(mass=1350, wheelbase=2.7, steerRatio=15.0),
)
MAVERICK_MK1 = FordPlatformConfig(
"FORD MAVERICK 1ST GEN",
@ -140,12 +140,12 @@ class CAR(Platforms):
FordCarInfo("Ford Maverick 2023", "Co-Pilot360 Assist"),
FordCarInfo("Ford Maverick Hybrid 2023", "Co-Pilot360 Assist"),
],
specs=CarSpecs(mass=1650, wheelbase=3.076, steerRatio=17.0),
CarSpecs(mass=1650, wheelbase=3.076, steerRatio=17.0),
)
MUSTANG_MACH_E_MK1 = FordCANFDPlatformConfig(
"FORD MUSTANG MACH-E 1ST GEN",
FordCarInfo("Ford Mustang Mach-E 2021-23", "Co-Pilot360 Active 2.0"),
specs=CarSpecs(mass=2200, wheelbase=2.984, steerRatio=17.0), # TODO: check steer ratio
CarSpecs(mass=2200, wheelbase=2.984, steerRatio=17.0), # TODO: check steer ratio
)

@ -88,52 +88,52 @@ class CAR(Platforms):
HOLDEN_ASTRA = GMPlatformConfig(
"HOLDEN ASTRA RS-V BK 2017",
GMCarInfo("Holden Astra 2017"),
specs=CarSpecs(mass=1363, wheelbase=2.662, steerRatio=15.7, centerToFrontRatio=0.4),
CarSpecs(mass=1363, wheelbase=2.662, steerRatio=15.7, centerToFrontRatio=0.4),
)
VOLT = GMPlatformConfig(
"CHEVROLET VOLT PREMIER 2017",
GMCarInfo("Chevrolet Volt 2017-18", min_enable_speed=0, video_link="https://youtu.be/QeMCN_4TFfQ"),
specs=CarSpecs(mass=1607, wheelbase=2.69, steerRatio=17.7, centerToFrontRatio=0.45),
CarSpecs(mass=1607, wheelbase=2.69, steerRatio=17.7, centerToFrontRatio=0.45),
)
CADILLAC_ATS = GMPlatformConfig(
"CADILLAC ATS Premium Performance 2018",
GMCarInfo("Cadillac ATS Premium Performance 2018"),
specs=CarSpecs(mass=1601, wheelbase=2.78, steerRatio=15.3),
CarSpecs(mass=1601, wheelbase=2.78, steerRatio=15.3),
)
MALIBU = GMPlatformConfig(
"CHEVROLET MALIBU PREMIER 2017",
GMCarInfo("Chevrolet Malibu Premier 2017"),
specs=CarSpecs(mass=1496, wheelbase=2.83, steerRatio=15.8, centerToFrontRatio=0.4),
CarSpecs(mass=1496, wheelbase=2.83, steerRatio=15.8, centerToFrontRatio=0.4),
)
ACADIA = GMPlatformConfig(
"GMC ACADIA DENALI 2018",
GMCarInfo("GMC Acadia 2018", video_link="https://www.youtube.com/watch?v=0ZN6DdsBUZo"),
specs=CarSpecs(mass=1975, wheelbase=2.86, steerRatio=14.4, centerToFrontRatio=0.4),
CarSpecs(mass=1975, wheelbase=2.86, steerRatio=14.4, centerToFrontRatio=0.4),
)
BUICK_LACROSSE = GMPlatformConfig(
"BUICK LACROSSE 2017",
GMCarInfo("Buick LaCrosse 2017-19", "Driver Confidence Package 2"),
specs=CarSpecs(mass=1712, wheelbase=2.91, steerRatio=15.8, centerToFrontRatio=0.4),
CarSpecs(mass=1712, wheelbase=2.91, steerRatio=15.8, centerToFrontRatio=0.4),
)
BUICK_REGAL = GMPlatformConfig(
"BUICK REGAL ESSENCE 2018",
GMCarInfo("Buick Regal Essence 2018"),
specs=CarSpecs(mass=1714, wheelbase=2.83, steerRatio=14.4, centerToFrontRatio=0.4),
CarSpecs(mass=1714, wheelbase=2.83, steerRatio=14.4, centerToFrontRatio=0.4),
)
ESCALADE = GMPlatformConfig(
"CADILLAC ESCALADE 2017",
GMCarInfo("Cadillac Escalade 2017", "Driver Assist Package"),
specs=CarSpecs(mass=2564, wheelbase=2.95, steerRatio=17.3),
CarSpecs(mass=2564, wheelbase=2.95, steerRatio=17.3),
)
ESCALADE_ESV = GMPlatformConfig(
"CADILLAC ESCALADE ESV 2016",
GMCarInfo("Cadillac Escalade ESV 2016", "Adaptive Cruise Control (ACC) & LKAS"),
specs=CarSpecs(mass=2739, wheelbase=3.302, steerRatio=17.3),
CarSpecs(mass=2739, wheelbase=3.302, steerRatio=17.3),
)
ESCALADE_ESV_2019 = GMPlatformConfig(
"CADILLAC ESCALADE ESV 2019",
GMCarInfo("Cadillac Escalade ESV 2019", "Adaptive Cruise Control (ACC) & LKAS"),
specs=ESCALADE_ESV.specs,
ESCALADE_ESV.specs,
)
BOLT_EUV = GMPlatformConfig(
"CHEVROLET BOLT EUV 2022",
@ -141,7 +141,7 @@ class CAR(Platforms):
GMCarInfo("Chevrolet Bolt EUV 2022-23", "Premier or Premier Redline Trim without Super Cruise Package", video_link="https://youtu.be/xvwzGMUA210"),
GMCarInfo("Chevrolet Bolt EV 2022-23", "2LT Trim with Adaptive Cruise Control Package"),
],
specs=CarSpecs(mass=1669, wheelbase=2.63779, steerRatio=16.8, centerToFrontRatio=0.4),
CarSpecs(mass=1669, wheelbase=2.63779, steerRatio=16.8, centerToFrontRatio=0.4),
)
SILVERADO = GMPlatformConfig(
"CHEVROLET SILVERADO 1500 2020",
@ -149,17 +149,17 @@ class CAR(Platforms):
GMCarInfo("Chevrolet Silverado 1500 2020-21", "Safety Package II"),
GMCarInfo("GMC Sierra 1500 2020-21", "Driver Alert Package II", video_link="https://youtu.be/5HbNoBLzRwE"),
],
specs=CarSpecs(mass=2450, wheelbase=3.75, steerRatio=16.3),
CarSpecs(mass=2450, wheelbase=3.75, steerRatio=16.3),
)
EQUINOX = GMPlatformConfig(
"CHEVROLET EQUINOX 2019",
GMCarInfo("Chevrolet Equinox 2019-22"),
specs=CarSpecs(mass=1588, wheelbase=2.72, steerRatio=14.4, centerToFrontRatio=0.4),
CarSpecs(mass=1588, wheelbase=2.72, steerRatio=14.4, centerToFrontRatio=0.4),
)
TRAILBLAZER = GMPlatformConfig(
"CHEVROLET TRAILBLAZER 2021",
GMCarInfo("Chevrolet Trailblazer 2021-22"),
specs=CarSpecs(mass=1345, wheelbase=2.64, steerRatio=16.8, centerToFrontRatio=0.4),
CarSpecs(mass=1345, wheelbase=2.64, steerRatio=16.8, centerToFrontRatio=0.4),
)

@ -116,8 +116,8 @@ class CAR(Platforms):
HondaCarInfo("Honda Inspire 2018", "All", min_steer_speed=3. * CV.MPH_TO_MS),
HondaCarInfo("Honda Accord Hybrid 2018-22", "All", min_steer_speed=3. * CV.MPH_TO_MS),
],
CarSpecs(mass=3279 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=16.33, centerToFrontRatio=0.39), # steerRatio: 11.82 is spec end-to-end
dbc_dict('honda_accord_2018_can_generated', None),
specs=CarSpecs(mass=3279 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=16.33, centerToFrontRatio=0.39), # steerRatio: 11.82 is spec end-to-end
flags=HondaFlags.BOSCH,
)
CIVIC_BOSCH = HondaPlatformConfig(
@ -127,15 +127,15 @@ class CAR(Platforms):
footnotes=[Footnote.CIVIC_DIESEL], min_steer_speed=2. * CV.MPH_TO_MS),
HondaCarInfo("Honda Civic Hatchback 2017-21", min_steer_speed=12. * CV.MPH_TO_MS),
],
CarSpecs(mass=1326, wheelbase=2.7, steerRatio=15.38, centerToFrontRatio=0.4), # steerRatio: 10.93 is end-to-end spec
dbc_dict('honda_civic_hatchback_ex_2017_can_generated', None),
specs=CarSpecs(mass=1326, wheelbase=2.7, steerRatio=15.38, centerToFrontRatio=0.4), # steerRatio: 10.93 is end-to-end spec
flags=HondaFlags.BOSCH
)
CIVIC_BOSCH_DIESEL = HondaPlatformConfig(
"HONDA CIVIC SEDAN 1.6 DIESEL 2019",
None, # don't show in docs
CIVIC_BOSCH.specs,
dbc_dict('honda_accord_2018_can_generated', None),
specs=CIVIC_BOSCH.specs,
flags=HondaFlags.BOSCH
)
CIVIC_2022 = HondaPlatformConfig(
@ -144,50 +144,50 @@ class CAR(Platforms):
HondaCarInfo("Honda Civic 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"),
HondaCarInfo("Honda Civic Hatchback 2022-23", "All", video_link="https://youtu.be/ytiOT5lcp6Q"),
],
CIVIC_BOSCH.specs,
dbc_dict('honda_civic_ex_2022_can_generated', None),
specs=CIVIC_BOSCH.specs,
flags=HondaFlags.BOSCH | HondaFlags.BOSCH_RADARLESS,
)
CRV_5G = HondaPlatformConfig(
"HONDA CR-V 2017",
HondaCarInfo("Honda CR-V 2017-22", min_steer_speed=12. * CV.MPH_TO_MS),
CarSpecs(mass=3410 * CV.LB_TO_KG, wheelbase=2.66, steerRatio=16.0, centerToFrontRatio=0.41), # steerRatio: 12.3 is spec end-to-end
dbc_dict('honda_crv_ex_2017_can_generated', None, body_dbc='honda_crv_ex_2017_body_generated'),
specs=CarSpecs(mass=3410 * CV.LB_TO_KG, wheelbase=2.66, steerRatio=16.0, centerToFrontRatio=0.41), # steerRatio: 12.3 is spec end-to-end
flags=HondaFlags.BOSCH,
)
CRV_HYBRID = HondaPlatformConfig(
"HONDA CR-V HYBRID 2019",
HondaCarInfo("Honda CR-V Hybrid 2017-20", min_steer_speed=12. * CV.MPH_TO_MS),
CarSpecs(mass=1667, wheelbase=2.66, steerRatio=16, centerToFrontRatio=0.41), # mass: mean of 4 models in kg, steerRatio: 12.3 is spec end-to-end
dbc_dict('honda_accord_2018_can_generated', None),
specs=CarSpecs(mass=1667, wheelbase=2.66, steerRatio=16, centerToFrontRatio=0.41), # mass: mean of 4 models in kg, steerRatio: 12.3 is spec end-to-end
flags=HondaFlags.BOSCH
)
HRV_3G = HondaPlatformConfig(
"HONDA HR-V 2023",
HondaCarInfo("Honda HR-V 2023", "All"),
CarSpecs(mass=3125 * CV.LB_TO_KG, wheelbase=2.61, steerRatio=15.2, centerToFrontRatio=0.41),
dbc_dict('honda_civic_ex_2022_can_generated', None),
specs=CarSpecs(mass=3125 * CV.LB_TO_KG, wheelbase=2.61, steerRatio=15.2, centerToFrontRatio=0.41),
flags=HondaFlags.BOSCH | HondaFlags.BOSCH_RADARLESS
)
ACURA_RDX_3G = HondaPlatformConfig(
"ACURA RDX 2020",
HondaCarInfo("Acura RDX 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS),
CarSpecs(mass=4068 * CV.LB_TO_KG, wheelbase=2.75, steerRatio=11.95, centerToFrontRatio=0.41), # as spec
dbc_dict('acura_rdx_2020_can_generated', None),
specs=CarSpecs(mass=4068 * CV.LB_TO_KG, wheelbase=2.75, steerRatio=11.95, centerToFrontRatio=0.41), # as spec
flags=HondaFlags.BOSCH
)
INSIGHT = HondaPlatformConfig(
"HONDA INSIGHT 2019",
HondaCarInfo("Honda Insight 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS),
CarSpecs(mass=2987 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.0, centerToFrontRatio=0.39), # as spec
dbc_dict('honda_insight_ex_2019_can_generated', None),
specs=CarSpecs(mass=2987 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.0, centerToFrontRatio=0.39), # as spec
flags=HondaFlags.BOSCH
)
HONDA_E = HondaPlatformConfig(
"HONDA E 2020",
HondaCarInfo("Honda e 2020", "All", min_steer_speed=3. * CV.MPH_TO_MS),
CarSpecs(mass=3338.8 * CV.LB_TO_KG, wheelbase=2.5, centerToFrontRatio=0.5, steerRatio=16.71),
dbc_dict('acura_rdx_2020_can_generated', None),
specs=CarSpecs(mass=3338.8 * CV.LB_TO_KG, wheelbase=2.5, centerToFrontRatio=0.5, steerRatio=16.71),
flags=HondaFlags.BOSCH
)
@ -195,64 +195,64 @@ class CAR(Platforms):
ACURA_ILX = HondaPlatformConfig(
"ACURA ILX 2016",
HondaCarInfo("Acura ILX 2016-19", "AcuraWatch Plus", min_steer_speed=25. * CV.MPH_TO_MS),
CarSpecs(mass=3095 * CV.LB_TO_KG, wheelbase=2.67, steerRatio=18.61, centerToFrontRatio=0.37), # 15.3 is spec end-to-end
dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=3095 * CV.LB_TO_KG, wheelbase=2.67, steerRatio=18.61, centerToFrontRatio=0.37), # 15.3 is spec end-to-end
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
CRV = HondaPlatformConfig(
"HONDA CR-V 2016",
HondaCarInfo("Honda CR-V 2015-16", "Touring Trim", min_steer_speed=12. * CV.MPH_TO_MS),
CarSpecs(mass=3572 * CV.LB_TO_KG, wheelbase=2.62, steerRatio=16.89, centerToFrontRatio=0.41), # as spec
dbc_dict('honda_crv_touring_2016_can_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=3572 * CV.LB_TO_KG, wheelbase=2.62, steerRatio=16.89, centerToFrontRatio=0.41), # as spec
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
CRV_EU = HondaPlatformConfig(
"HONDA CR-V EU 2016",
None, # Euro version of CRV Touring, don't show in docs
CRV.specs,
dbc_dict('honda_crv_executive_2016_can_generated', 'acura_ilx_2016_nidec'),
specs=CRV.specs,
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
FIT = HondaPlatformConfig(
"HONDA FIT 2018",
HondaCarInfo("Honda Fit 2018-20", min_steer_speed=12. * CV.MPH_TO_MS),
CarSpecs(mass=2644 * CV.LB_TO_KG, wheelbase=2.53, steerRatio=13.06, centerToFrontRatio=0.39),
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=2644 * CV.LB_TO_KG, wheelbase=2.53, steerRatio=13.06, centerToFrontRatio=0.39),
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
FREED = HondaPlatformConfig(
"HONDA FREED 2020",
HondaCarInfo("Honda Freed 2020", min_steer_speed=12. * CV.MPH_TO_MS),
CarSpecs(mass=3086. * CV.LB_TO_KG, wheelbase=2.74, steerRatio=13.06, centerToFrontRatio=0.39), # mostly copied from FIT
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=3086. * CV.LB_TO_KG, wheelbase=2.74, steerRatio=13.06, centerToFrontRatio=0.39), # mostly copied from FIT
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
HRV = HondaPlatformConfig(
"HONDA HRV 2019",
HondaCarInfo("Honda HR-V 2019-22", min_steer_speed=12. * CV.MPH_TO_MS),
HRV_3G.specs,
dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'),
specs=HRV_3G.specs,
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
ODYSSEY = HondaPlatformConfig(
"HONDA ODYSSEY 2018",
HondaCarInfo("Honda Odyssey 2018-20"),
CarSpecs(mass=1900, wheelbase=3.0, steerRatio=14.35, centerToFrontRatio=0.41),
dbc_dict('honda_odyssey_exl_2018_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=1900, wheelbase=3.0, steerRatio=14.35, centerToFrontRatio=0.41),
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_PCM_ACCEL
)
ODYSSEY_CHN = HondaPlatformConfig(
"HONDA ODYSSEY CHN 2019",
None, # Chinese version of Odyssey, don't show in docs
ODYSSEY.specs,
dbc_dict('honda_odyssey_extreme_edition_2018_china_can_generated', 'acura_ilx_2016_nidec'),
specs=ODYSSEY.specs,
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES
)
ACURA_RDX = HondaPlatformConfig(
"ACURA RDX 2018",
HondaCarInfo("Acura RDX 2016-18", "AcuraWatch Plus", min_steer_speed=12. * CV.MPH_TO_MS),
CarSpecs(mass=3925 * CV.LB_TO_KG, wheelbase=2.68, steerRatio=15.0, centerToFrontRatio=0.38), # as spec
dbc_dict('acura_rdx_2018_can_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=3925 * CV.LB_TO_KG, wheelbase=2.68, steerRatio=15.0, centerToFrontRatio=0.38), # as spec
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
PILOT = HondaPlatformConfig(
@ -261,22 +261,22 @@ class CAR(Platforms):
HondaCarInfo("Honda Pilot 2016-22", min_steer_speed=12. * CV.MPH_TO_MS),
HondaCarInfo("Honda Passport 2019-23", "All", min_steer_speed=12. * CV.MPH_TO_MS),
],
CarSpecs(mass=4278 * CV.LB_TO_KG, wheelbase=2.86, centerToFrontRatio=0.428, steerRatio=16.0), # as spec
dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=4278 * CV.LB_TO_KG, wheelbase=2.86, centerToFrontRatio=0.428, steerRatio=16.0), # as spec
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
RIDGELINE = HondaPlatformConfig(
"HONDA RIDGELINE 2017",
HondaCarInfo("Honda Ridgeline 2017-24", min_steer_speed=12. * CV.MPH_TO_MS),
CarSpecs(mass=4515 * CV.LB_TO_KG, wheelbase=3.18, centerToFrontRatio=0.41, steerRatio=15.59), # as spec
dbc_dict('acura_ilx_2016_can_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=4515 * CV.LB_TO_KG, wheelbase=3.18, centerToFrontRatio=0.41, steerRatio=15.59), # as spec
flags=HondaFlags.NIDEC | HondaFlags.NIDEC_ALT_SCM_MESSAGES,
)
CIVIC = HondaPlatformConfig(
"HONDA CIVIC 2016",
HondaCarInfo("Honda Civic 2016-18", min_steer_speed=12. * CV.MPH_TO_MS, video_link="https://youtu.be/-IkImTe1NYE"),
CarSpecs(mass=1326, wheelbase=2.70, centerToFrontRatio=0.4, steerRatio=15.38), # 10.93 is end-to-end spec
dbc_dict('honda_civic_touring_2016_can_generated', 'acura_ilx_2016_nidec'),
specs=CarSpecs(mass=1326, wheelbase=2.70, centerToFrontRatio=0.4, steerRatio=15.38), # 10.93 is end-to-end spec
flags=HondaFlags.NIDEC | HondaFlags.AUTORESUME_SNG | HondaFlags.ELECTRIC_PARKING_BRAKE,
)

@ -138,7 +138,7 @@ class CAR(Platforms):
AZERA_6TH_GEN = HyundaiPlatformConfig(
"HYUNDAI AZERA 6TH GEN",
HyundaiCarInfo("Hyundai Azera 2022", "All", car_parts=CarParts.common([CarHarness.hyundai_k])),
specs=CarSpecs(mass=1600, wheelbase=2.885, steerRatio=14.5),
CarSpecs(mass=1600, wheelbase=2.885, steerRatio=14.5),
)
AZERA_HEV_6TH_GEN = HyundaiPlatformConfig(
"HYUNDAI AZERA HYBRID 6TH GEN",
@ -146,7 +146,7 @@ class CAR(Platforms):
HyundaiCarInfo("Hyundai Azera Hybrid 2019", "All", car_parts=CarParts.common([CarHarness.hyundai_c])),
HyundaiCarInfo("Hyundai Azera Hybrid 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_k])),
],
specs=CarSpecs(mass=1675, wheelbase=2.885, steerRatio=14.5),
CarSpecs(mass=1675, wheelbase=2.885, steerRatio=14.5),
flags=HyundaiFlags.HYBRID
)
ELANTRA = HyundaiPlatformConfig(
@ -157,7 +157,7 @@ class CAR(Platforms):
HyundaiCarInfo("Hyundai Elantra 2019", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_g])),
],
# steerRatio: 14 is Stock | Settled Params Learner values are steerRatio: 15.401566348670535, stiffnessFactor settled on 1.0081302973865127
specs=CarSpecs(mass=1275, wheelbase=2.7, steerRatio=15.4, tireStiffnessFactor=0.385),
CarSpecs(mass=1275, wheelbase=2.7, steerRatio=15.4, tireStiffnessFactor=0.385),
flags=HyundaiFlags.LEGACY | HyundaiFlags.CLUSTER_GEARS | HyundaiFlags.MIN_STEER_32_MPH
)
ELANTRA_GT_I30 = HyundaiPlatformConfig(
@ -166,20 +166,20 @@ class CAR(Platforms):
HyundaiCarInfo("Hyundai Elantra GT 2017-19", car_parts=CarParts.common([CarHarness.hyundai_e])),
HyundaiCarInfo("Hyundai i30 2017-19", car_parts=CarParts.common([CarHarness.hyundai_e])),
],
specs=ELANTRA.specs,
ELANTRA.specs,
flags=HyundaiFlags.LEGACY | HyundaiFlags.CLUSTER_GEARS | HyundaiFlags.MIN_STEER_32_MPH
)
ELANTRA_2021 = HyundaiPlatformConfig(
"HYUNDAI ELANTRA 2021",
HyundaiCarInfo("Hyundai Elantra 2021-23", video_link="https://youtu.be/_EdYQtV52-c", car_parts=CarParts.common([CarHarness.hyundai_k])),
specs=CarSpecs(mass=2800*CV.LB_TO_KG, wheelbase=2.72, steerRatio=12.9, tireStiffnessFactor=0.65),
CarSpecs(mass=2800*CV.LB_TO_KG, wheelbase=2.72, steerRatio=12.9, tireStiffnessFactor=0.65),
flags=HyundaiFlags.CHECKSUM_CRC8
)
ELANTRA_HEV_2021 = HyundaiPlatformConfig(
"HYUNDAI ELANTRA HYBRID 2021",
HyundaiCarInfo("Hyundai Elantra Hybrid 2021-23", video_link="https://youtu.be/_EdYQtV52-c",
car_parts=CarParts.common([CarHarness.hyundai_k])),
specs=CarSpecs(mass=3017 * CV.LB_TO_KG, wheelbase=2.72, steerRatio=12.9, tireStiffnessFactor=0.65),
CarSpecs(mass=3017 * CV.LB_TO_KG, wheelbase=2.72, steerRatio=12.9, tireStiffnessFactor=0.65),
flags=HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID
)
HYUNDAI_GENESIS = HyundaiPlatformConfig(
@ -189,120 +189,120 @@ class CAR(Platforms):
HyundaiCarInfo("Hyundai Genesis 2015-16", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_j])),
HyundaiCarInfo("Genesis G80 2017", "All", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_j])),
],
specs=CarSpecs(mass=2060, wheelbase=3.01, steerRatio=16.5, minSteerSpeed=60 * CV.KPH_TO_MS),
CarSpecs(mass=2060, wheelbase=3.01, steerRatio=16.5, minSteerSpeed=60 * CV.KPH_TO_MS),
flags=HyundaiFlags.CHECKSUM_6B | HyundaiFlags.LEGACY
)
IONIQ = HyundaiPlatformConfig(
"HYUNDAI IONIQ HYBRID 2017-2019",
HyundaiCarInfo("Hyundai Ioniq Hybrid 2017-19", car_parts=CarParts.common([CarHarness.hyundai_c])),
specs=CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
flags=HyundaiFlags.HYBRID | HyundaiFlags.MIN_STEER_32_MPH,
)
IONIQ_HEV_2022 = HyundaiPlatformConfig(
"HYUNDAI IONIQ HYBRID 2020-2022",
HyundaiCarInfo("Hyundai Ioniq Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_h])), # TODO: confirm 2020-21 harness,
specs=CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
flags=HyundaiFlags.HYBRID | HyundaiFlags.LEGACY
)
IONIQ_EV_LTD = HyundaiPlatformConfig(
"HYUNDAI IONIQ ELECTRIC LIMITED 2019",
HyundaiCarInfo("Hyundai Ioniq Electric 2019", car_parts=CarParts.common([CarHarness.hyundai_c])),
specs=CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.EV | HyundaiFlags.LEGACY | HyundaiFlags.MIN_STEER_32_MPH
)
IONIQ_EV_2020 = HyundaiPlatformConfig(
"HYUNDAI IONIQ ELECTRIC 2020",
HyundaiCarInfo("Hyundai Ioniq Electric 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_h])),
specs=CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
flags=HyundaiFlags.EV
)
IONIQ_PHEV_2019 = HyundaiPlatformConfig(
"HYUNDAI IONIQ PLUG-IN HYBRID 2019",
HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2019", car_parts=CarParts.common([CarHarness.hyundai_c])),
specs=CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
flags=HyundaiFlags.HYBRID | HyundaiFlags.MIN_STEER_32_MPH
)
IONIQ_PHEV = HyundaiPlatformConfig(
"HYUNDAI IONIQ PHEV 2020",
HyundaiCarInfo("Hyundai Ioniq Plug-in Hybrid 2020-22", "All", car_parts=CarParts.common([CarHarness.hyundai_h])),
specs=CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
CarSpecs(mass=1490, wheelbase=2.7, steerRatio=13.73, tireStiffnessFactor=0.385),
flags=HyundaiFlags.HYBRID
)
KONA = HyundaiPlatformConfig(
"HYUNDAI KONA 2020",
HyundaiCarInfo("Hyundai Kona 2020", car_parts=CarParts.common([CarHarness.hyundai_b])),
specs=CarSpecs(mass=1275, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385),
CarSpecs(mass=1275, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385),
flags=HyundaiFlags.CLUSTER_GEARS
)
KONA_EV = HyundaiPlatformConfig(
"HYUNDAI KONA ELECTRIC 2019",
HyundaiCarInfo("Hyundai Kona Electric 2018-21", car_parts=CarParts.common([CarHarness.hyundai_g])),
specs=CarSpecs(mass=1685, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385),
CarSpecs(mass=1685, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385),
flags=HyundaiFlags.EV
)
KONA_EV_2022 = HyundaiPlatformConfig(
"HYUNDAI KONA ELECTRIC 2022",
HyundaiCarInfo("Hyundai Kona Electric 2022-23", car_parts=CarParts.common([CarHarness.hyundai_o])),
specs=CarSpecs(mass=1743, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385),
CarSpecs(mass=1743, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385),
flags=HyundaiFlags.CAMERA_SCC | HyundaiFlags.EV
)
KONA_EV_2ND_GEN = HyundaiCanFDPlatformConfig(
"HYUNDAI KONA ELECTRIC 2ND GEN",
HyundaiCarInfo("Hyundai Kona Electric (with HDA II, Korea only) 2023", video_link="https://www.youtube.com/watch?v=U2fOCmcQ8hw",
car_parts=CarParts.common([CarHarness.hyundai_r])),
specs=CarSpecs(mass=1740, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385),
CarSpecs(mass=1740, wheelbase=2.66, steerRatio=13.6, tireStiffnessFactor=0.385),
flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE
)
KONA_HEV = HyundaiPlatformConfig(
"HYUNDAI KONA HYBRID 2020",
HyundaiCarInfo("Hyundai Kona Hybrid 2020", car_parts=CarParts.common([CarHarness.hyundai_i])), # TODO: check packages,
specs=CarSpecs(mass=1425, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385),
CarSpecs(mass=1425, wheelbase=2.6, steerRatio=13.42, tireStiffnessFactor=0.385),
flags=HyundaiFlags.HYBRID
)
SANTA_FE = HyundaiPlatformConfig(
"HYUNDAI SANTA FE 2019",
HyundaiCarInfo("Hyundai Santa Fe 2019-20", "All", video_link="https://youtu.be/bjDR0YjM__s",
car_parts=CarParts.common([CarHarness.hyundai_d])),
specs=CarSpecs(mass=3982 * CV.LB_TO_KG, wheelbase=2.766, steerRatio=16.55, tireStiffnessFactor=0.82),
CarSpecs(mass=3982 * CV.LB_TO_KG, wheelbase=2.766, steerRatio=16.55, tireStiffnessFactor=0.82),
flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8
)
SANTA_FE_2022 = HyundaiPlatformConfig(
"HYUNDAI SANTA FE 2022",
HyundaiCarInfo("Hyundai Santa Fe 2021-23", "All", video_link="https://youtu.be/VnHzSTygTS4",
car_parts=CarParts.common([CarHarness.hyundai_l])),
specs=SANTA_FE.specs,
SANTA_FE.specs,
flags=HyundaiFlags.CHECKSUM_CRC8
)
SANTA_FE_HEV_2022 = HyundaiPlatformConfig(
"HYUNDAI SANTA FE HYBRID 2022",
HyundaiCarInfo("Hyundai Santa Fe Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])),
specs=SANTA_FE.specs,
SANTA_FE.specs,
flags=HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID
)
SANTA_FE_PHEV_2022 = HyundaiPlatformConfig(
"HYUNDAI SANTA FE PlUG-IN HYBRID 2022",
HyundaiCarInfo("Hyundai Santa Fe Plug-in Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])),
specs=SANTA_FE.specs,
SANTA_FE.specs,
flags=HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID
)
SONATA = HyundaiPlatformConfig(
"HYUNDAI SONATA 2020",
HyundaiCarInfo("Hyundai Sonata 2020-23", "All", video_link="https://www.youtube.com/watch?v=ix63r9kE3Fw",
car_parts=CarParts.common([CarHarness.hyundai_a])),
specs=CarSpecs(mass=1513, wheelbase=2.84, steerRatio=13.27 * 1.15, tireStiffnessFactor=0.65), # 15% higher at the center seems reasonable
CarSpecs(mass=1513, wheelbase=2.84, steerRatio=13.27 * 1.15, tireStiffnessFactor=0.65), # 15% higher at the center seems reasonable
flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8
)
SONATA_LF = HyundaiPlatformConfig(
"HYUNDAI SONATA 2019",
HyundaiCarInfo("Hyundai Sonata 2018-19", car_parts=CarParts.common([CarHarness.hyundai_e])),
specs=CarSpecs(mass=1536, wheelbase=2.804, steerRatio=13.27 * 1.15), # 15% higher at the center seems reasonable
CarSpecs(mass=1536, wheelbase=2.804, steerRatio=13.27 * 1.15), # 15% higher at the center seems reasonable
flags=HyundaiFlags.UNSUPPORTED_LONGITUDINAL | HyundaiFlags.TCU_GEARS
)
STARIA_4TH_GEN = HyundaiCanFDPlatformConfig(
"HYUNDAI STARIA 4TH GEN",
HyundaiCarInfo("Hyundai Staria 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])),
specs=CarSpecs(mass=2205, wheelbase=3.273, steerRatio=11.94), # https://www.hyundai.com/content/dam/hyundai/au/en/models/staria-load/premium-pip-update-2023/spec-sheet/STARIA_Load_Spec-Table_March_2023_v3.1.pdf
CarSpecs(mass=2205, wheelbase=3.273, steerRatio=11.94), # https://www.hyundai.com/content/dam/hyundai/au/en/models/staria-load/premium-pip-update-2023/spec-sheet/STARIA_Load_Spec-Table_March_2023_v3.1.pdf
)
TUCSON = HyundaiPlatformConfig(
"HYUNDAI TUCSON 2019",
@ -310,7 +310,7 @@ class CAR(Platforms):
HyundaiCarInfo("Hyundai Tucson 2021", min_enable_speed=19 * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_l])),
HyundaiCarInfo("Hyundai Tucson Diesel 2019", car_parts=CarParts.common([CarHarness.hyundai_l])),
],
specs=CarSpecs(mass=3520 * CV.LB_TO_KG, wheelbase=2.67, steerRatio=16.1, tireStiffnessFactor=0.385),
CarSpecs(mass=3520 * CV.LB_TO_KG, wheelbase=2.67, steerRatio=16.1, tireStiffnessFactor=0.385),
flags=HyundaiFlags.TCU_GEARS
)
PALISADE = HyundaiPlatformConfig(
@ -319,19 +319,19 @@ class CAR(Platforms):
HyundaiCarInfo("Hyundai Palisade 2020-22", "All", video_link="https://youtu.be/TAnDqjF4fDY?t=456", car_parts=CarParts.common([CarHarness.hyundai_h])),
HyundaiCarInfo("Kia Telluride 2020-22", "All", car_parts=CarParts.common([CarHarness.hyundai_h])),
],
specs=CarSpecs(mass=1999, wheelbase=2.9, steerRatio=15.6 * 1.15, tireStiffnessFactor=0.63),
CarSpecs(mass=1999, wheelbase=2.9, steerRatio=15.6 * 1.15, tireStiffnessFactor=0.63),
flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8
)
VELOSTER = HyundaiPlatformConfig(
"HYUNDAI VELOSTER 2019",
HyundaiCarInfo("Hyundai Veloster 2019-20", min_enable_speed=5. * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_e])),
specs=CarSpecs(mass=2917 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75 * 1.15, tireStiffnessFactor = 0.5),
CarSpecs(mass=2917 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75 * 1.15, tireStiffnessFactor = 0.5),
flags=HyundaiFlags.LEGACY | HyundaiFlags.TCU_GEARS
)
SONATA_HYBRID = HyundaiPlatformConfig(
"HYUNDAI SONATA HYBRID 2021",
HyundaiCarInfo("Hyundai Sonata Hybrid 2020-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])),
specs=SONATA.specs,
SONATA.specs,
flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID
)
IONIQ_5 = HyundaiCanFDPlatformConfig(
@ -341,13 +341,13 @@ class CAR(Platforms):
HyundaiCarInfo("Hyundai Ioniq 5 (without HDA II) 2022-23", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_k])),
HyundaiCarInfo("Hyundai Ioniq 5 (with HDA II) 2022-23", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])),
],
specs=CarSpecs(mass=1948, wheelbase=2.97, steerRatio=14.26, tireStiffnessFactor=0.65),
CarSpecs(mass=1948, wheelbase=2.97, steerRatio=14.26, tireStiffnessFactor=0.65),
flags=HyundaiFlags.EV
)
IONIQ_6 = HyundaiCanFDPlatformConfig(
"HYUNDAI IONIQ 6 2023",
HyundaiCarInfo("Hyundai Ioniq 6 (with HDA II) 2023", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_p])),
specs=IONIQ_5.specs,
IONIQ_5.specs,
flags=HyundaiFlags.EV | HyundaiFlags.CANFD_NO_RADAR_DISABLE
)
TUCSON_4TH_GEN = HyundaiCanFDPlatformConfig(
@ -357,18 +357,18 @@ class CAR(Platforms):
HyundaiCarInfo("Hyundai Tucson 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_n])),
HyundaiCarInfo("Hyundai Tucson Hybrid 2022-24", "All", car_parts=CarParts.common([CarHarness.hyundai_n])),
],
specs=CarSpecs(mass=1630, wheelbase=2.756, steerRatio=16, tireStiffnessFactor=0.385),
CarSpecs(mass=1630, wheelbase=2.756, steerRatio=16, tireStiffnessFactor=0.385),
)
SANTA_CRUZ_1ST_GEN = HyundaiCanFDPlatformConfig(
"HYUNDAI SANTA CRUZ 1ST GEN",
HyundaiCarInfo("Hyundai Santa Cruz 2022-23", car_parts=CarParts.common([CarHarness.hyundai_n])),
# weight from Limited trim - the only supported trim, steering ratio according to Hyundai News https://www.hyundainews.com/assets/documents/original/48035-2022SantaCruzProductGuideSpecsv2081521.pdf
specs=CarSpecs(mass=1870, wheelbase=3, steerRatio=14.2),
CarSpecs(mass=1870, wheelbase=3, steerRatio=14.2),
)
CUSTIN_1ST_GEN = HyundaiPlatformConfig(
"HYUNDAI CUSTIN 1ST GEN",
HyundaiCarInfo("Hyundai Custin 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])),
specs=CarSpecs(mass=1690, wheelbase=3.055, steerRatio=17), # mass: from https://www.hyundai-motor.com.tw/clicktobuy/custin#spec_0, steerRatio: from learner
CarSpecs(mass=1690, wheelbase=3.055, steerRatio=17), # mass: from https://www.hyundai-motor.com.tw/clicktobuy/custin#spec_0, steerRatio: from learner
flags=HyundaiFlags.CHECKSUM_CRC8
)
@ -379,25 +379,25 @@ class CAR(Platforms):
HyundaiCarInfo("Kia Forte 2019-21", car_parts=CarParts.common([CarHarness.hyundai_g])),
HyundaiCarInfo("Kia Forte 2023", car_parts=CarParts.common([CarHarness.hyundai_e])),
],
specs=CarSpecs(mass=2878 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5)
CarSpecs(mass=2878 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5)
)
KIA_K5_2021 = HyundaiPlatformConfig(
"KIA K5 2021",
HyundaiCarInfo("Kia K5 2021-24", car_parts=CarParts.common([CarHarness.hyundai_a])),
specs=CarSpecs(mass=3381 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27, tireStiffnessFactor=0.5), # 2021 Kia K5 Steering Ratio (all trims)
CarSpecs(mass=3381 * CV.LB_TO_KG, wheelbase=2.85, steerRatio=13.27, tireStiffnessFactor=0.5), # 2021 Kia K5 Steering Ratio (all trims)
flags=HyundaiFlags.CHECKSUM_CRC8
)
KIA_K5_HEV_2020 = HyundaiPlatformConfig(
"KIA K5 HYBRID 2020",
HyundaiCarInfo("Kia K5 Hybrid 2020-22", car_parts=CarParts.common([CarHarness.hyundai_a])),
specs=KIA_K5_2021.specs,
KIA_K5_2021.specs,
flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.CHECKSUM_CRC8 | HyundaiFlags.HYBRID
)
KIA_K8_HEV_1ST_GEN = HyundaiCanFDPlatformConfig(
"KIA K8 HYBRID 1ST GEN",
HyundaiCarInfo("Kia K8 Hybrid (with HDA II) 2023", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_q])),
# mass: https://carprices.ae/brands/kia/2023/k8/1.6-turbo-hybrid, steerRatio: guesstimate from K5 platform
specs=CarSpecs(mass=1630, wheelbase=2.895, steerRatio=13.27)
CarSpecs(mass=1630, wheelbase=2.895, steerRatio=13.27)
)
KIA_NIRO_EV = HyundaiPlatformConfig(
"KIA NIRO EV 2020",
@ -407,13 +407,13 @@ class CAR(Platforms):
HyundaiCarInfo("Kia Niro EV 2021", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_c])),
HyundaiCarInfo("Kia Niro EV 2022", "All", video_link="https://www.youtube.com/watch?v=lT7zcG6ZpGo", car_parts=CarParts.common([CarHarness.hyundai_h])),
],
specs=CarSpecs(mass=3543 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=13.6, tireStiffnessFactor=0.385), # average of all the cars
CarSpecs(mass=3543 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=13.6, tireStiffnessFactor=0.385), # average of all the cars
flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.EV
)
KIA_NIRO_EV_2ND_GEN = HyundaiCanFDPlatformConfig(
"KIA NIRO EV 2ND GEN",
HyundaiCarInfo("Kia Niro EV 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_a])),
specs=KIA_NIRO_EV.specs,
KIA_NIRO_EV.specs,
flags=HyundaiFlags.EV
)
KIA_NIRO_PHEV = HyundaiPlatformConfig(
@ -422,7 +422,7 @@ class CAR(Platforms):
HyundaiCarInfo("Kia Niro Plug-in Hybrid 2018-19", "All", min_enable_speed=10. * CV.MPH_TO_MS, car_parts=CarParts.common([CarHarness.hyundai_c])),
HyundaiCarInfo("Kia Niro Plug-in Hybrid 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_d])),
],
specs=KIA_NIRO_EV.specs,
KIA_NIRO_EV.specs,
flags=HyundaiFlags.MANDO_RADAR | HyundaiFlags.HYBRID | HyundaiFlags.UNSUPPORTED_LONGITUDINAL | HyundaiFlags.MIN_STEER_32_MPH
)
KIA_NIRO_PHEV_2022 = HyundaiPlatformConfig(
@ -431,7 +431,7 @@ class CAR(Platforms):
HyundaiCarInfo("Kia Niro Plug-in Hybrid 2021", "All", car_parts=CarParts.common([CarHarness.hyundai_d])),
HyundaiCarInfo("Kia Niro Plug-in Hybrid 2022", "All", car_parts=CarParts.common([CarHarness.hyundai_f])),
],
specs=KIA_NIRO_EV.specs,
KIA_NIRO_EV.specs,
flags=HyundaiFlags.HYBRID | HyundaiFlags.MANDO_RADAR
)
KIA_NIRO_HEV_2021 = HyundaiPlatformConfig(
@ -440,44 +440,44 @@ class CAR(Platforms):
HyundaiCarInfo("Kia Niro Hybrid 2021", car_parts=CarParts.common([CarHarness.hyundai_d])),
HyundaiCarInfo("Kia Niro Hybrid 2022", car_parts=CarParts.common([CarHarness.hyundai_f])),
],
specs=KIA_NIRO_EV.specs,
KIA_NIRO_EV.specs,
flags=HyundaiFlags.HYBRID
)
KIA_NIRO_HEV_2ND_GEN = HyundaiCanFDPlatformConfig(
"KIA NIRO HYBRID 2ND GEN",
HyundaiCarInfo("Kia Niro Hybrid 2023", car_parts=CarParts.common([CarHarness.hyundai_a])),
specs=KIA_NIRO_EV.specs,
KIA_NIRO_EV.specs,
)
KIA_OPTIMA_G4 = HyundaiPlatformConfig(
"KIA OPTIMA 4TH GEN",
HyundaiCarInfo("Kia Optima 2017", "Advanced Smart Cruise Control",
car_parts=CarParts.common([CarHarness.hyundai_b])), # TODO: may support 2016, 2018
specs=CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5),
CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5),
flags=HyundaiFlags.LEGACY | HyundaiFlags.TCU_GEARS | HyundaiFlags.MIN_STEER_32_MPH
)
KIA_OPTIMA_G4_FL = HyundaiPlatformConfig(
"KIA OPTIMA 4TH GEN FACELIFT",
HyundaiCarInfo("Kia Optima 2019-20", car_parts=CarParts.common([CarHarness.hyundai_g])),
specs=CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5),
CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5),
flags=HyundaiFlags.UNSUPPORTED_LONGITUDINAL | HyundaiFlags.TCU_GEARS
)
# TODO: may support adjacent years. may have a non-zero minimum steering speed
KIA_OPTIMA_H = HyundaiPlatformConfig(
"KIA OPTIMA HYBRID 2017 & SPORTS 2019",
HyundaiCarInfo("Kia Optima Hybrid 2017", "Advanced Smart Cruise Control", car_parts=CarParts.common([CarHarness.hyundai_c])),
specs=CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5),
CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5),
flags=HyundaiFlags.HYBRID | HyundaiFlags.LEGACY
)
KIA_OPTIMA_H_G4_FL = HyundaiPlatformConfig(
"KIA OPTIMA HYBRID 4TH GEN FACELIFT",
HyundaiCarInfo("Kia Optima Hybrid 2019", car_parts=CarParts.common([CarHarness.hyundai_h])),
specs=CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5),
CarSpecs(mass=3558 * CV.LB_TO_KG, wheelbase=2.8, steerRatio=13.75, tireStiffnessFactor=0.5),
flags=HyundaiFlags.HYBRID | HyundaiFlags.UNSUPPORTED_LONGITUDINAL
)
KIA_SELTOS = HyundaiPlatformConfig(
"KIA SELTOS 2021",
HyundaiCarInfo("Kia Seltos 2021", car_parts=CarParts.common([CarHarness.hyundai_a])),
specs=CarSpecs(mass=1337, wheelbase=2.63, steerRatio=14.56),
CarSpecs(mass=1337, wheelbase=2.63, steerRatio=14.56),
flags=HyundaiFlags.CHECKSUM_CRC8
)
KIA_SPORTAGE_5TH_GEN = HyundaiCanFDPlatformConfig(
@ -487,7 +487,7 @@ class CAR(Platforms):
HyundaiCarInfo("Kia Sportage Hybrid 2023", car_parts=CarParts.common([CarHarness.hyundai_n])),
],
# weight from SX and above trims, average of FWD and AWD version, steering ratio according to Kia News https://www.kiamedia.com/us/en/models/sportage/2023/specifications
specs=CarSpecs(mass=1725, wheelbase=2.756, steerRatio=13.6),
CarSpecs(mass=1725, wheelbase=2.756, steerRatio=13.6),
)
KIA_SORENTO = HyundaiPlatformConfig(
"KIA SORENTO GT LINE 2018",
@ -496,13 +496,13 @@ class CAR(Platforms):
car_parts=CarParts.common([CarHarness.hyundai_e])),
HyundaiCarInfo("Kia Sorento 2019", video_link="https://www.youtube.com/watch?v=Fkh3s6WHJz8", car_parts=CarParts.common([CarHarness.hyundai_e])),
],
specs=CarSpecs(mass=1985, wheelbase=2.78, steerRatio=14.4 * 1.1), # 10% higher at the center seems reasonable
CarSpecs(mass=1985, wheelbase=2.78, steerRatio=14.4 * 1.1), # 10% higher at the center seems reasonable
flags=HyundaiFlags.CHECKSUM_6B | HyundaiFlags.UNSUPPORTED_LONGITUDINAL
)
KIA_SORENTO_4TH_GEN = HyundaiCanFDPlatformConfig(
"KIA SORENTO 4TH GEN",
HyundaiCarInfo("Kia Sorento 2021-23", car_parts=CarParts.common([CarHarness.hyundai_k])),
specs=CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), # average of the platforms
CarSpecs(mass=3957 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), # average of the platforms
flags=HyundaiFlags.RADAR_SCC
)
KIA_SORENTO_HEV_4TH_GEN = HyundaiCanFDPlatformConfig(
@ -511,24 +511,24 @@ class CAR(Platforms):
HyundaiCarInfo("Kia Sorento Hybrid 2021-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])),
HyundaiCarInfo("Kia Sorento Plug-in Hybrid 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_a])),
],
specs=CarSpecs(mass=4395 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), # average of the platforms
CarSpecs(mass=4395 * CV.LB_TO_KG, wheelbase=2.81, steerRatio=13.5), # average of the platforms
flags=HyundaiFlags.RADAR_SCC
)
KIA_STINGER = HyundaiPlatformConfig(
"KIA STINGER GT2 2018",
HyundaiCarInfo("Kia Stinger 2018-20", video_link="https://www.youtube.com/watch?v=MJ94qoofYw0",
car_parts=CarParts.common([CarHarness.hyundai_c])),
specs=CarSpecs(mass=1825, wheelbase=2.78, steerRatio=14.4 * 1.15) # 15% higher at the center seems reasonable
CarSpecs(mass=1825, wheelbase=2.78, steerRatio=14.4 * 1.15) # 15% higher at the center seems reasonable
)
KIA_STINGER_2022 = HyundaiPlatformConfig(
"KIA STINGER 2022",
HyundaiCarInfo("Kia Stinger 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_k])),
specs=KIA_STINGER.specs,
KIA_STINGER.specs,
)
KIA_CEED = HyundaiPlatformConfig(
"KIA CEED INTRO ED 2019",
HyundaiCarInfo("Kia Ceed 2019", car_parts=CarParts.common([CarHarness.hyundai_e])),
specs=CarSpecs(mass=1450, wheelbase=2.65, steerRatio=13.75, tireStiffnessFactor=0.5),
CarSpecs(mass=1450, wheelbase=2.65, steerRatio=13.75, tireStiffnessFactor=0.5),
flags=HyundaiFlags.LEGACY
)
KIA_EV6 = HyundaiCanFDPlatformConfig(
@ -538,7 +538,7 @@ class CAR(Platforms):
HyundaiCarInfo("Kia EV6 (without HDA II) 2022-23", "Highway Driving Assist", car_parts=CarParts.common([CarHarness.hyundai_l])),
HyundaiCarInfo("Kia EV6 (with HDA II) 2022-23", "Highway Driving Assist II", car_parts=CarParts.common([CarHarness.hyundai_p]))
],
specs=CarSpecs(mass=2055, wheelbase=2.9, steerRatio=16, tireStiffnessFactor=0.65),
CarSpecs(mass=2055, wheelbase=2.9, steerRatio=16, tireStiffnessFactor=0.65),
flags=HyundaiFlags.EV
)
KIA_CARNIVAL_4TH_GEN = HyundaiCanFDPlatformConfig(
@ -547,7 +547,7 @@ class CAR(Platforms):
HyundaiCarInfo("Kia Carnival 2022-24", car_parts=CarParts.common([CarHarness.hyundai_a])),
HyundaiCarInfo("Kia Carnival (China only) 2023", car_parts=CarParts.common([CarHarness.hyundai_k]))
],
specs=CarSpecs(mass=2087, wheelbase=3.09, steerRatio=14.23),
CarSpecs(mass=2087, wheelbase=3.09, steerRatio=14.23),
flags=HyundaiFlags.RADAR_SCC
)
@ -558,19 +558,19 @@ class CAR(Platforms):
HyundaiCarInfo("Genesis GV60 (Advanced Trim) 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_a])),
HyundaiCarInfo("Genesis GV60 (Performance Trim) 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_k])),
],
specs=CarSpecs(mass=2205, wheelbase=2.9, steerRatio=12.6), # steerRatio: https://www.motor1.com/reviews/586376/2023-genesis-gv60-first-drive/#:~:text=Relative%20to%20the%20related%20Ioniq,5%2FEV6%27s%2014.3%3A1.
CarSpecs(mass=2205, wheelbase=2.9, steerRatio=12.6), # steerRatio: https://www.motor1.com/reviews/586376/2023-genesis-gv60-first-drive/#:~:text=Relative%20to%20the%20related%20Ioniq,5%2FEV6%27s%2014.3%3A1.
flags=HyundaiFlags.EV
)
GENESIS_G70 = HyundaiPlatformConfig(
"GENESIS G70 2018",
HyundaiCarInfo("Genesis G70 2018-19", "All", car_parts=CarParts.common([CarHarness.hyundai_f])),
specs=CarSpecs(mass=1640, wheelbase=2.84, steerRatio=13.56),
CarSpecs(mass=1640, wheelbase=2.84, steerRatio=13.56),
flags=HyundaiFlags.LEGACY
)
GENESIS_G70_2020 = HyundaiPlatformConfig(
"GENESIS G70 2020",
HyundaiCarInfo("Genesis G70 2020", "All", car_parts=CarParts.common([CarHarness.hyundai_f])),
specs=CarSpecs(mass=3673 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=12.9),
CarSpecs(mass=3673 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=12.9),
flags=HyundaiFlags.MANDO_RADAR
)
GENESIS_GV70_1ST_GEN = HyundaiCanFDPlatformConfig(
@ -579,24 +579,24 @@ class CAR(Platforms):
HyundaiCarInfo("Genesis GV70 (2.5T Trim) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_l])),
HyundaiCarInfo("Genesis GV70 (3.5T Trim) 2022-23", "All", car_parts=CarParts.common([CarHarness.hyundai_m])),
],
specs=CarSpecs(mass=1950, wheelbase=2.87, steerRatio=14.6),
CarSpecs(mass=1950, wheelbase=2.87, steerRatio=14.6),
flags=HyundaiFlags.RADAR_SCC
)
GENESIS_G80 = HyundaiPlatformConfig(
"GENESIS G80 2017",
HyundaiCarInfo("Genesis G80 2018-19", "All", car_parts=CarParts.common([CarHarness.hyundai_h])),
specs=CarSpecs(mass=2060, wheelbase=3.01, steerRatio=16.5),
CarSpecs(mass=2060, wheelbase=3.01, steerRatio=16.5),
flags=HyundaiFlags.LEGACY
)
GENESIS_G90 = HyundaiPlatformConfig(
"GENESIS G90 2017",
HyundaiCarInfo("Genesis G90 2017-18", "All", car_parts=CarParts.common([CarHarness.hyundai_c])),
specs=CarSpecs(mass=2200, wheelbase=3.15, steerRatio=12.069),
CarSpecs(mass=2200, wheelbase=3.15, steerRatio=12.069),
)
GENESIS_GV80 = HyundaiCanFDPlatformConfig(
"GENESIS GV80 2023",
HyundaiCarInfo("Genesis GV80 2023", "All", car_parts=CarParts.common([CarHarness.hyundai_m])),
specs=CarSpecs(mass=2258, wheelbase=2.95, steerRatio=14.14),
CarSpecs(mass=2258, wheelbase=2.95, steerRatio=14.14),
flags=HyundaiFlags.RADAR_SCC
)

@ -112,16 +112,14 @@ class CarInterfaceBase(ABC):
def get_params(cls, candidate: Platform, fingerprint: dict[int, dict[int, int]], car_fw: list[car.CarParams.CarFw], experimental_long: bool, docs: bool):
ret = CarInterfaceBase.get_std_params(candidate)
if hasattr(candidate, "config"):
if candidate.config.specs is not None:
ret.mass = candidate.config.specs.mass
ret.wheelbase = candidate.config.specs.wheelbase
ret.steerRatio = candidate.config.specs.steerRatio
ret.centerToFront = ret.wheelbase * candidate.config.specs.centerToFrontRatio
ret.minEnableSpeed = candidate.config.specs.minEnableSpeed
ret.minSteerSpeed = candidate.config.specs.minSteerSpeed
ret.tireStiffnessFactor = candidate.config.specs.tireStiffnessFactor
ret.flags |= int(candidate.config.flags)
ret.mass = candidate.config.specs.mass
ret.wheelbase = candidate.config.specs.wheelbase
ret.steerRatio = candidate.config.specs.steerRatio
ret.centerToFront = ret.wheelbase * candidate.config.specs.centerToFrontRatio
ret.minEnableSpeed = candidate.config.specs.minEnableSpeed
ret.minSteerSpeed = candidate.config.specs.minSteerSpeed
ret.tireStiffnessFactor = candidate.config.specs.tireStiffnessFactor
ret.flags |= int(candidate.config.flags)
ret = cls._get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs)

@ -48,32 +48,32 @@ class CAR(Platforms):
CX5 = MazdaPlatformConfig(
"MAZDA CX-5",
MazdaCarInfo("Mazda CX-5 2017-21"),
specs=CarSpecs(mass=3655 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.5)
CarSpecs(mass=3655 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.5)
)
CX9 = MazdaPlatformConfig(
"MAZDA CX-9",
MazdaCarInfo("Mazda CX-9 2016-20"),
specs=CarSpecs(mass=4217 * CV.LB_TO_KG, wheelbase=3.1, steerRatio=17.6)
CarSpecs(mass=4217 * CV.LB_TO_KG, wheelbase=3.1, steerRatio=17.6)
)
MAZDA3 = MazdaPlatformConfig(
"MAZDA 3",
MazdaCarInfo("Mazda 3 2017-18"),
specs=CarSpecs(mass=2875 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=14.0)
CarSpecs(mass=2875 * CV.LB_TO_KG, wheelbase=2.7, steerRatio=14.0)
)
MAZDA6 = MazdaPlatformConfig(
"MAZDA 6",
MazdaCarInfo("Mazda 6 2017-20"),
specs=CarSpecs(mass=3443 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=15.5)
CarSpecs(mass=3443 * CV.LB_TO_KG, wheelbase=2.83, steerRatio=15.5)
)
CX9_2021 = MazdaPlatformConfig(
"MAZDA CX-9 2021",
MazdaCarInfo("Mazda CX-9 2021-23", video_link="https://youtu.be/dA3duO4a0O4"),
specs=CX9.specs
CX9.specs
)
CX5_2022 = MazdaPlatformConfig(
"MAZDA CX-5 2022",
MazdaCarInfo("Mazda CX-5 2022-24"),
specs=CX5.specs,
CX5.specs,
)

@ -1,12 +1,14 @@
from enum import StrEnum
from openpilot.selfdrive.car import CarSpecs, PlatformConfig, Platforms
from openpilot.selfdrive.car.docs_definitions import CarInfo
class CAR(StrEnum):
MOCK = 'mock'
class CAR(Platforms):
MOCK = PlatformConfig(
'mock',
None,
CarSpecs(mass=1700, wheelbase=2.7, steerRatio=13),
{}
)
CAR_INFO: dict[str, CarInfo | list[CarInfo] | None] = {
CAR.MOCK: None,
}
CAR_INFO = CAR.create_carinfo_map()

@ -40,13 +40,13 @@ class CAR(Platforms):
XTRAIL = NissanPlaformConfig(
"NISSAN X-TRAIL 2017",
NissanCarInfo("Nissan X-Trail 2017"),
specs=NissanCarSpecs(mass=1610, wheelbase=2.705)
NissanCarSpecs(mass=1610, wheelbase=2.705)
)
LEAF = NissanPlaformConfig(
"NISSAN LEAF 2018",
NissanCarInfo("Nissan Leaf 2018-23", video_link="https://youtu.be/vaMbtAh_0cY"),
dbc_dict=dbc_dict('nissan_leaf_2018_generated', None),
specs=NissanCarSpecs(mass=1610, wheelbase=2.705)
NissanCarSpecs(mass=1610, wheelbase=2.705),
dbc_dict('nissan_leaf_2018_generated', None),
)
# Leaf with ADAS ECU found behind instrument cluster instead of glovebox
# Currently the only known difference between them is the inverted seatbelt signal.
@ -54,12 +54,12 @@ class CAR(Platforms):
ROGUE = NissanPlaformConfig(
"NISSAN ROGUE 2019",
NissanCarInfo("Nissan Rogue 2018-20"),
specs=NissanCarSpecs(mass=1610, wheelbase=2.705)
NissanCarSpecs(mass=1610, wheelbase=2.705)
)
ALTIMA = NissanPlaformConfig(
"NISSAN ALTIMA 2020",
NissanCarInfo("Nissan Altima 2019-20", car_parts=CarParts.common([CarHarness.nissan_b])),
specs=NissanCarSpecs(mass=1492, wheelbase=2.824)
NissanCarSpecs(mass=1492, wheelbase=2.824)
)

@ -123,17 +123,17 @@ class CAR(Platforms):
ASCENT = SubaruPlatformConfig(
"SUBARU ASCENT LIMITED 2019",
SubaruCarInfo("Subaru Ascent 2019-21", "All"),
specs=CarSpecs(mass=2031, wheelbase=2.89, steerRatio=13.5),
CarSpecs(mass=2031, wheelbase=2.89, steerRatio=13.5),
)
OUTBACK = SubaruGen2PlatformConfig(
"SUBARU OUTBACK 6TH GEN",
SubaruCarInfo("Subaru Outback 2020-22", "All", car_parts=CarParts.common([CarHarness.subaru_b])),
specs=CarSpecs(mass=1568, wheelbase=2.67, steerRatio=17),
CarSpecs(mass=1568, wheelbase=2.67, steerRatio=17),
)
LEGACY = SubaruGen2PlatformConfig(
"SUBARU LEGACY 7TH GEN",
SubaruCarInfo("Subaru Legacy 2020-22", "All", car_parts=CarParts.common([CarHarness.subaru_b])),
specs=OUTBACK.specs,
OUTBACK.specs,
)
IMPREZA = SubaruPlatformConfig(
"SUBARU IMPREZA LIMITED 2019",
@ -142,7 +142,7 @@ class CAR(Platforms):
SubaruCarInfo("Subaru Crosstrek 2018-19", video_link="https://youtu.be/Agww7oE1k-s?t=26"),
SubaruCarInfo("Subaru XV 2018-19", video_link="https://youtu.be/Agww7oE1k-s?t=26"),
],
specs=CarSpecs(mass=1568, wheelbase=2.67, steerRatio=15),
CarSpecs(mass=1568, wheelbase=2.67, steerRatio=15),
)
IMPREZA_2020 = SubaruPlatformConfig(
"SUBARU IMPREZA SPORT 2020",
@ -151,74 +151,74 @@ class CAR(Platforms):
SubaruCarInfo("Subaru Crosstrek 2020-23"),
SubaruCarInfo("Subaru XV 2020-21"),
],
specs=CarSpecs(mass=1480, wheelbase=2.67, steerRatio=17),
CarSpecs(mass=1480, wheelbase=2.67, steerRatio=17),
flags=SubaruFlags.STEER_RATE_LIMITED,
)
# TODO: is there an XV and Impreza too?
CROSSTREK_HYBRID = SubaruPlatformConfig(
"SUBARU CROSSTREK HYBRID 2020",
SubaruCarInfo("Subaru Crosstrek Hybrid 2020", car_parts=CarParts.common([CarHarness.subaru_b])),
specs=CarSpecs(mass=1668, wheelbase=2.67, steerRatio=17),
CarSpecs(mass=1668, wheelbase=2.67, steerRatio=17),
flags=SubaruFlags.HYBRID,
)
FORESTER = SubaruPlatformConfig(
"SUBARU FORESTER 2019",
SubaruCarInfo("Subaru Forester 2019-21", "All"),
specs=CarSpecs(mass=1568, wheelbase=2.67, steerRatio=17),
CarSpecs(mass=1568, wheelbase=2.67, steerRatio=17),
flags=SubaruFlags.STEER_RATE_LIMITED,
)
FORESTER_HYBRID = SubaruPlatformConfig(
"SUBARU FORESTER HYBRID 2020",
SubaruCarInfo("Subaru Forester Hybrid 2020"),
specs=FORESTER.specs,
FORESTER.specs,
flags=SubaruFlags.HYBRID,
)
# Pre-global
FORESTER_PREGLOBAL = SubaruPlatformConfig(
"SUBARU FORESTER 2017 - 2018",
SubaruCarInfo("Subaru Forester 2017-18"),
CarSpecs(mass=1568, wheelbase=2.67, steerRatio=20),
dbc_dict('subaru_forester_2017_generated', None),
specs=CarSpecs(mass=1568, wheelbase=2.67, steerRatio=20),
flags=SubaruFlags.PREGLOBAL,
)
LEGACY_PREGLOBAL = SubaruPlatformConfig(
"SUBARU LEGACY 2015 - 2018",
SubaruCarInfo("Subaru Legacy 2015-18"),
CarSpecs(mass=1568, wheelbase=2.67, steerRatio=12.5),
dbc_dict('subaru_outback_2015_generated', None),
specs=CarSpecs(mass=1568, wheelbase=2.67, steerRatio=12.5),
flags=SubaruFlags.PREGLOBAL,
)
OUTBACK_PREGLOBAL = SubaruPlatformConfig(
"SUBARU OUTBACK 2015 - 2017",
SubaruCarInfo("Subaru Outback 2015-17"),
FORESTER_PREGLOBAL.specs,
dbc_dict('subaru_outback_2015_generated', None),
specs=FORESTER_PREGLOBAL.specs,
flags=SubaruFlags.PREGLOBAL,
)
OUTBACK_PREGLOBAL_2018 = SubaruPlatformConfig(
"SUBARU OUTBACK 2018 - 2019",
SubaruCarInfo("Subaru Outback 2018-19"),
FORESTER_PREGLOBAL.specs,
dbc_dict('subaru_outback_2019_generated', None),
specs=FORESTER_PREGLOBAL.specs,
flags=SubaruFlags.PREGLOBAL,
)
# Angle LKAS
FORESTER_2022 = SubaruPlatformConfig(
"SUBARU FORESTER 2022",
SubaruCarInfo("Subaru Forester 2022-24", "All", car_parts=CarParts.common([CarHarness.subaru_c])),
specs=FORESTER.specs,
FORESTER.specs,
flags=SubaruFlags.LKAS_ANGLE,
)
OUTBACK_2023 = SubaruGen2PlatformConfig(
"SUBARU OUTBACK 7TH GEN",
SubaruCarInfo("Subaru Outback 2023", "All", car_parts=CarParts.common([CarHarness.subaru_d])),
specs=OUTBACK.specs,
OUTBACK.specs,
flags=SubaruFlags.LKAS_ANGLE,
)
ASCENT_2023 = SubaruGen2PlatformConfig(
"SUBARU ASCENT 2023",
SubaruCarInfo("Subaru Ascent 2023", "All", car_parts=CarParts.common([CarHarness.subaru_d])),
specs=ASCENT.specs,
ASCENT.specs,
flags=SubaruFlags.LKAS_ANGLE,
)

@ -20,12 +20,12 @@ class CAR(Platforms):
AP1_MODELS = TeslaPlatformConfig(
'TESLA AP1 MODEL S',
CarInfo("Tesla AP1 Model S", "All"),
specs=CarSpecs(mass=2100., wheelbase=2.959, steerRatio=15.0)
CarSpecs(mass=2100., wheelbase=2.959, steerRatio=15.0)
)
AP2_MODELS = TeslaPlatformConfig(
'TESLA AP2 MODEL S',
CarInfo("Tesla AP2 Model S", "All"),
specs=AP1_MODELS.specs
AP1_MODELS.specs
)

@ -10,13 +10,11 @@ class TestPlatformConfigs(unittest.TestCase):
for platform in PLATFORMS.values():
with self.subTest(platform=str(platform)):
if hasattr(platform, "config"):
self.assertTrue(platform.config._frozen)
self.assertIn("pt", platform.config.dbc_dict)
self.assertTrue(len(platform.config.platform_str) > 0)
self.assertTrue(platform.config._frozen)
self.assertIn("pt", platform.config.dbc_dict)
self.assertTrue(len(platform.config.platform_str) > 0)
self.assertIsNotNone(platform.config.specs)
self.assertIsNotNone(platform.config.specs)
if __name__ == "__main__":

@ -88,7 +88,7 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Alphard 2019-20"),
ToyotaCarInfo("Toyota Alphard Hybrid 2021"),
],
specs=CarSpecs(mass=4305. * CV.LB_TO_KG, wheelbase=3.0, steerRatio=14.2, tireStiffnessFactor=0.444),
CarSpecs(mass=4305. * CV.LB_TO_KG, wheelbase=3.0, steerRatio=14.2, tireStiffnessFactor=0.444),
)
AVALON = PlatformConfig(
"TOYOTA AVALON 2016",
@ -96,8 +96,8 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Avalon 2016", "Toyota Safety Sense P"),
ToyotaCarInfo("Toyota Avalon 2017-18"),
],
CarSpecs(mass=3505. * CV.LB_TO_KG, wheelbase=2.82, steerRatio=14.8, tireStiffnessFactor=0.7983),
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
specs=CarSpecs(mass=3505. * CV.LB_TO_KG, wheelbase=2.82, steerRatio=14.8, tireStiffnessFactor=0.7983),
)
AVALON_2019 = PlatformConfig(
"TOYOTA AVALON 2019",
@ -105,8 +105,8 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Avalon 2019-21"),
ToyotaCarInfo("Toyota Avalon Hybrid 2019-21"),
],
AVALON.specs,
dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
specs=AVALON.specs,
)
AVALON_TSS2 = ToyotaTSS2PlatformConfig(
"TOYOTA AVALON 2022", # TSS 2.5
@ -114,7 +114,7 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Avalon 2022"),
ToyotaCarInfo("Toyota Avalon Hybrid 2022"),
],
specs=AVALON.specs,
AVALON.specs,
)
CAMRY = PlatformConfig(
"TOYOTA CAMRY 2018",
@ -122,9 +122,9 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Camry 2018-20", video_link="https://www.youtube.com/watch?v=fkcjviZY9CM", footnotes=[Footnote.CAMRY]),
ToyotaCarInfo("Toyota Camry Hybrid 2018-20", video_link="https://www.youtube.com/watch?v=Q2DYY0AWKgk"),
],
CarSpecs(mass=3400. * CV.LB_TO_KG, wheelbase=2.82448, steerRatio=13.7, tireStiffnessFactor=0.7933),
dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.NO_DSU,
specs=CarSpecs(mass=3400. * CV.LB_TO_KG, wheelbase=2.82448, steerRatio=13.7, tireStiffnessFactor=0.7933),
)
CAMRY_TSS2 = ToyotaTSS2PlatformConfig(
"TOYOTA CAMRY 2021", # TSS 2.5
@ -132,7 +132,7 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Camry 2021-24", footnotes=[Footnote.CAMRY]),
ToyotaCarInfo("Toyota Camry Hybrid 2021-24"),
],
specs=CAMRY.specs,
CAMRY.specs,
)
CHR = PlatformConfig(
"TOYOTA C-HR 2018",
@ -140,9 +140,9 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota C-HR 2017-20"),
ToyotaCarInfo("Toyota C-HR Hybrid 2017-20"),
],
CarSpecs(mass=3300. * CV.LB_TO_KG, wheelbase=2.63906, steerRatio=13.6, tireStiffnessFactor=0.7933),
dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.NO_DSU,
specs=CarSpecs(mass=3300. * CV.LB_TO_KG, wheelbase=2.63906, steerRatio=13.6, tireStiffnessFactor=0.7933),
)
CHR_TSS2 = ToyotaTSS2PlatformConfig(
"TOYOTA C-HR 2021",
@ -150,14 +150,14 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota C-HR 2021"),
ToyotaCarInfo("Toyota C-HR Hybrid 2021-22"),
],
CHR.specs,
flags=ToyotaFlags.RADAR_ACC,
specs=CHR.specs,
)
COROLLA = PlatformConfig(
"TOYOTA COROLLA 2017",
ToyotaCarInfo("Toyota Corolla 2017-19"),
CarSpecs(mass=2860. * CV.LB_TO_KG, wheelbase=2.7, steerRatio=18.27, tireStiffnessFactor=0.444),
dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'),
specs=CarSpecs(mass=2860. * CV.LB_TO_KG, wheelbase=2.7, steerRatio=18.27, tireStiffnessFactor=0.444),
)
# LSS2 Lexus UX Hybrid is same as a TSS2 Corolla Hybrid
COROLLA_TSS2 = ToyotaTSS2PlatformConfig(
@ -172,7 +172,7 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Corolla Cross Hybrid (Non-US only) 2020-22", min_enable_speed=7.5),
ToyotaCarInfo("Lexus UX Hybrid 2019-23"),
],
specs=CarSpecs(mass=3060. * CV.LB_TO_KG, wheelbase=2.67, steerRatio=13.9, tireStiffnessFactor=0.444),
CarSpecs(mass=3060. * CV.LB_TO_KG, wheelbase=2.67, steerRatio=13.9, tireStiffnessFactor=0.444),
)
HIGHLANDER = PlatformConfig(
"TOYOTA HIGHLANDER 2017",
@ -180,9 +180,9 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Highlander 2017-19", video_link="https://www.youtube.com/watch?v=0wS0wXSLzoo"),
ToyotaCarInfo("Toyota Highlander Hybrid 2017-19"),
],
CarSpecs(mass=4516. * CV.LB_TO_KG, wheelbase=2.8194, steerRatio=16.0, tireStiffnessFactor=0.8),
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.NO_STOP_TIMER,
specs=CarSpecs(mass=4516. * CV.LB_TO_KG, wheelbase=2.8194, steerRatio=16.0, tireStiffnessFactor=0.8),
)
HIGHLANDER_TSS2 = ToyotaTSS2PlatformConfig(
"TOYOTA HIGHLANDER 2020",
@ -190,7 +190,7 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Highlander 2020-23"),
ToyotaCarInfo("Toyota Highlander Hybrid 2020-23"),
],
specs=HIGHLANDER.specs,
HIGHLANDER.specs,
)
PRIUS = PlatformConfig(
"TOYOTA PRIUS 2017",
@ -199,15 +199,15 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Prius 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"),
ToyotaCarInfo("Toyota Prius Prime 2017-20", video_link="https://www.youtube.com/watch?v=8zopPJI8XQ0"),
],
CarSpecs(mass=3045. * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.74, tireStiffnessFactor=0.6371),
dbc_dict('toyota_nodsu_pt_generated', 'toyota_adas'),
specs=CarSpecs(mass=3045. * CV.LB_TO_KG, wheelbase=2.7, steerRatio=15.74, tireStiffnessFactor=0.6371),
)
PRIUS_V = PlatformConfig(
"TOYOTA PRIUS v 2017",
ToyotaCarInfo("Toyota Prius v 2017", "Toyota Safety Sense P", min_enable_speed=MIN_ACC_SPEED),
CarSpecs(mass=3340. * CV.LB_TO_KG, wheelbase=2.78, steerRatio=17.4, tireStiffnessFactor=0.5533),
dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.NO_STOP_TIMER,
specs=CarSpecs(mass=3340. * CV.LB_TO_KG, wheelbase=2.78, steerRatio=17.4, tireStiffnessFactor=0.5533),
)
PRIUS_TSS2 = ToyotaTSS2PlatformConfig(
"TOYOTA PRIUS TSS2 2021",
@ -215,7 +215,7 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota Prius 2021-22", video_link="https://www.youtube.com/watch?v=J58TvCpUd4U"),
ToyotaCarInfo("Toyota Prius Prime 2021-22", video_link="https://www.youtube.com/watch?v=J58TvCpUd4U"),
],
specs=CarSpecs(mass=3115. * CV.LB_TO_KG, wheelbase=2.70002, steerRatio=13.4, tireStiffnessFactor=0.6371),
CarSpecs(mass=3115. * CV.LB_TO_KG, wheelbase=2.70002, steerRatio=13.4, tireStiffnessFactor=0.6371),
)
RAV4 = PlatformConfig(
"TOYOTA RAV4 2017",
@ -223,8 +223,8 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota RAV4 2016", "Toyota Safety Sense P"),
ToyotaCarInfo("Toyota RAV4 2017-18")
],
CarSpecs(mass=3650. * CV.LB_TO_KG, wheelbase=2.65, steerRatio=16.88, tireStiffnessFactor=0.5533),
dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'),
specs=CarSpecs(mass=3650. * CV.LB_TO_KG, wheelbase=2.65, steerRatio=16.88, tireStiffnessFactor=0.5533),
)
RAV4H = PlatformConfig(
"TOYOTA RAV4 HYBRID 2017",
@ -232,9 +232,9 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota RAV4 Hybrid 2016", "Toyota Safety Sense P", video_link="https://youtu.be/LhT5VzJVfNI?t=26"),
ToyotaCarInfo("Toyota RAV4 Hybrid 2017-18", video_link="https://youtu.be/LhT5VzJVfNI?t=26")
],
RAV4.specs,
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.NO_STOP_TIMER,
specs=RAV4.specs,
)
RAV4_TSS2 = ToyotaTSS2PlatformConfig(
"TOYOTA RAV4 2019",
@ -242,7 +242,7 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota RAV4 2019-21", video_link="https://www.youtube.com/watch?v=wJxjDd42gGA"),
ToyotaCarInfo("Toyota RAV4 Hybrid 2019-21"),
],
specs=CarSpecs(mass=3585. * CV.LB_TO_KG, wheelbase=2.68986, steerRatio=14.3, tireStiffnessFactor=0.7933),
CarSpecs(mass=3585. * CV.LB_TO_KG, wheelbase=2.68986, steerRatio=14.3, tireStiffnessFactor=0.7933),
)
RAV4_TSS2_2022 = ToyotaTSS2PlatformConfig(
"TOYOTA RAV4 2022",
@ -250,8 +250,8 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota RAV4 2022"),
ToyotaCarInfo("Toyota RAV4 Hybrid 2022", video_link="https://youtu.be/U0nH9cnrFB0"),
],
RAV4_TSS2.specs,
flags=ToyotaFlags.RADAR_ACC,
specs=RAV4_TSS2.specs,
)
RAV4_TSS2_2023 = ToyotaTSS2PlatformConfig(
"TOYOTA RAV4 2023",
@ -259,28 +259,28 @@ class CAR(Platforms):
ToyotaCarInfo("Toyota RAV4 2023-24"),
ToyotaCarInfo("Toyota RAV4 Hybrid 2023-24"),
],
RAV4_TSS2.specs,
flags=ToyotaFlags.RADAR_ACC | ToyotaFlags.ANGLE_CONTROL,
specs=RAV4_TSS2.specs,
)
MIRAI = ToyotaTSS2PlatformConfig(
"TOYOTA MIRAI 2021", # TSS 2.5
ToyotaCarInfo("Toyota Mirai 2021"),
specs=CarSpecs(mass=4300. * CV.LB_TO_KG, wheelbase=2.91, steerRatio=14.8, tireStiffnessFactor=0.8),
CarSpecs(mass=4300. * CV.LB_TO_KG, wheelbase=2.91, steerRatio=14.8, tireStiffnessFactor=0.8),
)
SIENNA = PlatformConfig(
"TOYOTA SIENNA 2018",
ToyotaCarInfo("Toyota Sienna 2018-20", video_link="https://www.youtube.com/watch?v=q1UPOo4Sh68", min_enable_speed=MIN_ACC_SPEED),
CarSpecs(mass=4590. * CV.LB_TO_KG, wheelbase=3.03, steerRatio=15.5, tireStiffnessFactor=0.444),
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.NO_STOP_TIMER,
specs=CarSpecs(mass=4590. * CV.LB_TO_KG, wheelbase=3.03, steerRatio=15.5, tireStiffnessFactor=0.444),
)
# Lexus
LEXUS_CTH = PlatformConfig(
"LEXUS CT HYBRID 2018",
ToyotaCarInfo("Lexus CT Hybrid 2017-18", "Lexus Safety System+"),
CarSpecs(mass=3108. * CV.LB_TO_KG, wheelbase=2.6, steerRatio=18.6, tireStiffnessFactor=0.517),
dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'),
specs=CarSpecs(mass=3108. * CV.LB_TO_KG, wheelbase=2.6, steerRatio=18.6, tireStiffnessFactor=0.517),
)
LEXUS_ES = PlatformConfig(
"LEXUS ES 2018",
@ -288,8 +288,8 @@ class CAR(Platforms):
ToyotaCarInfo("Lexus ES 2017-18"),
ToyotaCarInfo("Lexus ES Hybrid 2017-18"),
],
CarSpecs(mass=3677. * CV.LB_TO_KG, wheelbase=2.8702, steerRatio=16.0, tireStiffnessFactor=0.444),
dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'),
specs=CarSpecs(mass=3677. * CV.LB_TO_KG, wheelbase=2.8702, steerRatio=16.0, tireStiffnessFactor=0.444),
)
LEXUS_ES_TSS2 = ToyotaTSS2PlatformConfig(
"LEXUS ES 2019",
@ -297,19 +297,19 @@ class CAR(Platforms):
ToyotaCarInfo("Lexus ES 2019-24"),
ToyotaCarInfo("Lexus ES Hybrid 2019-24", video_link="https://youtu.be/BZ29osRVJeg?t=12"),
],
specs=LEXUS_ES.specs,
LEXUS_ES.specs,
)
LEXUS_IS = PlatformConfig(
"LEXUS IS 2018",
ToyotaCarInfo("Lexus IS 2017-19"),
CarSpecs(mass=3736.8 * CV.LB_TO_KG, wheelbase=2.79908, steerRatio=13.3, tireStiffnessFactor=0.444),
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.UNSUPPORTED_DSU,
specs=CarSpecs(mass=3736.8 * CV.LB_TO_KG, wheelbase=2.79908, steerRatio=13.3, tireStiffnessFactor=0.444),
)
LEXUS_IS_TSS2 = ToyotaTSS2PlatformConfig(
"LEXUS IS 2023",
ToyotaCarInfo("Lexus IS 2022-23"),
specs=LEXUS_IS.specs,
LEXUS_IS.specs,
)
LEXUS_NX = PlatformConfig(
"LEXUS NX 2018",
@ -317,8 +317,8 @@ class CAR(Platforms):
ToyotaCarInfo("Lexus NX 2018-19"),
ToyotaCarInfo("Lexus NX Hybrid 2018-19"),
],
CarSpecs(mass=4070. * CV.LB_TO_KG, wheelbase=2.66, steerRatio=14.7, tireStiffnessFactor=0.444),
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
specs=CarSpecs(mass=4070. * CV.LB_TO_KG, wheelbase=2.66, steerRatio=14.7, tireStiffnessFactor=0.444),
)
LEXUS_NX_TSS2 = ToyotaTSS2PlatformConfig(
"LEXUS NX 2020",
@ -326,19 +326,19 @@ class CAR(Platforms):
ToyotaCarInfo("Lexus NX 2020-21"),
ToyotaCarInfo("Lexus NX Hybrid 2020-21"),
],
specs=LEXUS_NX.specs,
LEXUS_NX.specs,
)
LEXUS_LC_TSS2 = ToyotaTSS2PlatformConfig(
"LEXUS LC 2024",
ToyotaCarInfo("Lexus LC 2024"),
specs=CarSpecs(mass=4500. * CV.LB_TO_KG, wheelbase=2.87, steerRatio=13.0, tireStiffnessFactor=0.444),
CarSpecs(mass=4500. * CV.LB_TO_KG, wheelbase=2.87, steerRatio=13.0, tireStiffnessFactor=0.444),
)
LEXUS_RC = PlatformConfig(
"LEXUS RC 2020",
ToyotaCarInfo("Lexus RC 2018-20"),
LEXUS_IS.specs,
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.UNSUPPORTED_DSU,
specs=LEXUS_IS.specs,
)
LEXUS_RX = PlatformConfig(
"LEXUS RX 2016",
@ -349,8 +349,8 @@ class CAR(Platforms):
ToyotaCarInfo("Lexus RX Hybrid 2016", "Lexus Safety System+"),
ToyotaCarInfo("Lexus RX Hybrid 2017-19"),
],
CarSpecs(mass=4481. * CV.LB_TO_KG, wheelbase=2.79, steerRatio=16., tireStiffnessFactor=0.5533),
dbc_dict('toyota_tnga_k_pt_generated', 'toyota_adas'),
specs=CarSpecs(mass=4481. * CV.LB_TO_KG, wheelbase=2.79, steerRatio=16., tireStiffnessFactor=0.5533),
)
LEXUS_RX_TSS2 = ToyotaTSS2PlatformConfig(
"LEXUS RX 2020",
@ -358,14 +358,14 @@ class CAR(Platforms):
ToyotaCarInfo("Lexus RX 2020-22"),
ToyotaCarInfo("Lexus RX Hybrid 2020-22"),
],
specs=LEXUS_RX.specs,
LEXUS_RX.specs,
)
LEXUS_GS_F = PlatformConfig(
"LEXUS GS F 2016",
ToyotaCarInfo("Lexus GS F 2016"),
CarSpecs(mass=4034. * CV.LB_TO_KG, wheelbase=2.84988, steerRatio=13.3, tireStiffnessFactor=0.444),
dbc_dict('toyota_new_mc_pt_generated', 'toyota_adas'),
flags=ToyotaFlags.UNSUPPORTED_DSU,
specs=CarSpecs(mass=4034. * CV.LB_TO_KG, wheelbase=2.84988, steerRatio=13.3, tireStiffnessFactor=0.444),
)

@ -184,7 +184,7 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Arteon eHybrid 2020-23", video_link="https://youtu.be/FAomFKPFlDA"),
VWCarInfo("Volkswagen CC 2018-22", video_link="https://youtu.be/FAomFKPFlDA"),
],
specs=VolkswagenCarSpecs(mass=1733, wheelbase=2.84),
VolkswagenCarSpecs(mass=1733, wheelbase=2.84),
)
ATLAS_MK1 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN ATLAS 1ST GEN", # Chassis CA
@ -195,7 +195,7 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Teramont Cross Sport 2021-22"),
VWCarInfo("Volkswagen Teramont X 2021-22"),
],
specs=VolkswagenCarSpecs(mass=2011, wheelbase=2.98),
VolkswagenCarSpecs(mass=2011, wheelbase=2.98),
)
CRAFTER_MK2 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN CRAFTER 2ND GEN", # Chassis SY/SZ
@ -206,7 +206,7 @@ class CAR(Platforms):
VWCarInfo("MAN TGE 2017-23", video_link="https://youtu.be/4100gLeabmo"),
VWCarInfo("MAN eTGE 2020-23", video_link="https://youtu.be/4100gLeabmo"),
],
specs=VolkswagenCarSpecs(mass=2100, wheelbase=3.64, minSteerSpeed=50 * CV.KPH_TO_MS),
VolkswagenCarSpecs(mass=2100, wheelbase=3.64, minSteerSpeed=50 * CV.KPH_TO_MS),
)
GOLF_MK7 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN GOLF 7TH GEN", # Chassis 5G/AU/BA/BE
@ -220,7 +220,7 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Golf R 2015-19"),
VWCarInfo("Volkswagen Golf SportsVan 2015-20"),
],
specs=VolkswagenCarSpecs(mass=1397, wheelbase=2.62),
VolkswagenCarSpecs(mass=1397, wheelbase=2.62),
)
JETTA_MK7 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN JETTA 7TH GEN", # Chassis BU
@ -228,7 +228,7 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Jetta 2018-24"),
VWCarInfo("Volkswagen Jetta GLI 2021-24"),
],
specs=VolkswagenCarSpecs(mass=1328, wheelbase=2.71),
VolkswagenCarSpecs(mass=1328, wheelbase=2.71),
)
PASSAT_MK8 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN PASSAT 8TH GEN", # Chassis 3G
@ -237,12 +237,12 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Passat Alltrack 2015-22"),
VWCarInfo("Volkswagen Passat GTE 2015-22"),
],
specs=VolkswagenCarSpecs(mass=1551, wheelbase=2.79),
VolkswagenCarSpecs(mass=1551, wheelbase=2.79),
)
PASSAT_NMS = VolkswagenPQPlatformConfig(
"VOLKSWAGEN PASSAT NMS", # Chassis A3
VWCarInfo("Volkswagen Passat NMS 2017-22"),
specs=VolkswagenCarSpecs(mass=1503, wheelbase=2.80, minSteerSpeed=50*CV.KPH_TO_MS, minEnableSpeed=20*CV.KPH_TO_MS),
VolkswagenCarSpecs(mass=1503, wheelbase=2.80, minSteerSpeed=50*CV.KPH_TO_MS, minEnableSpeed=20*CV.KPH_TO_MS),
)
POLO_MK6 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN POLO 6TH GEN", # Chassis AW
@ -250,7 +250,7 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Polo 2018-23", footnotes=[Footnote.VW_MQB_A0]),
VWCarInfo("Volkswagen Polo GTI 2018-23", footnotes=[Footnote.VW_MQB_A0]),
],
specs=VolkswagenCarSpecs(mass=1230, wheelbase=2.55),
VolkswagenCarSpecs(mass=1230, wheelbase=2.55),
)
SHARAN_MK2 = VolkswagenPQPlatformConfig(
"VOLKSWAGEN SHARAN 2ND GEN", # Chassis 7N
@ -258,17 +258,17 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Sharan 2018-22"),
VWCarInfo("SEAT Alhambra 2018-20"),
],
specs=VolkswagenCarSpecs(mass=1639, wheelbase=2.92, minSteerSpeed=50*CV.KPH_TO_MS),
VolkswagenCarSpecs(mass=1639, wheelbase=2.92, minSteerSpeed=50*CV.KPH_TO_MS),
)
TAOS_MK1 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN TAOS 1ST GEN", # Chassis B2
VWCarInfo("Volkswagen Taos 2022-23"),
specs=VolkswagenCarSpecs(mass=1498, wheelbase=2.69),
VolkswagenCarSpecs(mass=1498, wheelbase=2.69),
)
TCROSS_MK1 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN T-CROSS 1ST GEN", # Chassis C1
car_info=VWCarInfo("Volkswagen T-Cross 2021", footnotes=[Footnote.VW_MQB_A0]),
specs=VolkswagenCarSpecs(mass=1150, wheelbase=2.60),
VWCarInfo("Volkswagen T-Cross 2021", footnotes=[Footnote.VW_MQB_A0]),
VolkswagenCarSpecs(mass=1150, wheelbase=2.60),
)
TIGUAN_MK2 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN TIGUAN 2ND GEN", # Chassis AD/BW
@ -276,12 +276,12 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Tiguan 2018-24"),
VWCarInfo("Volkswagen Tiguan eHybrid 2021-23"),
],
specs=VolkswagenCarSpecs(mass=1715, wheelbase=2.74),
VolkswagenCarSpecs(mass=1715, wheelbase=2.74),
)
TOURAN_MK2 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN TOURAN 2ND GEN", # Chassis 1T
VWCarInfo("Volkswagen Touran 2016-23"),
specs=VolkswagenCarSpecs(mass=1516, wheelbase=2.79),
VolkswagenCarSpecs(mass=1516, wheelbase=2.79),
)
TRANSPORTER_T61 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN TRANSPORTER T6.1", # Chassis 7H/7L
@ -289,12 +289,12 @@ class CAR(Platforms):
VWCarInfo("Volkswagen Caravelle 2020"),
VWCarInfo("Volkswagen California 2021-23"),
],
specs=VolkswagenCarSpecs(mass=1926, wheelbase=3.00, minSteerSpeed=14.0),
VolkswagenCarSpecs(mass=1926, wheelbase=3.00, minSteerSpeed=14.0),
)
TROC_MK1 = VolkswagenMQBPlatformConfig(
"VOLKSWAGEN T-ROC 1ST GEN", # Chassis A1
VWCarInfo("Volkswagen T-Roc 2018-22", footnotes=[Footnote.VW_MQB_A0]),
specs=VolkswagenCarSpecs(mass=1413, wheelbase=2.63),
VolkswagenCarSpecs(mass=1413, wheelbase=2.63),
)
AUDI_A3_MK3 = VolkswagenMQBPlatformConfig(
"AUDI A3 3RD GEN", # Chassis 8V/FF
@ -304,47 +304,47 @@ class CAR(Platforms):
VWCarInfo("Audi RS3 2018"),
VWCarInfo("Audi S3 2015-17"),
],
specs=VolkswagenCarSpecs(mass=1335, wheelbase=2.61),
VolkswagenCarSpecs(mass=1335, wheelbase=2.61),
)
AUDI_Q2_MK1 = VolkswagenMQBPlatformConfig(
"AUDI Q2 1ST GEN", # Chassis GA
VWCarInfo("Audi Q2 2018"),
specs=VolkswagenCarSpecs(mass=1205, wheelbase=2.61),
VolkswagenCarSpecs(mass=1205, wheelbase=2.61),
)
AUDI_Q3_MK2 = VolkswagenMQBPlatformConfig(
"AUDI Q3 2ND GEN", # Chassis 8U/F3/FS
VWCarInfo("Audi Q3 2019-23"),
specs=VolkswagenCarSpecs(mass=1623, wheelbase=2.68),
VolkswagenCarSpecs(mass=1623, wheelbase=2.68),
)
SEAT_ATECA_MK1 = VolkswagenMQBPlatformConfig(
"SEAT ATECA 1ST GEN", # Chassis 5F
VWCarInfo("SEAT Ateca 2018"),
specs=VolkswagenCarSpecs(mass=1900, wheelbase=2.64),
VolkswagenCarSpecs(mass=1900, wheelbase=2.64),
)
SEAT_LEON_MK3 = VolkswagenMQBPlatformConfig(
"SEAT LEON 3RD GEN", # Chassis 5F
VWCarInfo("SEAT Leon 2014-20"),
specs=VolkswagenCarSpecs(mass=1227, wheelbase=2.64),
VolkswagenCarSpecs(mass=1227, wheelbase=2.64),
)
SKODA_FABIA_MK4 = VolkswagenMQBPlatformConfig(
"SKODA FABIA 4TH GEN", # Chassis PJ
VWCarInfo("Škoda Fabia 2022-23", footnotes=[Footnote.VW_MQB_A0]),
specs=VolkswagenCarSpecs(mass=1266, wheelbase=2.56),
VolkswagenCarSpecs(mass=1266, wheelbase=2.56),
)
SKODA_KAMIQ_MK1 = VolkswagenMQBPlatformConfig(
"SKODA KAMIQ 1ST GEN", # Chassis NW
VWCarInfo("Škoda Kamiq 2021-23", footnotes=[Footnote.VW_MQB_A0, Footnote.KAMIQ]),
specs=VolkswagenCarSpecs(mass=1265, wheelbase=2.66),
VolkswagenCarSpecs(mass=1265, wheelbase=2.66),
)
SKODA_KAROQ_MK1 = VolkswagenMQBPlatformConfig(
"SKODA KAROQ 1ST GEN", # Chassis NU
VWCarInfo("Škoda Karoq 2019-23"),
specs=VolkswagenCarSpecs(mass=1278, wheelbase=2.66),
VolkswagenCarSpecs(mass=1278, wheelbase=2.66),
)
SKODA_KODIAQ_MK1 = VolkswagenMQBPlatformConfig(
"SKODA KODIAQ 1ST GEN", # Chassis NS
VWCarInfo("Škoda Kodiaq 2017-23"),
specs=VolkswagenCarSpecs(mass=1569, wheelbase=2.79),
VolkswagenCarSpecs(mass=1569, wheelbase=2.79),
)
SKODA_OCTAVIA_MK3 = VolkswagenMQBPlatformConfig(
"SKODA OCTAVIA 3RD GEN", # Chassis NE
@ -352,17 +352,17 @@ class CAR(Platforms):
VWCarInfo("Škoda Octavia 2015-19"),
VWCarInfo("Škoda Octavia RS 2016"),
],
specs=VolkswagenCarSpecs(mass=1388, wheelbase=2.68),
VolkswagenCarSpecs(mass=1388, wheelbase=2.68),
)
SKODA_SCALA_MK1 = VolkswagenMQBPlatformConfig(
"SKODA SCALA 1ST GEN", # Chassis NW
VWCarInfo("Škoda Scala 2020-23", footnotes=[Footnote.VW_MQB_A0]),
specs=VolkswagenCarSpecs(mass=1192, wheelbase=2.65),
VolkswagenCarSpecs(mass=1192, wheelbase=2.65),
)
SKODA_SUPERB_MK3 = VolkswagenMQBPlatformConfig(
"SKODA SUPERB 3RD GEN", # Chassis 3V/NP
VWCarInfo("Škoda Superb 2015-22"),
specs=VolkswagenCarSpecs(mass=1505, wheelbase=2.84),
VolkswagenCarSpecs(mass=1505, wheelbase=2.84),
)

@ -7,6 +7,7 @@ from openpilot.selfdrive.car.car_helpers import interfaces
from openpilot.selfdrive.controls.controlsd import Controls, SOFT_DISABLE_TIME
from openpilot.selfdrive.controls.lib.events import Events, ET, Alert, Priority, AlertSize, AlertStatus, VisualAlert, \
AudibleAlert, EVENTS
from openpilot.selfdrive.car.mock.values import CAR as MOCK
State = log.ControlsState.OpenpilotState
@ -30,8 +31,8 @@ def make_event(event_types):
class TestStateMachine(unittest.TestCase):
def setUp(self):
CarInterface, CarController, CarState = interfaces["mock"]
CP = CarInterface.get_non_essential_params("mock")
CarInterface, CarController, CarState = interfaces[MOCK.MOCK]
CP = CarInterface.get_non_essential_params(MOCK.MOCK)
CI = CarInterface(CP, CarController, CarState)
self.controlsd = Controls(CI=CI)

Loading…
Cancel
Save