diff --git a/opendbc_repo b/opendbc_repo index 40951c19ee2422..661a42c91e28c3 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 40951c19ee2422a3a63eae878aedc9f0e1b255d4 +Subproject commit 661a42c91e28c370d90b3c4f0bf0f5a8cf015733 diff --git a/tools/cabana/dbc/generate_dbc_json.py b/tools/cabana/dbc/generate_dbc_json.py index 04d45f304a64af..5e928e6054f758 100755 --- a/tools/cabana/dbc/generate_dbc_json.py +++ b/tools/cabana/dbc/generate_dbc_json.py @@ -2,12 +2,23 @@ import argparse import json +from opendbc.car import Bus from opendbc.car.fingerprints import MIGRATION from opendbc.car.values import PLATFORMS def generate_dbc_json() -> str: - dbc_map = {platform.name: platform.config.dbc_dict['pt'] for platform in PLATFORMS.values() if platform != "MOCK"} + dbc_map = {} + for platform in PLATFORMS.values(): + if platform != "MOCK": + if Bus.pt in platform.config.dbc_dict: + dbc_map[platform.name] = platform.config.dbc_dict[Bus.pt] + elif Bus.main in platform.config.dbc_dict: + dbc_map[platform.name] = platform.config.dbc_dict[Bus.main] + elif Bus.party in platform.config.dbc_dict: + dbc_map[platform.name] = platform.config.dbc_dict[Bus.party] + else: + raise ValueError("Unknown main type") for m in MIGRATION: if MIGRATION[m] in dbc_map: