Skip to content

Commit 18b7365

Browse files
committed
remove heuristic method
1 parent 6d4ea8b commit 18b7365

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

PathPlanning/DepthFirstSearch/depth_first_search.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
show_animation = True
1818

1919

20-
class DFSPlanner:
20+
class DepthFirstSearchPlanner:
2121

2222
def __init__(self, ox, oy, reso, rr):
2323
"""
@@ -135,12 +135,6 @@ def calc_final_path(self, ngoal, closedset):
135135

136136
return rx, ry
137137

138-
@staticmethod
139-
def calc_heuristic(n1, n2):
140-
w = 1.0 # weight of heuristic
141-
d = w * math.hypot(n1.x - n2.x, n1.y - n2.y)
142-
return d
143-
144138
def calc_grid_position(self, index, minp):
145139
"""
146140
calc grid position
@@ -260,8 +254,8 @@ def main():
260254
plt.grid(True)
261255
plt.axis("equal")
262256

263-
DFS = DFSPlanner(ox, oy, grid_size, robot_radius)
264-
rx, ry = DFS.planning(sx, sy, gx, gy)
257+
dfs = DepthFirstSearchPlanner(ox, oy, grid_size, robot_radius)
258+
rx, ry = dfs.planning(sx, sy, gx, gy)
265259

266260
if show_animation: # pragma: no cover
267261
plt.plot(rx, ry, "-r")

0 commit comments

Comments
 (0)