def load_map(fname=None, rc=0): if fname is not None: map_ = cv2.imread(fname) return map_ world = 255 * np.ones((200, 300, 3)) obstacle_map.obstacle_circle(world, rc) obstacle_map.obstacle_ellipse(world, rc) obstacle_map.obstacle_rhombus(world, rc) obstacle_map.obstacle_rectangle(world, rc) obstacle_map.obstacle_polygon(world, rc) cv2.imwrite('./map.jpg', world) return world
def load_map(fname=None, rc=0): if fname is not None: map_ = cv2.imread(fname) return map_ # defining 200x300 pixel empty world world = 255 * np.ones((200, 300, 3)) # creating the obstacles obstacle_map.obstacle_circle(world, rc) obstacle_map.obstacle_ellipse(world, rc) obstacle_map.obstacle_rhombus(world, rc) obstacle_map.obstacle_rectangle(world, rc) obstacle_map.obstacle_polygon(world, rc) # save the image of the world cv2.imwrite('./outputs/map.jpg', world) return world