![]() |
Parasol Planning Library (PPL)
|
#include <WorkspaceDecomposition.h>
Public Types | |
Local Types | |
typedef stapl::sequential::graph< stapl::DIRECTED, stapl::NONMULTIEDGES, WorkspaceRegion, WorkspacePortal > | RegionGraph |
typedef RegionGraph::vertex_iterator | iterator |
typedef RegionGraph::const_vertex_iterator | const_iterator |
typedef RegionGraph::edge_iterator | edge_iterator |
typedef RegionGraph::const_edge_iterator | const_edge_iterator |
typedef RegionGraph::adj_edge_iterator | adj_edge_iterator |
typedef RegionGraph::const_adj_edge_iterator | const_adj_edge_iterator |
typedef RegionGraph::vertex_descriptor | vertex_descriptor |
typedef RegionGraph::edge_descriptor | edge_descriptor |
typedef stapl::sequential::graph< stapl::DIRECTED, stapl::NONMULTIEDGES, Vector3d, double > | DualGraph |
Public Member Functions | |
Construction | |
WorkspaceDecomposition () | |
WorkspaceDecomposition (const WorkspaceDecomposition &) | |
WorkspaceDecomposition (WorkspaceDecomposition &&) | |
virtual | ~WorkspaceDecomposition () |
Assignment | |
WorkspaceDecomposition & | operator= (const WorkspaceDecomposition &) |
WorkspaceDecomposition & | operator= (WorkspaceDecomposition &&) |
Point Accessors | |
const size_t | GetNumPoints () const noexcept |
const Point3d & | GetPoint (const size_t _i) const noexcept |
const std::vector< Point3d > & | GetPoints () const noexcept |
Region Accessors | |
const size_t | GetNumRegions () const noexcept |
const WorkspaceRegion & | GetRegion (const size_t _i) const noexcept |
const vertex_descriptor | GetDescriptor (const WorkspaceRegion &_region) const noexcept |
Portal Accessors | |
const WorkspacePortal & | GetPortal (const size_t _i1, const size_t _i2) const noexcept |
Dual Graph Accessors | |
DualGraph & | GetDualGraph () noexcept |
const DualGraph & | GetDualGraph () const noexcept |
Modifiers | |
void | AddPoint (const Point3d &_p) |
void | AddTetrahedralRegion (const int _pts[4]) |
void | AddPortal (const size_t _r1, const size_t _r2) |
void | Finalize () |
I/O | |
void | Print (std::ostream &_os) const |
Write the decomposition graph to an output stream. More... | |
void | WriteObj (const std::string &_filename) const |
Path Finding | |
std::vector< size_t > | FindPath (const size_t _source, const size_t _target) const |
std::vector< size_t > | FindPath (const WorkspaceRegion *const _source, const WorkspaceRegion *const _target) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
std::vector< size_t > | FindNeighborhood (const std::vector< size_t > &_roots, const double _threshold) const |
A region-decomposition representation of the workspace.
The decomposition regions are represented by WorkspaceRegion, while connections between them are described by WorkspacePortal. Once the decomposition has been constructed, it cannot be changed.
Currently it is only possible to add tetrahedral regions.
typedef RegionGraph::adj_edge_iterator WorkspaceDecomposition::adj_edge_iterator |
typedef RegionGraph::const_adj_edge_iterator WorkspaceDecomposition::const_adj_edge_iterator |
typedef RegionGraph::const_edge_iterator WorkspaceDecomposition::const_edge_iterator |
typedef RegionGraph::const_vertex_iterator WorkspaceDecomposition::const_iterator |
typedef stapl::sequential::graph<stapl::DIRECTED, stapl::NONMULTIEDGES, Vector3d, double> WorkspaceDecomposition::DualGraph |
Terminology blunder: this isn't really a dual graph. It is a 1-reduction of the region graph instead. Each region is represented as a point, and each portal is represented as a euclidean straight-line distance between vertices.
typedef RegionGraph::edge_descriptor WorkspaceDecomposition::edge_descriptor |
typedef RegionGraph::edge_iterator WorkspaceDecomposition::edge_iterator |
typedef RegionGraph::vertex_iterator WorkspaceDecomposition::iterator |
typedef stapl::sequential::graph<stapl::DIRECTED, stapl::NONMULTIEDGES, WorkspaceRegion, WorkspacePortal> WorkspaceDecomposition::RegionGraph |
typedef RegionGraph::vertex_descriptor WorkspaceDecomposition::vertex_descriptor |
|
default |
WorkspaceDecomposition::WorkspaceDecomposition | ( | const WorkspaceDecomposition & | _other | ) |
WorkspaceDecomposition::WorkspaceDecomposition | ( | WorkspaceDecomposition && | _other | ) |
|
virtualdefault |
void WorkspaceDecomposition::AddPoint | ( | const Point3d & | _p | ) |
Add a point to the decomposition. This will be either a point on a workspace obstacle or a point in the freespace generated by the decomposition algorithm.
_p | The point to add. |
void WorkspaceDecomposition::AddPortal | ( | const size_t | _r1, |
const size_t | _r2 | ||
) |
Add a portal between two regions.
_r1 | The first region. |
_r2 | The second region. |
void WorkspaceDecomposition::AddTetrahedralRegion | ( | const int | _pts[4] | ) |
Add a tetrahedral region to the decomposition.
_pts | A set of four point indexes, representing the vertices of the tetrahedron. |
void WorkspaceDecomposition::Finalize | ( | ) |
Finalize this, thereby triggering exceptions upon further attempts to modify the decomposition. This ensures that the dual graph is accurate, and that no functions added later on try to modify the points (which are indexed by the WorkspaceRegions).
std::vector< size_t > WorkspaceDecomposition::FindNeighborhood | ( | const std::vector< size_t > & | _roots, |
const double | _threshold | ||
) | const |
Find a neighborhood surrounding a set of regions.
_roots | The region descriptors to search from. |
_threshold | The max distance from source, through midpoints, for other regions in the neighborhood. |
std::vector< size_t > WorkspaceDecomposition::FindPath | ( | const size_t | _source, |
const size_t | _target | ||
) | const |
Find a path between two regions.
_source | The source region. |
_target | The target region. |
std::vector< size_t > WorkspaceDecomposition::FindPath | ( | const WorkspaceRegion *const | _source, |
const WorkspaceRegion *const | _target | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
WorkspaceDecomposition & WorkspaceDecomposition::operator= | ( | const WorkspaceDecomposition & | _other | ) |
WorkspaceDecomposition & WorkspaceDecomposition::operator= | ( | WorkspaceDecomposition && | _other | ) |
void WorkspaceDecomposition::Print | ( | std::ostream & | _os | ) | const |
Write the decomposition graph to an output stream.
void WorkspaceDecomposition::WriteObj | ( | const std::string & | _filename | ) | const |
Write an OBJ file of the decomposition regions to an output stream. The OBJ will include all internal facets. This is primarily for validating that a decomposition gave the expected result.