diff --git a/opendbc/car/gm/fingerprints.py b/opendbc/car/gm/fingerprints.py index 89bde82006..f443d082bb 100644 --- a/opendbc/car/gm/fingerprints.py +++ b/opendbc/car/gm/fingerprints.py @@ -1,7 +1,6 @@ # ruff: noqa: E501 from opendbc.car.gm.values import CAR -# Trailblazer also matches as a SILVERADO, TODO: split with fw versions # FIXME: There are Equinox users with different message lengths, specifically 304 and 320 @@ -48,9 +47,6 @@ CAR.CHEVROLET_BOLT_EUV: [{ 189: 7, 190: 7, 193: 8, 197: 8, 201: 8, 209: 7, 211: 3, 241: 6, 257: 8, 288: 5, 289: 8, 298: 8, 304: 3, 309: 8, 311: 8, 313: 8, 320: 4, 322: 7, 328: 1, 352: 5, 381: 8, 384: 4, 386: 8, 388: 8, 451: 8, 452: 8, 453: 6, 458: 5, 463: 3, 479: 3, 481: 7, 485: 8, 489: 8, 497: 8, 500: 6, 501: 8, 528: 5, 532: 6, 560: 8, 562: 8, 563: 5, 565: 5, 566: 8, 587: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 789: 5, 800: 6, 810: 8, 840: 5, 842: 5, 844: 8, 848: 4, 869: 4, 880: 6, 977: 8, 1001: 8, 1017: 8, 1020: 8, 1217: 8, 1221: 5, 1233: 8, 1249: 8, 1265: 8, 1280: 4, 1296: 4, 1300: 8, 1611: 8, 1930: 7 }], - CAR.CHEVROLET_SILVERADO: [{ - 190: 6, 193: 8, 197: 8, 201: 8, 208: 8, 209: 7, 211: 2, 241: 6, 249: 8, 257: 8, 288: 5, 289: 8, 298: 8, 304: 3, 309: 8, 311: 8, 313: 8, 320: 4, 322: 7, 328: 1, 352: 5, 381: 8, 384: 4, 386: 8, 388: 8, 413: 8, 451: 8, 452: 8, 453: 6, 455: 7, 460: 5, 463: 3, 479: 3, 481: 7, 485: 8, 489: 8, 497: 8, 500: 6, 501: 8, 528: 5, 532: 6, 534: 2, 560: 8, 562: 8, 563: 5, 565: 5, 587: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 707: 8, 715: 8, 717: 5, 761: 7, 789: 5, 800: 6, 801: 8, 810: 8, 840: 5, 842: 5, 844: 8, 848: 4, 869: 4, 880: 6, 977: 8, 1001: 8, 1011: 6, 1017: 8, 1020: 8, 1033: 7, 1034: 7, 1217: 8, 1221: 5, 1233: 8, 1249: 8, 1259: 8, 1261: 7, 1263: 4, 1265: 8, 1267: 1, 1271: 8, 1280: 4, 1296: 4, 1300: 8, 1611: 8, 1930: 7 - }], CAR.CHEVROLET_EQUINOX: [{ 190: 6, 193: 8, 197: 8, 201: 8, 209: 7, 211: 2, 241: 6, 249: 8, 257: 8, 288: 5, 289: 8, 298: 8, 304: 1, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 8, 384: 4, 386: 8, 388: 8, 413: 8, 451: 8, 452: 8, 453: 6, 455: 7, 463: 3, 479: 3, 481: 7, 485: 8, 489: 8, 497: 8, 500: 6, 501: 8, 510: 8, 528: 5, 532: 6, 560: 8, 562: 8, 563: 5, 565: 5, 587: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 707: 8, 715: 8, 717: 5, 753: 5, 761: 7, 789: 5, 800: 6, 810: 8, 840: 5, 842: 5, 844: 8, 869: 4, 880: 6, 977: 8, 1001: 8, 1011: 6, 1017: 8, 1020: 8, 1033: 7, 1034: 7, 1217: 8, 1221: 5, 1233: 8, 1249: 8, 1259: 8, 1261: 7, 1263: 4, 1265: 8, 1267: 1, 1271: 8, 1280: 4, 1296: 4, 1300: 8, 1611: 8, 1930: 7 }, diff --git a/opendbc/car/gm/values.py b/opendbc/car/gm/values.py index 4d58a27125..061aae8269 100644 --- a/opendbc/car/gm/values.py +++ b/opendbc/car/gm/values.py @@ -85,6 +85,8 @@ class GMPlatformConfig(PlatformConfig): Bus.radar: 'gm_global_a_object', Bus.chassis: 'gm_global_a_chassis', }) + wmis: set[str] = field(default_factory=set) + years: set[str] = field(default_factory=set) @dataclass @@ -154,6 +156,8 @@ class CAR(Platforms): GMCarDocs("GMC Sierra 1500 2020-21", "Driver Alert Package II", video_link="https://youtu.be/5HbNoBLzRwE"), ], GMCarSpecs(mass=2450, wheelbase=3.75, steerRatio=16.3, tireStiffnessFactor=1.0), + wmis={"3GC", "3GT", "1GC", "1GT"}, + years={"L", "M"}, ) CHEVROLET_EQUINOX = GMPlatformConfig( [GMCarDocs("Chevrolet Equinox 2019-22")], @@ -162,6 +166,8 @@ class CAR(Platforms): CHEVROLET_TRAILBLAZER = GMPlatformConfig( [GMCarDocs("Chevrolet Trailblazer 2021-22")], GMCarSpecs(mass=1345, wheelbase=2.64, steerRatio=16.8, centerToFrontRatio=0.4, tireStiffnessFactor=1.0), + wmis={"KL7"}, + years={"M", "N"}, ) CADILLAC_XT4 = GMSDGMPlatformConfig( [GMCarDocs("Cadillac XT4 2023", "Driver Assist Package")], @@ -180,6 +186,16 @@ class CAR(Platforms): GMCarSpecs(mass=2490, wheelbase=2.94, steerRatio=17.3, centerToFrontRatio=0.5, tireStiffnessFactor=1.0), ) +def match_fw_to_car_fuzzy(live_fw_versions, vin, offline_fw_versions) -> set[str]: + candidates = set() +# Check the WMI and chassis code to determine the platform + wmi = vin[:3] + year = vin[9:10] + for platform in CAR: + if wmi in platform.config.wmis and year in platform.config.years: + candidates.add(platform) + return {str(c) for c in candidates} + class CruiseButtons: INIT = 0 @@ -251,6 +267,7 @@ class CanBus: ), ]], extra_ecus=[(Ecu.fwdCamera, 0x24b, None)], + match_fw_to_car_fuzzy=match_fw_to_car_fuzzy, ) # TODO: detect most of these sets live