From b693229521fbc1a2666ea2366d0230ea0086ef21 Mon Sep 17 00:00:00 2001 From: Walter Morales Date: Thu, 14 Nov 2024 15:45:40 +0000 Subject: [PATCH] Fix bug of PandaRunner (#1483) * Fixed bug with safety_model on PandaRunner class * Fixed bug with PandaRunner --------- Co-authored-by: car --- opendbc/car/panda_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendbc/car/panda_runner.py b/opendbc/car/panda_runner.py index 598ff51e..3ba631d7 100644 --- a/opendbc/car/panda_runner.py +++ b/opendbc/car/panda_runner.py @@ -16,7 +16,7 @@ class PandaRunner(AbstractContextManager): self.CI = get_car(self._can_recv, self.p.can_send_many, self.p.set_obd, True) assert self.CI.CP.carFingerprint.lower() != "mock", "Unable to identify car. Check connections and ensure car is supported." - safety_model = list(CarParams.SafetyModel).index(self.CI.CP.safetyConfigs[0].safetyModel) + safety_model = CarParams.SafetyModel.schema.enumerants[self.CI.CP.safetyConfigs[0].safetyModel] self.p.set_safety_mode(Panda.SAFETY_ELM327, 1) self.CI.init(self.CI.CP, self._can_recv, self.p.can_send_many) self.p.set_safety_mode(safety_model, self.CI.CP.safetyConfigs[0].safetyParam)