RRT/src/world.py
def check_collision_holonomic(self, start, end, num_samples = 0):
        '''
        checks collision with obstacles for a straight line path from <start> to <end>

        checks if the line start->end and any of the four obstacle lines intersect

        start: (start_x, start_y)
        end:   (end_x, end_y)
        
        returns: True if collision, False otherwise 
        '''

        for obstacle in self.obstacles:
            obstacle_lines = [
                [(obstacle[0], obstacle[1]), (obstacle[0]+obstacle[2], obstacle[1])],
                [(obstacle[0], obstacle[1]), (obstacle[0], obstacle[1]+obstacle[3])],
                [(obstacle[0]+obstacle[2], obstacle[1]), (obstacle[0]+obstacle[2], obstacle[1]+obstacle[3])],
                [(obstacle[0], obstacle[1]+obstacle[3]), (obstacle[0]+obstacle[2], obstacle[1]+obstacle[3])]
            ]
            for line in obstacle_lines:
                collide = intersect(start, end, line[0], line[1])
                
                if collide:
                    return True

        return False

        checks collision with obstacles for a straight line path from <start> to <end>

        checks if the line start->end and any of the four obstacle lines intersect

        start: (start_x, start_y)
        end:   (end_x, end_y)
        
        returns: True if collision, False otherwise 
        
checks collision with obstacles for a straight line path from  to 
checks if the line start->end and any of the four obstacle lines intersect



True if collision, False otherwise
checks collision with obstacles for a straight line path from to checks if the line start - > end and any of the four obstacle lines intersect True if collision False otherwise
def check_collision_holonomic(self, start, end, num_samples = 0):
        for obstacle in self.obstacles:
            obstacle_lines = [
                [(obstacle[0], obstacle[1]), (obstacle[0]+obstacle[2], obstacle[1])],
                [(obstacle[0], obstacle[1]), (obstacle[0], obstacle[1]+obstacle[3])],
                [(obstacle[0]+obstacle[2], obstacle[1]), (obstacle[0]+obstacle[2], obstacle[1]+obstacle[3])],
                [(obstacle[0], obstacle[1]+obstacle[3]), (obstacle[0]+obstacle[2], obstacle[1]+obstacle[3])]
            ]
            for line in obstacle_lines:
                collide = intersect(start, end, line[0], line[1])
                if collide:
                    return True
        return False
def check_collision_holonomic ( self , start , end , num_samples = 0 ) : for obstacle in self . obstacles : obstacle_lines = [ [ ( obstacle [ 0 ] , obstacle [ 1 ] ) , ( obstacle [ 0 ] + obstacle [ 2 ] , obstacle [ 1 ] ) ] , [ ( obstacle [ 0 ] , obstacle [ 1 ] ) , ( obstacle [ 0 ] , obstacle [ 1 ] + obstacle [ 3 ] ) ] , [ ( obstacle [ 0 ] + obstacle [ 2 ] , obstacle [ 1 ] ) , ( obstacle [ 0 ] + obstacle [ 2 ] , obstacle [ 1 ] + obstacle [ 3 ] ) ] , [ ( obstacle [ 0 ] , obstacle [ 1 ] + obstacle [ 3 ] ) , ( obstacle [ 0 ] + obstacle [ 2 ] , obstacle [ 1 ] + obstacle [ 3 ] ) ] ] for line in obstacle_lines : collide = intersect ( start , end , line [ 0 ] , line [ 1 ] ) if collide : return True return False
checks collision with obstacles for a straight line path from <start> to <end>
checks if the line start->end and any of the four obstacle lines intersect
checks collision with obstacles for a straight line path from <start > to <end > checks if the line start - > end and any of the four obstacle lines intersect
'''
        checks collision with obstacles for a straight line path from <start> to <end>

        checks if the line start->end and any of the four obstacle lines intersect

        start: (start_x, start_y)
        end:   (end_x, end_y)
        
        returns: True if collision, False otherwise 
        '''
self
start
end
num_samples