This repository implements a Gym environment for simulating simple 2D navigation scenarios.
Activate a virtual environment or a conda environment. Then, run the following command:
pip install nav2d
The building blocks in this toolbox are Point
, Vector
, and Polygon
defined in nav2d.assets.elements
.
- Point:
p = Point(x, y)
,p.pos
is anp.array
. You can add aVector
to aPoint
to make it a newPoint
. - Vector: inherits from
Point
. You can apply various algebraic operations toVector
. Many operators are overloaded there, e.g.,sum(List[Vector])
gives you a singeVector
.Vector
helps you manipulate multiple movements. - Polygon:
zone = Polygon(List[Point])
. Given a zone and a point,zone.point_relative_pos(p)
tells you their relative positionIN | ON | OUT
. APolygon
is defined by its vertices (Point
s).