A TriangularDecomposition is a triangulation that ignores obstacles. More...
#include <ompl/extensions/triangle/TriangularDecomposition.h>

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. More... | |
int | getNumRegions () const override |
Returns the number of regions in this Decomposition. More... | |
double | getRegionVolume (int triID) override |
Returns the volume of a given region in this Decomposition. More... | |
void | getNeighbors (int triID, std::vector< int > &neighbors) const override |
Stores a given region's neighbors into a given vector. More... | |
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. More... | |
void | sampleFromRegion (int triID, RNG &rng, std::vector< double > &coord) const override |
Samples a projected coordinate from a given region. More... | |
void | setup () |
void | addHole (const Polygon &hole) |
void | addRegionOfInterest (const Polygon ®ion) |
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. More... | |
void | print (std::ostream &out) const |
![]() | |
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. More... | |
virtual int | getNumRegions () const =0 |
Returns the number of regions in this Decomposition. More... | |
virtual int | getDimension () const |
Returns the dimension of this Decomposition. More... | |
virtual const base::RealVectorBounds & | getBounds () const |
Returns the bounds of this Decomposition. More... | |
virtual double | getRegionVolume (int rid)=0 |
Returns the volume of a given region in this Decomposition. More... | |
virtual int | locateRegion (const base::State *s) const =0 |
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. More... | |
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. More... | |
virtual void | getNeighbors (int rid, std::vector< int > &neighbors) const =0 |
Stores a given region's neighbors into a given vector. More... | |
virtual void | sampleFromRegion (int rid, RNG &rng, std::vector< double > &coord) const =0 |
Samples a projected coordinate from a given region. More... | |
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. More... | |
Protected Member Functions | |
virtual int | createTriangles () |
Helper method to triangulate the space and return the number of triangles. More... | |
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. More... | |
double | triAreaPct_ |
![]() | |
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()
|
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()
|
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()
|
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()
|
overridevirtual |
Returns the volume of a given region in this Decomposition.
Implements ompl::control::Decomposition.
Definition at line 134 of file TriangularDecomposition.cpp.
◆ locateRegion()
|
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()
|
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_
|
protected |
Definition at line 138 of file TriangularDecomposition.h.
◆ 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_
|
protected |
Definition at line 139 of file TriangularDecomposition.h.
◆ triangles_
|
protected |
Definition at line 137 of file TriangularDecomposition.h.
◆ triAreaPct_
|
protected |
Definition at line 144 of file TriangularDecomposition.h.
The documentation for this class was generated from the following files:
- ompl/extensions/triangle/TriangularDecomposition.h
- ompl/extensions/triangle/src/TriangularDecomposition.cpp