From 57f94db935c90939d77c4a2f7b59454045dbef96 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 1 Apr 2020 16:36:10 -0700 Subject: [PATCH] Fix dashcam missing CarState old-commit-hash: 0112a8d3fda01d2e12b00b340014e974851773d6 --- selfdrive/car/car_helpers.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index e99d61e4c1..5ffe043734 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -27,12 +27,17 @@ def load_interfaces(brand_names): for brand_name in brand_names: path = ('selfdrive.car.%s' % brand_name) CarInterface = __import__(path + '.interface', fromlist=['CarInterface']).CarInterface + + if os.path.exists(BASEDIR + '/' + path.replace('.', '/') + '/carstate.py'): + CarState = __import__(path + '.carstate', fromlist=['CarState']).CarState + else: + CarState = None + if os.path.exists(BASEDIR + '/' + path.replace('.', '/') + '/carcontroller.py'): CarController = __import__(path + '.carcontroller', fromlist=['CarController']).CarController - CarState = __import__(path + '.carstate', fromlist=['CarState']).CarState else: CarController = None - CarState = None + for model_name in brand_names[brand_name]: ret[model_name] = (CarInterface, CarController, CarState) return ret