diff --git a/selfdrive/car/body/interface.py b/selfdrive/car/body/interface.py index 12a2d5f304..5b5885e6cd 100644 --- a/selfdrive/car/body/interface.py +++ b/selfdrive/car/body/interface.py @@ -7,7 +7,7 @@ from openpilot.selfdrive.car.body.values import SPEED_FROM_RPM class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.notCar = True ret.carName = "body" ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.body)] diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 339be1912c..30377d26b5 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -193,18 +193,18 @@ def fingerprint(logcan, sendcan, num_pandas): car_platform = PLATFORMS.get(car_fingerprint, car_fingerprint) - return car_platform, finger, vin, car_fw, source, exact_match + return car_platform, finger, vin, car_fw, list(), source, exact_match def get_car(logcan, sendcan, experimental_long_allowed, num_pandas=1): - candidate, fingerprints, vin, car_fw, source, exact_match = fingerprint(logcan, sendcan, num_pandas) + candidate, fingerprints, vin, car_fw, car_data, source, exact_match = fingerprint(logcan, sendcan, num_pandas) if candidate is None: cloudlog.event("car doesn't match any fingerprints", fingerprints=repr(fingerprints), error=True) candidate = "mock" CarInterface, CarController, CarState = interfaces[candidate] - CP = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False) + CP = CarInterface.get_params(candidate, fingerprints, car_fw, car_data, experimental_long_allowed, docs=False) CP.carVin = vin CP.carFw = car_fw CP.fingerprintSource = source diff --git a/selfdrive/car/chrysler/interface.py b/selfdrive/car/chrysler/interface.py index 32a4f5dfcf..c21255bc57 100755 --- a/selfdrive/car/chrysler/interface.py +++ b/selfdrive/car/chrysler/interface.py @@ -8,7 +8,7 @@ from openpilot.selfdrive.car.interfaces import CarInterfaceBase class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "chrysler" ret.dashcamOnly = candidate in RAM_HD diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index 685a2a27ad..0dbb75b469 100644 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -12,7 +12,7 @@ GearShifter = car.CarState.GearShifter class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "ford" ret.dashcamOnly = candidate in CANFD_CAR diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index 05caa28510..60c893c738 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -83,7 +83,7 @@ class CarInterface(CarInterfaceBase): return self.torque_from_lateral_accel_linear @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "gm" ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.gm)] ret.autoResumeSng = False diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 153fa1e635..6795959e31 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -33,7 +33,7 @@ class CarInterface(CarInterfaceBase): return CarControllerParams.NIDEC_ACCEL_MIN, interp(current_speed, ACCEL_MAX_BP, ACCEL_MAX_VALS) @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "honda" if candidate in HONDA_BOSCH: diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index 049a63399c..3882fdcb2c 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -20,7 +20,7 @@ BUTTONS_DICT = {Buttons.RES_ACCEL: ButtonType.accelCruise, Buttons.SET_DECEL: Bu class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "hyundai" ret.radarUnavailable = RADAR_START_ADDR not in fingerprint[1] or DBC[ret.carFingerprint]["radar"] is None diff --git a/selfdrive/car/interfaces.py b/selfdrive/car/interfaces.py index 4516ff3a9a..88b5c6fd2e 100644 --- a/selfdrive/car/interfaces.py +++ b/selfdrive/car/interfaces.py @@ -106,10 +106,12 @@ class CarInterfaceBase(ABC): """ Parameters essential to controlling the car may be incomplete or wrong without FW versions or fingerprints. """ - return cls.get_params(candidate, gen_empty_fingerprint(), list(), False, False) + return cls.get_params(candidate, gen_empty_fingerprint(), list(), list(), False, False) @classmethod - def get_params(cls, candidate: Platform, fingerprint: dict[int, dict[int, int]], car_fw: list[car.CarParams.CarFw], experimental_long: bool, docs: bool): + def get_params(cls, candidate: Platform, fingerprint: dict[int, dict[int, int]], + car_fw: list[car.CarParams.CarFw], car_data: list[car.CarParams.CarFw], + experimental_long: bool, docs: bool): ret = CarInterfaceBase.get_std_params(candidate) if hasattr(candidate, "config"): @@ -119,7 +121,7 @@ class CarInterfaceBase(ABC): ret.wheelbase = platform_config.specs.wheelbase ret.steerRatio = platform_config.specs.steerRatio - ret = cls._get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs) + ret = cls._get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs) # Vehicle mass is published curb weight plus assumed payload such as a human driver; notCars have no assumed payload if not ret.notCar: @@ -134,7 +136,8 @@ class CarInterfaceBase(ABC): @staticmethod @abstractmethod def _get_params(ret: car.CarParams, candidate: Platform, fingerprint: dict[int, dict[int, int]], - car_fw: list[car.CarParams.CarFw], experimental_long: bool, docs: bool): + car_fw: list[car.CarParams.CarFw], car_data: list[car.CarParams.CarFw], + experimental_long: bool, docs: bool): raise NotImplementedError @staticmethod diff --git a/selfdrive/car/mazda/interface.py b/selfdrive/car/mazda/interface.py index 7ac93d9dee..ff59d34166 100755 --- a/selfdrive/car/mazda/interface.py +++ b/selfdrive/car/mazda/interface.py @@ -11,7 +11,7 @@ EventName = car.CarEvent.EventName class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "mazda" ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.mazda)] ret.radarUnavailable = True diff --git a/selfdrive/car/mock/interface.py b/selfdrive/car/mock/interface.py index 2e4ac43033..bc676f7602 100755 --- a/selfdrive/car/mock/interface.py +++ b/selfdrive/car/mock/interface.py @@ -12,7 +12,7 @@ class CarInterface(CarInterfaceBase): self.sm = messaging.SubMaster(['gpsLocation', 'gpsLocationExternal']) @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "mock" ret.mass = 1700. ret.wheelbase = 2.70 diff --git a/selfdrive/car/nissan/interface.py b/selfdrive/car/nissan/interface.py index aedcaa1887..6c6d4fadf2 100644 --- a/selfdrive/car/nissan/interface.py +++ b/selfdrive/car/nissan/interface.py @@ -8,7 +8,7 @@ from openpilot.selfdrive.car.nissan.values import CAR class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "nissan" ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.nissan)] ret.autoResumeSng = False diff --git a/selfdrive/car/subaru/interface.py b/selfdrive/car/subaru/interface.py index 1358adb69c..649fcb4160 100644 --- a/selfdrive/car/subaru/interface.py +++ b/selfdrive/car/subaru/interface.py @@ -10,7 +10,7 @@ from openpilot.selfdrive.car.subaru.values import CAR, GLOBAL_ES_ADDR, LKAS_ANGL class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate: Platform, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate: Platform, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "subaru" ret.radarUnavailable = True # for HYBRID CARS to be upstreamed, we need: diff --git a/selfdrive/car/tesla/interface.py b/selfdrive/car/tesla/interface.py index e06139729c..baab46a5ae 100755 --- a/selfdrive/car/tesla/interface.py +++ b/selfdrive/car/tesla/interface.py @@ -8,7 +8,7 @@ from openpilot.selfdrive.car.interfaces import CarInterfaceBase class CarInterface(CarInterfaceBase): @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "tesla" # There is no safe way to do steer blending with user torque, diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 2b29c14f72..1564292b2e 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -76,6 +76,7 @@ class TestCarModelBase(unittest.TestCase): @classmethod def get_testing_data_from_logreader(cls, lr): car_fw = [] + car_data = [] can_msgs = [] cls.elm_frame = None cls.car_safety_mode_frame = None @@ -113,7 +114,7 @@ class TestCarModelBase(unittest.TestCase): cls.car_safety_mode_frame = len(can_msgs) if len(can_msgs) > int(50 / DT_CTRL): - return car_fw, can_msgs, experimental_long + return car_fw, car_data, can_msgs, experimental_long raise Exception("no can data found") @@ -165,7 +166,7 @@ class TestCarModelBase(unittest.TestCase): raise unittest.SkipTest raise Exception(f"missing test route for {cls.car_model}") - car_fw, can_msgs, experimental_long = cls.get_testing_data() + car_fw, car_data, can_msgs, experimental_long = cls.get_testing_data() # if relay is expected to be open in the route cls.openpilot_enabled = cls.car_safety_mode_frame is not None @@ -173,7 +174,7 @@ class TestCarModelBase(unittest.TestCase): cls.can_msgs = sorted(can_msgs, key=lambda msg: msg.logMonoTime) cls.CarInterface, cls.CarController, cls.CarState = interfaces[cls.car_model] - cls.CP = cls.CarInterface.get_params(cls.car_model, cls.fingerprint, car_fw, experimental_long, docs=False) + cls.CP = cls.CarInterface.get_params(cls.car_model, cls.fingerprint, car_fw, car_data, experimental_long, docs=False) assert cls.CP assert cls.CP.carFingerprint == cls.car_model diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 988b1b4547..3886da605a 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -18,7 +18,7 @@ class CarInterface(CarInterfaceBase): return CarControllerParams.ACCEL_MIN, CarControllerParams.ACCEL_MAX @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "toyota" ret.safetyConfigs = [get_safety_config(car.CarParams.SafetyModel.toyota)] ret.safetyConfigs[0].safetyParam = EPS_SCALE[candidate] diff --git a/selfdrive/car/volkswagen/interface.py b/selfdrive/car/volkswagen/interface.py index 544d104d33..b2b5be7e32 100644 --- a/selfdrive/car/volkswagen/interface.py +++ b/selfdrive/car/volkswagen/interface.py @@ -23,7 +23,7 @@ class CarInterface(CarInterfaceBase): self.eps_timer_soft_disable_alert = False @staticmethod - def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs): + def _get_params(ret, candidate, fingerprint, car_fw, car_data, experimental_long, docs): ret.carName = "volkswagen" ret.radarUnavailable = True