@@ -40,7 +40,7 @@ def __init__(self, start, goal, map_dimensions, epsilon):
40
40
self .FUCSIA = (255 , 0 , 255 )
41
41
42
42
def is_free (self , point , obstacles ):
43
- """Checks whether a node is colliding with an obstacle or not .
43
+ """Checks if a node is colliding with an obstacle.
44
44
45
45
When dealing with obstacles it is necessary to check
46
46
for the collision with them from the generated node.
@@ -62,7 +62,7 @@ def is_free(self, point, obstacles):
62
62
63
63
return True
64
64
65
- def generate_random_node (self , obstacles ):
65
+ def generate_random_node (self ):
66
66
"""Generates a random node on the screen.
67
67
68
68
The x and y coordinate is generated given an uniform
@@ -79,7 +79,6 @@ def generate_random_node(self, obstacles):
79
79
Coordinates of the random node.
80
80
"""
81
81
self .x_rand = random .uniform (0 , self .WIDTH ), random .uniform (0 , self .HEIGHT )
82
- # collision_free = self.is_free(point=self.x_rand, obstacles=obstacles)
83
82
84
83
return self .x_rand
85
84
@@ -278,8 +277,7 @@ def draw_path_to_goal(self, map_):
278
277
279
278
def move_robot (self , position , map_ ):
280
279
"""Draws the robot moving."""
281
- pygame .draw .circle (surface = map_ , color = (0 , 0 , 255 ),
282
- center = position , radius = 4 )
280
+ pygame .draw .circle (surface = map_ , color = (0 , 0 , 255 ), center = position , radius = 4 )
283
281
284
282
def draw_tree (self , nears , news , map_ ):
285
283
"""Draws the tree constantly. Used to display it in an infinite loop."""
@@ -303,5 +301,5 @@ def draw_trajectory(self, nears, news, environment_):
303
301
304
302
# Refresh the screen
305
303
pygame .display .update ()
306
- pygame .time .delay (50 ) # Wait 0.1 seconds
304
+ pygame .time .delay (20 ) # Wait 0.1 seconds
307
305
environment_ .map .fill (self .WHITE )
0 commit comments