|
|
@ -6,7 +6,7 @@ from cereal import car, log |
|
|
|
import cereal.messaging as messaging |
|
|
|
import cereal.messaging as messaging |
|
|
|
from openpilot.common.constants import CV |
|
|
|
from openpilot.common.constants import CV |
|
|
|
from openpilot.common.params import Params |
|
|
|
from openpilot.common.params import Params |
|
|
|
from openpilot.common.realtime import config_realtime_process, Priority, Ratekeeper |
|
|
|
from openpilot.common.realtime import config_realtime_process, DT_CTRL, Priority, Ratekeeper |
|
|
|
from openpilot.common.swaglog import cloudlog |
|
|
|
from openpilot.common.swaglog import cloudlog |
|
|
|
|
|
|
|
|
|
|
|
from opendbc.car.car_helpers import interfaces |
|
|
|
from opendbc.car.car_helpers import interfaces |
|
|
@ -51,11 +51,11 @@ class Controls: |
|
|
|
self.VM = VehicleModel(self.CP) |
|
|
|
self.VM = VehicleModel(self.CP) |
|
|
|
self.LaC: LatControl |
|
|
|
self.LaC: LatControl |
|
|
|
if self.CP.steerControlType == car.CarParams.SteerControlType.angle: |
|
|
|
if self.CP.steerControlType == car.CarParams.SteerControlType.angle: |
|
|
|
self.LaC = LatControlAngle(self.CP, self.CI) |
|
|
|
self.LaC = LatControlAngle(self.CP, self.CI, DT_CTRL) |
|
|
|
elif self.CP.lateralTuning.which() == 'pid': |
|
|
|
elif self.CP.lateralTuning.which() == 'pid': |
|
|
|
self.LaC = LatControlPID(self.CP, self.CI) |
|
|
|
self.LaC = LatControlPID(self.CP, self.CI, DT_CTRL) |
|
|
|
elif self.CP.lateralTuning.which() == 'torque': |
|
|
|
elif self.CP.lateralTuning.which() == 'torque': |
|
|
|
self.LaC = LatControlTorque(self.CP, self.CI) |
|
|
|
self.LaC = LatControlTorque(self.CP, self.CI, DT_CTRL) |
|
|
|
|
|
|
|
|
|
|
|
def update(self): |
|
|
|
def update(self): |
|
|
|
self.sm.update(15) |
|
|
|
self.sm.update(15) |
|
|
|