From a693b3a26b2dcbd7910e4fa98318f23c13c3d815 Mon Sep 17 00:00:00 2001 From: ClockeNessMnstr Date: Fri, 13 May 2022 19:52:20 -0400 Subject: [PATCH] LatControlTorque: clean up class variable (#24526) * move to super * no class variable * there's CP * whitespace * drop CI from latcontrol super * Revert "drop CI from latcontrol super" This reverts commit 9218273060ade6431c4fc4c310b27e7e210158b9. Co-authored-by: Shane Smiskol --- selfdrive/controls/lib/latcontrol_torque.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/lib/latcontrol_torque.py b/selfdrive/controls/lib/latcontrol_torque.py index a373384254..9a1ac2f9ea 100644 --- a/selfdrive/controls/lib/latcontrol_torque.py +++ b/selfdrive/controls/lib/latcontrol_torque.py @@ -25,12 +25,12 @@ JERK_THRESHOLD = 0.2 class LatControlTorque(LatControl): def __init__(self, CP, CI): super().__init__(CP, CI) - self.CP = CP self.pid = PIDController(CP.lateralTuning.torque.kp, CP.lateralTuning.torque.ki, k_f=CP.lateralTuning.torque.kf, pos_limit=self.steer_max, neg_limit=-self.steer_max) self.get_steer_feedforward = CI.get_steer_feedforward_function() self.use_steering_angle = CP.lateralTuning.torque.useSteeringAngle self.friction = CP.lateralTuning.torque.friction + self.kf = CP.lateralTuning.torque.kf def reset(self): super().reset() @@ -61,7 +61,7 @@ class LatControlTorque(LatControl): ff = desired_lateral_accel - params.roll * ACCELERATION_DUE_TO_GRAVITY # convert friction into lateral accel units for feedforward friction_compensation = interp(desired_lateral_jerk, [-JERK_THRESHOLD, JERK_THRESHOLD], [-self.friction, self.friction]) - ff += friction_compensation / self.CP.lateralTuning.torque.kf + ff += friction_compensation / self.kf output_torque = self.pid.update(error, override=CS.steeringPressed, feedforward=ff, speed=CS.vEgo,