Replaced sqrt(x**2+y**2) with hypot in ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py

This commit is contained in:
Guillaume Jacquenot
2019-12-07 22:35:06 +01:00
parent e289d1f9a9
commit 84aead6149

View File

@@ -55,7 +55,7 @@ def two_joint_arm(GOAL_TH=0.0, theta1=0.0, theta2=0.0):
wrist = plot_arm(theta1, theta2, x, y)
# check goal
d2goal = np.math.sqrt((wrist[0] - x)**2 + (wrist[1] - y)**2)
d2goal = np.hypot(wrist[0] - x, wrist[1] - y)
if abs(d2goal) < GOAL_TH and x is not None:
return theta1, theta2