From 8c77ceb2b8a8cc642d20f719c4fd6ebdda528c48 Mon Sep 17 00:00:00 2001 From: infiniteCable2 Date: Sun, 6 Apr 2025 17:14:58 +0200 Subject: [PATCH] Update controlsd.py --- selfdrive/controls/controlsd.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 84b0f64b9..6063b8cab 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -88,8 +88,11 @@ class Controls: steer_angle_without_offset = math.radians(CS.steeringAngleDeg - lp.angleOffsetDeg) self.curvature = -self.VM.calc_curvature(steer_angle_without_offset, CS.vEgo, 0) - self.curvature_3dof = -self.VM.calc_curvature_3dof(self.calibrated_pose.acceleration.y, self.calibrated_pose.acceleration.x, self.calibrated_pose.angular_velocity.yaw, - CS.vEgo, steer_angle_without_offset, 0) + if self.calibrated_pose is not None: + self.curvature_3dof = -self.VM.calc_curvature_3dof(self.calibrated_pose.acceleration.y, self.calibrated_pose.acceleration.x, self.calibrated_pose.angular_velocity.yaw, + CS.vEgo, steer_angle_without_offset, 0) + else: + self.curvature_3dof = self.curvature # Update Torque Params if self.CP.lateralTuning.which() == 'torque':