zhm-real 5 năm trước cách đây
mục cha
commit
80c6c6858e

+ 0 - 1
Search-based Planning/.idea/workspace.xml

@@ -21,7 +21,6 @@
   <component name="ChangeListManager">
     <list default="true" id="025aff36-a6aa-4945-ab7e-b2c625055f47" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/Search_2D/LPAstar.py" beforeDir="false" afterPath="$PROJECT_DIR$/Search_2D/LPAstar.py" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Search_3D/Astar3D.py" beforeDir="false" afterPath="$PROJECT_DIR$/Search_3D/Astar3D.py" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/Search_3D/LRT_Astar3D.py" beforeDir="false" afterPath="$PROJECT_DIR$/Search_3D/LRT_Astar3D.py" afterDir="false" />
     </list>

+ 4 - 4
Search-based Planning/Search_3D/Astar3D.py

@@ -19,11 +19,11 @@ import queue
 
 
 class Weighted_A_star(object):
-    def __init__(self, resolution=1):
-        self.Alldirec = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 1], \
+    def __init__(self, resolution=0.5):
+        self.Alldirec = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 0], [1, 0, 1], [0, 1, 1], [1, 1, 1],
                                   [-1, 0, 0], [0, -1, 0], [0, 0, -1], [-1, -1, 0], [-1, 0, -1], [0, -1, -1],
-                                  [-1, -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, 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]])
 
         self.env = env(resolution=resolution)

+ 4 - 5
Search-based Planning/Search_3D/LRT_Astar3D.py

@@ -91,13 +91,12 @@ import queue
 #         path = np.flip(path,axis=0)
 #         return path
 
-class LRT_A_star2():
+class LRT_A_star2:
     def __init__(self, resolution=0.5, N=7):
-        self.lookahead = N
-        self.Astar = Astar3D.Weighted_A_star()
+        self.Astar = Astar3D.Weighted_A_star(resolution)
 
         while True:
-            self.Astar.run(self.lookahead)
+            self.Astar.run(N)
 
     def updateHeuristic(self):
         for strxi in self.Astar.CLOSED:
@@ -110,4 +109,4 @@ class LRT_A_star2():
 
 
 if __name__ == '__main__':
-    T = LRT_A_star2(resolution=1, N=50)
+    T = LRT_A_star2(resolution=1, N=50)

BIN
Search-based Planning/Search_3D/__pycache__/Astar3D.cpython-37.pyc