zhm-real пре 5 година
родитељ
комит
1ec999814c

BIN
Sampling-based Planning/rrt_2D/__pycache__/env.cpython-37.pyc


BIN
Sampling-based Planning/rrt_2D/__pycache__/plotting.cpython-37.pyc


BIN
Sampling-based Planning/rrt_2D/__pycache__/rrt.cpython-37.pyc


BIN
Sampling-based Planning/rrt_2D/__pycache__/utils.cpython-37.pyc


+ 1 - 1
Sampling-based Planning/rrt_2D/rrt.py

@@ -102,7 +102,7 @@ def main():
     x_start = (2, 2)  # Starting node
     x_start = (2, 2)  # Starting node
     x_goal = (49, 28)  # Goal node
     x_goal = (49, 28)  # Goal node
 
 
-    rrt = Rrt(x_start, x_goal, 0.6, 0.05, 3000)
+    rrt = Rrt(x_start, x_goal, 5, 0.05, 3000)
     path = rrt.planning()
     path = rrt.planning()
 
 
     if path:
     if path:

+ 1 - 17
Sampling-based Planning/rrt_2D/rrt_star.py

@@ -61,21 +61,6 @@ class RrtStar:
         index = self.search_goal_parent()
         index = self.search_goal_parent()
         return self.extract_path(self.vertex[index])
         return self.extract_path(self.vertex[index])
 
 
-    def check_collision(self, node_end):
-        for (ox, oy, r) in self.obs_circle:
-            if math.hypot(node_end.x - ox, node_end.y - oy) <= r:
-                return True
-
-        for (ox, oy, w, h) in self.obs_rectangle:
-            if 0 <= (node_end.x - ox) <= w and 0 <= (node_end.y - oy) <= h:
-                return True
-
-        for (ox, oy, w, h) in self.obs_boundary:
-            if 0 <= (node_end.x - ox) <= w and 0 <= (node_end.y - oy) <= h:
-                return True
-
-        return False
-
     def random_state(self, goal_sample_rate):
     def random_state(self, goal_sample_rate):
         delta = self.utils.delta
         delta = self.utils.delta
 
 
@@ -102,7 +87,6 @@ class RrtStar:
     def find_near_neighbor(self, node_new):
     def find_near_neighbor(self, node_new):
         n = len(self.vertex) + 1
         n = len(self.vertex) + 1
         r = min(self.search_radius * math.sqrt((math.log(n) / n)), self.step_len)
         r = min(self.search_radius * math.sqrt((math.log(n) / n)), self.step_len)
-
         dist_table = [math.hypot(nd.x - node_new.x, nd.y - node_new.y) for nd in self.vertex]
         dist_table = [math.hypot(nd.x - node_new.x, nd.y - node_new.y) for nd in self.vertex]
 
 
         return [dist_table.index(d) for d in dist_table if d <= r]
         return [dist_table.index(d) for d in dist_table if d <= r]
@@ -170,7 +154,7 @@ def main():
     x_start = (2, 2)  # Starting node
     x_start = (2, 2)  # Starting node
     x_goal = (49, 28)  # Goal node
     x_goal = (49, 28)  # Goal node
 
 
-    rrt_star = RrtStar(x_start, x_goal, 1.2, 0.15, 10, 20000)
+    rrt_star = RrtStar(x_start, x_goal, 5, 0.2, 20, 20000)
     path = rrt_star.planning()
     path = rrt_star.planning()
 
 
     if path:
     if path: