This commit is contained in:
AtsushiSakai
2017-05-21 13:11:33 -07:00
parent 0441140833
commit e5ff87ab59
4 changed files with 16 additions and 12 deletions

View File

@@ -13,8 +13,6 @@ u"""
import random
import math
import copy
import matplotrecorder
matplotrecorder.donothing = True
class RRT():
@@ -149,7 +147,11 @@ class Node():
if __name__ == '__main__':
print("start RRT path planning")
import matplotlib.pyplot as plt
import matplotrecorder
matplotrecorder.donothing = True
# ====Search Path with RRT====
obstacleList = [
(5, 5, 1),

View File

@@ -14,7 +14,6 @@ import math
import copy
import numpy as np
import dubins_path_planning
# import matplotrecorder
class RRT():
@@ -188,7 +187,7 @@ class RRT():
plt.axis([-2, 15, -2, 15])
plt.grid(True)
plt.pause(0.01)
# matplotrecorder.save_frame() # save each frame
matplotrecorder.save_frame() # save each frame
def GetNearestListIndex(self, nodeList, rnd):
dlist = [(node.x - rnd[0]) ** 2 +
@@ -228,8 +227,10 @@ class Node():
if __name__ == '__main__':
print("Start rrt start planning")
print("Start rrt planning")
import matplotlib.pyplot as plt
import matplotrecorder
matplotrecorder.donothing = True
# ====Search Path with RRT====
obstacleList = [
(5, 5, 1),
@@ -254,7 +255,7 @@ if __name__ == '__main__':
plt.pause(0.001)
plt.show()
# for i in range(10):
# matplotrecorder.save_frame() # save each frame
for i in range(10):
matplotrecorder.save_frame() # save each frame
# matplotrecorder.save_movie("animation.gif", 0.1)
matplotrecorder.save_movie("animation.gif", 0.1)

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 MiB

View File

@@ -13,8 +13,6 @@ import random
import math
import copy
import numpy as np
import matplotrecorder
matplotrecorder.donothing = False
class RRT():
@@ -238,8 +236,11 @@ class Node():
if __name__ == '__main__':
print("Start rrt start planning")
print("Start rrt planning")
import matplotlib.pyplot as plt
import matplotrecorder
matplotrecorder.donothing = True
# ====Search Path with RRT====
obstacleList = [
(5, 5, 1),
@@ -253,7 +254,7 @@ if __name__ == '__main__':
# Set Initial parameters
rrt = RRT(start=[0, 0], goal=[5, 10],
randArea=[-2, 15], obstacleList=obstacleList)
path = rrt.Planning(animation=True)
path = rrt.Planning(animation=False)
# Draw final path
rrt.DrawGraph()