fixed rrt_with_pathsmoothing.py

This commit is contained in:
Atsushi Sakai
2019-10-02 20:28:59 +09:00
parent 3cef87ea3f
commit a5c7096c7b

View File

@@ -76,8 +76,6 @@ def line_collision_check(first, second, obstacleList):
if d <= size:
return False
# print("OK")
return True # OK
@@ -127,7 +125,7 @@ def main():
(7, 5, 2),
(9, 5, 2)
] # [x,y,size]
rrt = RRT(start=[0, 0], goal=[5, 10],
rrt = RRT(start=[0, 0], goal=[6, 10],
rand_area=[-2, 15], obstacle_list=obstacleList)
path = rrt.planning(animation=show_animation)
@@ -141,7 +139,7 @@ def main():
plt.plot([x for (x, y) in path], [y for (x, y) in path], '-r')
plt.plot([x for (x, y) in smoothedPath], [
y for (x, y) in smoothedPath], '-b')
y for (x, y) in smoothedPath], '-c')
plt.grid(True)
plt.pause(0.01) # Need for Mac