Class TriangularDecomposition

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class TriangularDecomposition : public ompl::control::Decomposition

A TriangularDecomposition is a triangulation that ignores obstacles.

Public Functions

TriangularDecomposition(const base::RealVectorBounds &bounds, std::vector<Polygon> holes = std::vector<Polygon>(), std::vector<Polygon> intRegs = std::vector<Polygon>())

Creates a TriangularDecomposition over the given bounds, which must be 2-dimensional. The underlying mesh will be a conforming Delaunay triangulation. The triangulation will ignore any obstacles, given as a list of polygons. The triangulation will respect the boundaries of any regions of interest, given as a list of polygons. No two obstacles may overlap, and no two regions of interest may overlap.

~TriangularDecomposition() override
inline virtual int getNumRegions() const override

Returns the number of regions in this Decomposition.

virtual double getRegionVolume(int triID) override

Returns the volume of a given region in this Decomposition.

virtual void getNeighbors(int triID, std::vector<int> &neighbors) const override

Stores a given region’s neighbors into a given vector.

virtual int locateRegion(const base::State *s) const override

Returns the index of the region containing a given State. Most often, this is obtained by first calling project(). Returns -1 if no region contains the State.

virtual void sampleFromRegion(int triID, RNG &rng, std::vector<double> &coord) const override

Samples a projected coordinate from a given region.

void setup()
void addHole(const Polygon &hole)
void addRegionOfInterest(const Polygon &region)
int getNumHoles() const
int getNumRegionsOfInterest() const
const std::vector<Polygon> &getHoles() const
const std::vector<Polygon> &getAreasOfInterest() const
int getRegionOfInterestAt(int triID) const

Returns the region of interest that contains the given triangle ID. Returns -1 if the triangle ID is not within a region of interest.

void print(std::ostream &out) const

Protected Functions

virtual int createTriangles()

Helper method to triangulate the space and return the number of triangles.

Protected Attributes

std::vector<Triangle> triangles_
std::vector<Polygon> holes_
std::vector<Polygon> intRegs_
std::vector<int> intRegInfo_

Maps from triangle ID to index of Polygon in intReg_ that contains the triangle ID. Maps to -1 if the triangle ID is not in a region of interest.

double triAreaPct_
struct Polygon

Subclassed by ompl::control::TriangularDecomposition::Triangle

Public Functions

inline Polygon(int nv)
virtual ~Polygon() = default

Public Members

std::vector<Vertex> pts
struct Triangle : public ompl::control::TriangularDecomposition::Polygon

Public Functions

inline Triangle()
~Triangle() override = default

Public Members

std::vector<int> neighbors
double volume
struct Vertex

Public Functions

Vertex() = default
Vertex(double vx, double vy)
bool operator==(const Vertex &v) const

Public Members

double x
double y