From e6442489ed648cae7d9ab4d100b81aeae8ea17f4 Mon Sep 17 00:00:00 2001 From: jc01rho Date: Sat, 12 Aug 2023 11:41:56 +0900 Subject: [PATCH] fixed missing imports --- selfdrive/car/gm/carcontroller.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/selfdrive/car/gm/carcontroller.py b/selfdrive/car/gm/carcontroller.py index 26f7be3ffe2972..7adb1c4e7fad49 100644 --- a/selfdrive/car/gm/carcontroller.py +++ b/selfdrive/car/gm/carcontroller.py @@ -1,5 +1,6 @@ import math - +import cereal.messaging as messaging +import numpy as np from cereal import car from common.conversions import Conversions as CV from common.numpy_fast import interp, clip @@ -9,7 +10,7 @@ from selfdrive.car.gm import gmcan from selfdrive.car.gm.values import DBC, CanBus, CarControllerParams, CruiseButtons, CC_ONLY_CAR from collections import deque -import cereal.messaging as messaging + VisualAlert = car.CarControl.HUDControl.VisualAlert NetworkLocation = car.CarParams.NetworkLocation @@ -90,12 +91,12 @@ def update(self, CC, CS, now_nanos): self.sm.update(0) - if sm.updated['liveCalibration']: + if self.sm.updated['liveCalibration']: # self.current_pitch_debug = self.sm['liveCalibration'].liveCalibration.liveMpcDebug.currentPitch if self.default_pitch == -100.0: - self.default_pitch = np.asarray(sm['liveCalibration'].rpyCalib)[1] + self.default_pitch = np.asarray(self.sm['liveCalibration'].rpyCalib)[1] else : - self.current_pitch = np.asarray(sm['liveCalibration'].rpyCalib)[1] + self.current_pitch = np.asarray(self.sm['liveCalibration'].rpyCalib)[1] actuators = CC.actuators hud_control = CC.hudControl