File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ def draw_graph(self, rnd=None):
140
140
plt .clf ()
141
141
# for stopping simulation with the esc key.
142
142
plt .gcf ().canvas .mpl_connect ('key_release_event' ,
143
- lambda event : [exit (0 ) if event .key == 'escape' else None ])
143
+ lambda event : [exit (0 ) if event .key == 'escape' else None ])
144
144
if rnd is not None :
145
145
plt .plot (rnd .x , rnd .y , "^k" )
146
146
for node in self .node_list :
@@ -175,6 +175,10 @@ def get_nearest_node_index(node_list, rnd_node):
175
175
176
176
@staticmethod
177
177
def check_collision (node , obstacleList ):
178
+
179
+ if node is None :
180
+ return False
181
+
178
182
for (ox , oy , size ) in obstacleList :
179
183
dx_list = [ox - x for x in node .path_x ]
180
184
dy_list = [oy - y for y in node .path_y ]
You can’t perform that action at this time.
0 commit comments