|
@@ -11,8 +11,8 @@ import sys
|
|
|
|
|
|
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../Search-based Planning/")
|
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../Search-based Planning/")
|
|
|
from Astar_3D.env3D import env
|
|
from Astar_3D.env3D import env
|
|
|
-from Astar_3D.utils3D import getAABB, getDist, getRay, StateSpace, Heuristic
|
|
|
|
|
-from queue import QueuePrior
|
|
|
|
|
|
|
+from Astar_3D.utils3D import getAABB, getDist, getRay, StateSpace, Heuristic, getNearest
|
|
|
|
|
+import queue
|
|
|
|
|
|
|
|
|
|
|
|
|
class Weighted_A_star(object):
|
|
class Weighted_A_star(object):
|
|
@@ -22,10 +22,10 @@ class Weighted_A_star(object):
|
|
|
[1,-1,0],[-1,1,0],[1,0,-1],[-1,0, 1],[0,1, -1],[0, -1,1],\
|
|
[1,-1,0],[-1,1,0],[1,0,-1],[-1,0, 1],[0,1, -1],[0, -1,1],\
|
|
|
[1,-1,-1],[-1,1,-1],[-1,-1,1],[1,1,-1],[1,-1,1],[-1,1,1]])
|
|
[1,-1,-1],[-1,1,-1],[-1,-1,1],[1,1,-1],[1,-1,1],[-1,1,1]])
|
|
|
self.env = env()
|
|
self.env = env()
|
|
|
- self.Space = StateSpace(env.boundary) # key is the point, store g value
|
|
|
|
|
- self.OPEN = QueuePrior() # store [point,priority]
|
|
|
|
|
- self.start = getNearest(self.Space,env.start)
|
|
|
|
|
- self.goal = getNearest(self.Space,env.goal)
|
|
|
|
|
|
|
+ self.Space = StateSpace(self.env.boundary) # key is the point, store g value
|
|
|
|
|
+ self.OPEN = queue.QueuePrior() # store [point,priority]
|
|
|
|
|
+ self.start = getNearest(self.Space,self.env.start)
|
|
|
|
|
+ self.goal = getNearest(self.Space,self.env.goal)
|
|
|
self.h = Heuristic(self.Space,self.goal)
|
|
self.h = Heuristic(self.Space,self.goal)
|
|
|
self.Parent = {}
|
|
self.Parent = {}
|
|
|
self.CLOSED = {}
|
|
self.CLOSED = {}
|