Skip to content

Commit d979bb2

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ArmNavigation/n_joint_arm_to_point_control/n_joint_arm_to_point_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def jacobian_inverse(link_lengths, joint_angles):
148148
def distance_to_goal(current_pos, goal_pos):
149149
x_diff = goal_pos[0] - current_pos[0]
150150
y_diff = goal_pos[1] - current_pos[1]
151-
return np.array([x_diff, y_diff]).T, np.math.sqrt(x_diff**2 + y_diff**2)
151+
return np.array([x_diff, y_diff]).T, np.hypot(x_diff, y_diff)
152152

153153

154154
def ang_diff(theta1, theta2):

0 commit comments

Comments
 (0)