Loading...
Searching...
No Matches
ompl::control::TriangularDecomposition Class Reference

A TriangularDecomposition is a triangulation that ignores obstacles. More...

#include <ompl/extensions/triangle/TriangularDecomposition.h>

Inheritance diagram for ompl::control::TriangularDecomposition:

Classes

struct  Polygon
 
struct  Triangle
 
struct  Vertex
 

Public Member 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.
 
int getNumRegions () const override
 Returns the number of regions in this Decomposition.
 
double getRegionVolume (int triID) override
 Returns the volume of a given region in this Decomposition.
 
void getNeighbors (int triID, std::vector< int > &neighbors) const override
 Stores a given region's neighbors into a given vector.
 
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.
 
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
 
- Public Member Functions inherited from ompl::control::Decomposition
 Decomposition (int dim, const base::RealVectorBounds &b)
 Constructor. Creates a Decomposition with a given dimension and a given set of bounds. Accepts as an optional argument a given number of regions.
 
virtual int getDimension () const
 Returns the dimension of this Decomposition.
 
virtual const base::RealVectorBoundsgetBounds () const
 Returns the bounds of this Decomposition.
 
virtual void project (const base::State *s, std::vector< double > &coord) const =0
 Project a given State to a set of coordinates in R^k, where k is the dimension of this Decomposition.
 
virtual void sampleFullState (const base::StateSamplerPtr &sampler, const std::vector< double > &coord, base::State *s) const =0
 Samples a State using a projected coordinate and a StateSampler.
 

Protected Member Functions

virtual int createTriangles ()
 Helper method to triangulate the space and return the number of triangles.
 

Protected Attributes

std::vector< Triangletriangles_
 
std::vector< Polygonholes_
 
std::vector< PolygonintRegs_
 
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_
 
- Protected Attributes inherited from ompl::control::Decomposition
int dimension_
 
base::RealVectorBounds bounds_
 

Detailed Description

A TriangularDecomposition is a triangulation that ignores obstacles.

Definition at line 55 of file TriangularDecomposition.h.

Constructor & Destructor Documentation

◆ TriangularDecomposition()

ompl::control::TriangularDecomposition::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.

Definition at line 75 of file TriangularDecomposition.cpp.

Member Function Documentation

◆ addHole()

void ompl::control::TriangularDecomposition::addHole ( const Polygon & hole)

Definition at line 97 of file TriangularDecomposition.cpp.

◆ addRegionOfInterest()

void ompl::control::TriangularDecomposition::addRegionOfInterest ( const Polygon & region)

Definition at line 102 of file TriangularDecomposition.cpp.

◆ createTriangles()

int ompl::control::TriangularDecomposition::createTriangles ( )
protectedvirtual

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

Definition at line 212 of file TriangularDecomposition.cpp.

◆ getAreasOfInterest()

const std::vector< ompl::control::TriangularDecomposition::Polygon > & ompl::control::TriangularDecomposition::getAreasOfInterest ( ) const

Definition at line 124 of file TriangularDecomposition.cpp.

◆ getHoles()

const std::vector< ompl::control::TriangularDecomposition::Polygon > & ompl::control::TriangularDecomposition::getHoles ( ) const

Definition at line 118 of file TriangularDecomposition.cpp.

◆ getNeighbors()

void ompl::control::TriangularDecomposition::getNeighbors ( int rid,
std::vector< int > & neighbors ) const
overridevirtual

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

Implements ompl::control::Decomposition.

Definition at line 147 of file TriangularDecomposition.cpp.

◆ getNumHoles()

int ompl::control::TriangularDecomposition::getNumHoles ( ) const

Definition at line 107 of file TriangularDecomposition.cpp.

◆ getNumRegions()

int ompl::control::TriangularDecomposition::getNumRegions ( ) const
inlineoverridevirtual

Returns the number of regions in this Decomposition.

Implements ompl::control::Decomposition.

Definition at line 99 of file TriangularDecomposition.h.

◆ getNumRegionsOfInterest()

int ompl::control::TriangularDecomposition::getNumRegionsOfInterest ( ) const

Definition at line 112 of file TriangularDecomposition.cpp.

◆ getRegionOfInterestAt()

int ompl::control::TriangularDecomposition::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.

Definition at line 129 of file TriangularDecomposition.cpp.

◆ getRegionVolume()

double ompl::control::TriangularDecomposition::getRegionVolume ( int rid)
overridevirtual

Returns the volume of a given region in this Decomposition.

Implements ompl::control::Decomposition.

Definition at line 134 of file TriangularDecomposition.cpp.

◆ locateRegion()

int ompl::control::TriangularDecomposition::locateRegion ( const base::State * s) const
overridevirtual

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.

Implements ompl::control::Decomposition.

Definition at line 152 of file TriangularDecomposition.cpp.

◆ print()

void ompl::control::TriangularDecomposition::print ( std::ostream & out) const

Definition at line 184 of file TriangularDecomposition.cpp.

◆ sampleFromRegion()

void ompl::control::TriangularDecomposition::sampleFromRegion ( int rid,
RNG & rng,
std::vector< double > & coord ) const
overridevirtual

Samples a projected coordinate from a given region.

Implements ompl::control::Decomposition.

Definition at line 172 of file TriangularDecomposition.cpp.

◆ setup()

void ompl::control::TriangularDecomposition::setup ( )

Definition at line 90 of file TriangularDecomposition.cpp.

Member Data Documentation

◆ holes_

std::vector<Polygon> ompl::control::TriangularDecomposition::holes_
protected

Definition at line 138 of file TriangularDecomposition.h.

◆ intRegInfo_

std::vector<int> ompl::control::TriangularDecomposition::intRegInfo_
protected

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.

Definition at line 143 of file TriangularDecomposition.h.

◆ intRegs_

std::vector<Polygon> ompl::control::TriangularDecomposition::intRegs_
protected

Definition at line 139 of file TriangularDecomposition.h.

◆ triangles_

std::vector<Triangle> ompl::control::TriangularDecomposition::triangles_
protected

Definition at line 137 of file TriangularDecomposition.h.

◆ triAreaPct_

double ompl::control::TriangularDecomposition::triAreaPct_
protected

Definition at line 144 of file TriangularDecomposition.h.


The documentation for this class was generated from the following files: