From 0c89b2b4c63b809fd237397bd50e5e230db73c2d Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 9 Aug 2024 18:32:03 -0700 Subject: [PATCH] latcontrollers take capnp --- selfdrive/controls/lib/latcontrol_pid.py | 4 ++-- selfdrive/controls/lib/latcontrol_torque.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/lib/latcontrol_pid.py b/selfdrive/controls/lib/latcontrol_pid.py index 5657d1765f..1c16bb651e 100644 --- a/selfdrive/controls/lib/latcontrol_pid.py +++ b/selfdrive/controls/lib/latcontrol_pid.py @@ -8,8 +8,8 @@ from openpilot.selfdrive.controls.lib.pid import PIDController class LatControlPID(LatControl): def __init__(self, CP, CI): super().__init__(CP, CI) - self.pid = PIDController((CP.lateralTuning.kpBP, CP.lateralTuning.kpV), - (CP.lateralTuning.kiBP, CP.lateralTuning.kiV), + self.pid = PIDController((CP.lateralTuning.pid.kpBP, CP.lateralTuning.pid.kpV), + (CP.lateralTuning.pid.kiBP, CP.lateralTuning.pid.kiV), k_f=CP.lateralTuning.kf, pos_limit=self.steer_max, neg_limit=-self.steer_max) self.get_steer_feedforward = CI.get_steer_feedforward_function() diff --git a/selfdrive/controls/lib/latcontrol_torque.py b/selfdrive/controls/lib/latcontrol_torque.py index 66b2e7aabc..decff2ec05 100644 --- a/selfdrive/controls/lib/latcontrol_torque.py +++ b/selfdrive/controls/lib/latcontrol_torque.py @@ -25,7 +25,7 @@ LOW_SPEED_Y = [15, 13, 10, 5] class LatControlTorque(LatControl): def __init__(self, CP, CI): super().__init__(CP, CI) - self.torque_params = CP.lateralTuning + self.torque_params = CP.lateralTuning.torque.as_builder() self.pid = PIDController(self.torque_params.kp, self.torque_params.ki, k_f=self.torque_params.kf, pos_limit=self.steer_max, neg_limit=-self.steer_max) self.torque_from_lateral_accel = CI.torque_from_lateral_accel()