Once find the path, stop RRT*

This commit is contained in:
Bao Sheng
2019-06-18 15:40:25 +08:00
parent f6ef266dc8
commit 54b6052e9a

View File

@@ -63,12 +63,14 @@ class RRT():
if animation and i % 5 == 0:
self.DrawGraph(rnd)
# generate coruse
lastIndex = self.get_best_last_index()
if lastIndex is None:
return None
path = self.gen_final_course(lastIndex)
return path
# generate coruse
lastIndex = self.get_best_last_index()
if lastIndex is None:
continue
path = self.gen_final_course(lastIndex)
return path
return None
def choose_parent(self, newNode, nearinds):
if not nearinds: