mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-01-13 08:18:03 -05:00
Add node valid check to fix #271
This commit is contained in:
@@ -140,7 +140,7 @@ class RRT:
|
||||
plt.clf()
|
||||
# for stopping simulation with the esc key.
|
||||
plt.gcf().canvas.mpl_connect('key_release_event',
|
||||
lambda event: [exit(0) if event.key == 'escape' else None])
|
||||
lambda event: [exit(0) if event.key == 'escape' else None])
|
||||
if rnd is not None:
|
||||
plt.plot(rnd.x, rnd.y, "^k")
|
||||
for node in self.node_list:
|
||||
@@ -175,6 +175,10 @@ class RRT:
|
||||
|
||||
@staticmethod
|
||||
def check_collision(node, obstacleList):
|
||||
|
||||
if node is None:
|
||||
return False
|
||||
|
||||
for (ox, oy, size) in obstacleList:
|
||||
dx_list = [ox - x for x in node.path_x]
|
||||
dy_list = [oy - y for y in node.path_y]
|
||||
|
||||
Reference in New Issue
Block a user