From 84aead6149b885b44ad661b92cd8fa2ac6431a41 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquenot Date: Sat, 7 Dec 2019 22:35:06 +0100 Subject: [PATCH] Replaced sqrt(x**2+y**2) with hypot in ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py --- .../two_joint_arm_to_point_control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py b/ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py index e674ae8a..0e91be0f 100644 --- a/ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py +++ b/ArmNavigation/two_joint_arm_to_point_control/two_joint_arm_to_point_control.py @@ -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