Skip to content

Commit ed9b84d

Browse files
committed
Replaced sqrt(x**2+y**2) with hypot in PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py
1 parent d433748 commit ed9b84d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

PathPlanning/BatchInformedRRTStar/batch_informed_rrtstar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ def setup_planning(self):
180180
cBest = self.g_scores[self.goalId]
181181

182182
# Computing the sampling space
183-
cMin = math.sqrt(pow(self.start[0] - self.goal[0], 2)
184-
+ pow(self.start[1] - self.goal[1], 2)) / 1.5
183+
cMin = math.hypot(self.start[0] - self.goal[0],
184+
self.start[1] - self.goal[1]) / 1.5
185185
xCenter = np.array([[(self.start[0] + self.goal[0]) / 2.0],
186186
[(self.start[1] + self.goal[1]) / 2.0], [0]])
187187
a1 = np.array([[(self.goal[0] - self.start[0]) / cMin],

0 commit comments

Comments
 (0)