|
|
@ -53,6 +53,7 @@ def load_interfaces(brand_names): |
|
|
|
CarController = None |
|
|
|
CarController = None |
|
|
|
|
|
|
|
|
|
|
|
for model_name in brand_names[brand_name]: |
|
|
|
for model_name in brand_names[brand_name]: |
|
|
|
|
|
|
|
# print(model_name) |
|
|
|
ret[model_name] = (CarInterface, CarController, CarState) |
|
|
|
ret[model_name] = (CarInterface, CarController, CarState) |
|
|
|
return ret |
|
|
|
return ret |
|
|
|
|
|
|
|
|
|
|
@ -66,7 +67,10 @@ def _get_interface_names(): |
|
|
|
try: |
|
|
|
try: |
|
|
|
brand_name = car_folder.split('/')[-1] |
|
|
|
brand_name = car_folder.split('/')[-1] |
|
|
|
model_names = __import__(f'selfdrive.car.{brand_name}.values', fromlist=['CAR']).CAR |
|
|
|
model_names = __import__(f'selfdrive.car.{brand_name}.values', fromlist=['CAR']).CAR |
|
|
|
model_names = [getattr(model_names, c) for c in model_names.__dict__.keys() if not c.startswith("__")] |
|
|
|
if brand_name == 'toyota': # TODO: remove exception |
|
|
|
|
|
|
|
model_names = [c.name for c in model_names] |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
model_names = [getattr(model_names, c) for c in model_names.__dict__.keys() if not c.startswith("__")] |
|
|
|
brand_names[brand_name] = model_names |
|
|
|
brand_names[brand_name] = model_names |
|
|
|
except (ImportError, OSError): |
|
|
|
except (ImportError, OSError): |
|
|
|
pass |
|
|
|
pass |
|
|
|