From fad7e2910fd03619f6f3a38bb7a68d5861dc5b2f Mon Sep 17 00:00:00 2001 From: infiniteCable <75014343+infiniteCable@users.noreply.github.com> Date: Sun, 20 Apr 2025 11:21:39 +0200 Subject: [PATCH] Update controlsd.py --- selfdrive/controls/controlsd.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 54d828c9c..af2700292 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -99,9 +99,10 @@ class Controls: steer_angle_without_offset = math.radians(CS.steeringAngleDeg - lp.angleOffsetDeg) self.curvature = -self.VM.calc_curvature(steer_angle_without_offset, CS.vEgo, lp.roll) - 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, - lp.roll) + 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, + lp.roll) self.roll = lp.roll # Update Torque Params