Volocopter

Obstacles

Implementation of the polygonal obstacles as well as of the walls

class obstacle.Obstacle(map_dimensions, size, nb_pts)[source]

Class implementing simple 2D polygonal obstacles.

Attributes:
points : list

List of (x, y) coordinates in the frame of the environnement representing the obstacle.

bounding_box : 4-tuple

Coordinates of the lower left and upper right corners of the bounding box containing the obstacle.

center : tuple

Coordinates of the center of the bounding box.

polygon : shapely.geometry.Polygon

The polygon representing the obstacle.

Methods

plot() Draws the polygon on screen.
colides(x, y)[source]

Checks if the given point is in the obstacle or not.

plot()[source]

Draws the polygon on screen.

class obstacle.Wall(width, bottom_y, thickness, moving=False)[source]

Class implementing a wall with a moving hole in it

Attributes:
width : float

The total width of the wall.

bottom_y : float

The position of the bottom of the wall.

hole : float

The position of the hole in the wall.

thickness : float

The thickness of the wall.

speed : float

The speed of the hole, if the obstacles are choosen to be dynamic.

Methods

colides(x, y[, time]) Checks if the given point is in the obstacle or not.
plot([time, x_scale, y_scale]) Draws the wall on screen.
visible(view_top, view_bottom) Checks if the wall is in the field of view
colides(x, y, time=0)[source]

Checks if the given point is in the obstacle or not.

plot(time=0, x_scale=1, y_scale=1)[source]

Draws the wall on screen.

visible(view_top, view_bottom)[source]

Checks if the wall is in the field of view