From 83cb0890f66b16e4e4fa8010f31ef419c132d4db Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 9 Aug 2024 23:24:01 -0700 Subject: [PATCH] more --- selfdrive/car/body/carstate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/body/carstate.py b/selfdrive/car/body/carstate.py index e64cff4ca5..6b6414ca9c 100644 --- a/selfdrive/car/body/carstate.py +++ b/selfdrive/car/body/carstate.py @@ -1,4 +1,5 @@ from opendbc.can.parser import CANParser +from openpilot.selfdrive.car import structs from openpilot.selfdrive.car.interfaces import CarStateBase from openpilot.selfdrive.car.body.values import DBC @@ -6,7 +7,7 @@ STARTUP_TICKS = 100 class CarState(CarStateBase): def update(self, cp): - ret = CarState.new_message() + ret = structs.CarState() ret.wheelSpeeds.fl = cp.vl['MOTORS_DATA']['SPEED_L'] ret.wheelSpeeds.fr = cp.vl['MOTORS_DATA']['SPEED_R'] @@ -23,7 +24,7 @@ class CarState(CarStateBase): ret.fuelGauge = cp.vl["BODY_DATA"]["BATT_PERCENTAGE"] / 100 # irrelevant for non-car - ret.gearShifter = CarState.GearShifter.drive + ret.gearShifter = structs.CarState.GearShifter.drive ret.cruiseState.enabled = True ret.cruiseState.available = True