remove heuristic method

This commit is contained in:
Erwin Lejeune
2020-04-13 14:25:35 +02:00
parent 6d4ea8bd1d
commit 18b73652f6

View File

@@ -17,7 +17,7 @@ import random
show_animation = True
class DFSPlanner:
class DepthFirstSearchPlanner:
def __init__(self, ox, oy, reso, rr):
"""
@@ -135,12 +135,6 @@ class DFSPlanner:
return rx, ry
@staticmethod
def calc_heuristic(n1, n2):
w = 1.0 # weight of heuristic
d = w * math.hypot(n1.x - n2.x, n1.y - n2.y)
return d
def calc_grid_position(self, index, minp):
"""
calc grid position
@@ -260,8 +254,8 @@ def main():
plt.grid(True)
plt.axis("equal")
DFS = DFSPlanner(ox, oy, grid_size, robot_radius)
rx, ry = DFS.planning(sx, sy, gx, gy)
dfs = DepthFirstSearchPlanner(ox, oy, grid_size, robot_radius)
rx, ry = dfs.planning(sx, sy, gx, gy)
if show_animation: # pragma: no cover
plt.plot(rx, ry, "-r")