Skip to content

Commit 84aead6

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py
1 parent e289d1f commit 84aead6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def two_joint_arm(GOAL_TH=0.0, theta1=0.0, theta2=0.0):
5555
wrist = plot_arm(theta1, theta2, x, y)
5656

5757
# check goal
58-
d2goal = np.math.sqrt((wrist[0] - x)**2 + (wrist[1] - y)**2)
58+
d2goal = np.hypot(wrist[0] - x, wrist[1] - y)
5959

6060
if abs(d2goal) < GOAL_TH and x is not None:
6161
return theta1, theta2

0 commit comments

Comments
 (0)