mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-13 04:28:04 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user