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

Classes | |
| struct | Vertex |
| struct | Polygon |
| struct | Triangle |
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 ®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. | |
| 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::RealVectorBounds & | getBounds () 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< 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_ |
| 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 76 of file TriangularDecomposition.cpp.
Member Function Documentation
◆ addHole()
| void ompl::control::TriangularDecomposition::addHole | ( | const Polygon & | hole | ) |
Definition at line 98 of file TriangularDecomposition.cpp.
◆ addRegionOfInterest()
| void ompl::control::TriangularDecomposition::addRegionOfInterest | ( | const Polygon & | region | ) |
Definition at line 103 of file TriangularDecomposition.cpp.
◆ createTriangles()
|
protectedvirtual |
Helper method to triangulate the space and return the number of triangles.
Definition at line 213 of file TriangularDecomposition.cpp.
◆ getAreasOfInterest()
| const std::vector< ompl::control::TriangularDecomposition::Polygon > & ompl::control::TriangularDecomposition::getAreasOfInterest | ( | ) | const |
Definition at line 125 of file TriangularDecomposition.cpp.
◆ getHoles()
| const std::vector< ompl::control::TriangularDecomposition::Polygon > & ompl::control::TriangularDecomposition::getHoles | ( | ) | const |
Definition at line 119 of file TriangularDecomposition.cpp.
◆ getNeighbors()
|
overridevirtual |
Stores a given region's neighbors into a given vector.
Implements ompl::control::Decomposition.
Definition at line 148 of file TriangularDecomposition.cpp.
◆ getNumHoles()
| int ompl::control::TriangularDecomposition::getNumHoles | ( | ) | const |
Definition at line 108 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 113 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 130 of file TriangularDecomposition.cpp.
◆ getRegionVolume()
|
overridevirtual |
Returns the volume of a given region in this Decomposition.
Implements ompl::control::Decomposition.
Definition at line 135 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 153 of file TriangularDecomposition.cpp.
◆ print()
| void ompl::control::TriangularDecomposition::print | ( | std::ostream & | out | ) | const |
Definition at line 185 of file TriangularDecomposition.cpp.
◆ sampleFromRegion()
|
overridevirtual |
Samples a projected coordinate from a given region.
Implements ompl::control::Decomposition.
Definition at line 173 of file TriangularDecomposition.cpp.
◆ setup()
| void ompl::control::TriangularDecomposition::setup | ( | ) |
Definition at line 91 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