Parasol Planning Library (PPL)
|
Geometric skeleton of the workspace. More...
#include <WorkspaceSkeleton.h>
Public Types | |
Local Types | |
typedef GenericStateGraph< mathtool::Point3d, std::vector< mathtool::Point3d > > | BaseType |
typedef BaseType::VID | VD |
typedef BaseType::EID | ED |
typedef BaseType::VI | vertex_iterator |
typedef BaseType::VID | vertex_descriptor |
typedef BaseType::EI | adj_edge_iterator |
typedef mathtool::Point3d | CfgType |
typedef std::vector< mathtool::Point3d > | EdgeType |
Public Types inherited from GenericStateGraph< mathtool::Point3d, std::vector< mathtool::Point3d > > | |
enum class | HookType |
using | STAPLGraph = stapl::sequential::graph< stapl::DIRECTED, stapl::NONMULTIEDGES, mathtool::Point3d, std::vector< mathtool::Point3d > > |
typedef STAPLGraph::vertex_descriptor | VID |
typedef STAPLGraph::edge_descriptor | EID |
typedef EID::edge_id_type | EdgeID |
typedef std::unordered_set< VID > | VertexSet |
typedef STAPLGraph::vertex_iterator | VI |
typedef STAPLGraph::adj_edge_iterator | EI |
typedef STAPLGraph::const_vertex_iterator | CVI |
typedef STAPLGraph::const_adj_edge_iterator | CEI |
typedef STAPLGraph::vertex_property | VP |
typedef STAPLGraph::edge_property | EP |
typedef mathtool::Point3d | CfgType |
typedef std::vector< mathtool::Point3d > | EdgeType |
typedef stapl::sequential::vector_property_map< STAPLGraph, size_t > | ColorMap |
typedef std::function< void(VI)> | VertexHook |
typedef std::function< void(EI)> | EdgeHook |
typedef CCTracker< GenericStateGraph< mathtool::Point3d, std::vector< mathtool::Point3d > > > | CCTrackerType |
Public Member Functions | |
Construction | |
WorkspaceSkeleton () | |
Locators | |
vertex_iterator | FindNearestVertex (const mathtool::Point3d &_target) |
vertex_iterator | FindVertex (const VD _vertexDescriptor) |
adj_edge_iterator | FindEdge (const ED &_edgeDescriptor) |
Modifiers | |
WorkspaceSkeleton | Direct (const mathtool::Point3d &_start) |
void | Prune (const mathtool::Point3d &_goal) |
void | RefineEdges (double _maxLength) |
Divide existing edges into sizes of at most _maxLength. More... | |
void | DoubleEdges () |
IO | |
void | Write (const std::string &_file) |
void | Read (const std::string &_file) |
Public Member Functions inherited from GenericStateGraph< mathtool::Point3d, std::vector< mathtool::Point3d > > | |
GenericStateGraph () | |
GenericStateGraph (Robot *const _r) | |
GenericStateGraph (const GenericStateGraph &_r) | |
GenericStateGraph (GenericStateGraph &&_r) | |
GenericStateGraph & | operator= (const GenericStateGraph &_r) |
GenericStateGraph & | operator= (GenericStateGraph &&_r) |
bool | operator== (const GenericStateGraph &_r) const noexcept |
bool | operator!= (const GenericStateGraph &_r) const noexcept |
virtual VID | AddVertex (const mathtool::Point3d &_v) noexcept |
virtual VID | AddVertex (const VID _vid, const mathtool::Point3d &_v) noexcept |
virtual VID | AddDuplicateVertex (const mathtool::Point3d &_v) noexcept |
virtual void | DeleteVertex (const VID _v) noexcept |
virtual EID | AddEdge (const VID _source, const VID _target, const std::vector< mathtool::Point3d > &_w) noexcept |
virtual std::pair< EID, EID > | AddEdge (const VID _source, const VID _target, const std::pair< std::vector< mathtool::Point3d >, std::vector< mathtool::Point3d > > &_w) noexcept |
virtual EID | AddEdge (const EID _eid, const std::vector< mathtool::Point3d > &_w) noexcept |
virtual EID | AddEdge (const VID _source, const VID _target) noexcept |
virtual void | DeleteEdge (const VID _source, const VID _target) noexcept |
virtual void | DeleteEdge (EI _iterator) noexcept |
void | SetRobot (Robot *const _r) noexcept |
Set the robot pointer on all configurations in the map. More... | |
void | AppendRoadmap (const GenericStateGraph &_r) |
void | SetCCTracker (StatClass *const _stats=nullptr) |
size_t | Size () const noexcept |
Get the number of vertices in the roadmap. More... | |
bool | IsVertex (const VID _vid) const noexcept |
bool | IsVertex (const mathtool::Point3d &_v) const noexcept |
bool | IsVertex (const mathtool::Point3d &_v, CVI &_vi) const noexcept |
bool | IsEdge (const VID _source, const VID _target) const noexcept |
VID | GetVID (const T &_t) const noexcept |
VID | GetVID (const VI &_t) const noexcept |
VID | GetVID (const mathtool::Point3d &_t) const noexcept |
const VertexSet & | GetPredecessors (const VID _vid) const noexcept |
VID | GetLastVID () const noexcept |
Get the descriptor of the last vertex added to the graph. More... | |
size_t | GetTimestamp () const noexcept |
Each time the roadmap is modified, we update the timestamp. More... | |
const VertexSet & | GetAllVIDs () const noexcept |
Get the set of all VIDs in the roadmap. More... | |
Robot * | GetRobot () const noexcept |
Get the robot represented by this roadmap. More... | |
CCTrackerType * | GetCCTracker () const noexcept |
Get the connected component tracker. More... | |
VP & | GetVertex (T &_t) noexcept |
Retrieve a reference to a vertex property by descriptor or iterator. More... | |
VP & | GetVertex (VI &_t) noexcept |
VP & | GetVertex (VID _t) noexcept |
const VP & | GetVertex (T &_t) const noexcept |
const VP & | GetVertex (CVI &_t) const noexcept |
const VP & | GetVertex (VID _t) const noexcept |
std::vector< VID > | GetChildren (const VID _vid) const noexcept |
size_t | GetInDegree (const VID _vid) noexcept |
std::vector< EI > | FindInboundEdges (const VID _vid) |
bool | GetEdge (const VID _source, const VID _target, EI &_ei) noexcept |
bool | GetEdge (const VID _source, const VID _target, CEI &_ei) const noexcept |
EP & | GetEdge (const VID _source, const VID _target) noexcept |
EP & | GetEdge (const EID _descriptor) noexcept |
bool | IsHook (const HookType, const std::string &_label) const |
void | InstallHook (const HookType _type, const std::string &_label, const VertexHook &_h) |
void | InstallHook (const HookType _type, const std::string &_label, const EdgeHook &_h) |
void | RemoveHook (const HookType _type, const std::string &_label) |
void | DisableHooks () noexcept |
void | EnableHooks () noexcept |
Enable the hook functions (default). More... | |
virtual void | ClearHooks () noexcept |
virtual void | Write (const std::string &_filename, Environment *_env) const |
Additional Inherited Members | |
Protected Member Functions inherited from GenericStateGraph< mathtool::Point3d, std::vector< mathtool::Point3d > > | |
void | ExecuteAddVertexHooks (const VI _iterator) noexcept |
void | ExecuteDeleteVertexHooks (const VI _iterator) noexcept |
void | ExecuteAddEdgeHooks (const EI _iterator) noexcept |
void | ExecuteDeleteEdgeHooks (const EI _iterator) noexcept |
std::string | ToString (const HookType &_t) const noexcept |
Protected Attributes inherited from GenericStateGraph< mathtool::Point3d, std::vector< mathtool::Point3d > > | |
Robot * | m_robot |
The robot this roadmap is for. More... | |
size_t | m_timestamp |
Tracks the number of changes to the graph. More... | |
bool | m_enableHooks |
Use hook functions? More... | |
std::unordered_map< std::string, VertexHook > | m_addVertexHooks |
Hook functions to call when adding a vertex. More... | |
std::unordered_map< std::string, VertexHook > | m_deleteVertexHooks |
Hook functions to call when deleting a vertex. More... | |
std::unordered_map< std::string, EdgeHook > | m_addEdgeHooks |
Hook functions to call when adding an edge. More... | |
std::unordered_map< std::string, EdgeHook > | m_deleteEdgeHooks |
Hook functions to call when deleting an edge. More... | |
std::unique_ptr< CCTrackerType > | m_ccTracker |
Tracks weak CCs within the roadmap. More... | |
std::unordered_map< VID, VertexSet > | m_predecessors |
VertexSet | m_allVIDs |
Geometric skeleton of the workspace.
typedef GenericStateGraph<mathtool::Point3d, std::vector<mathtool::Point3d> > WorkspaceSkeleton::BaseType |
typedef mathtool::Point3d WorkspaceSkeleton::CfgType |
typedef BaseType::EID WorkspaceSkeleton::ED |
typedef std::vector<mathtool::Point3d> WorkspaceSkeleton::EdgeType |
typedef BaseType::VID WorkspaceSkeleton::VD |
WorkspaceSkeleton::WorkspaceSkeleton | ( | ) |
WorkspaceSkeleton WorkspaceSkeleton::Direct | ( | const mathtool::Point3d & | _start | ) |
Direct the skeleton so that all edges point outwards from the vertex nearest to a given starting point.
_start | A workspace point from which the direction should eminate. |
void WorkspaceSkeleton::DoubleEdges | ( | ) |
Double up the edges so that each one has a duplicate facing the opposite direction with reversed path and same edge ID. This does not make sense with Direct or Prune. If you want to use with RefineEdges you should call that first to ensure the edge counterparts match exactly.
WorkspaceSkeleton::adj_edge_iterator WorkspaceSkeleton::FindEdge | ( | const ED & | _edgeDescriptor | ) |
Find an edge iterator in the skeleton by descriptor.
_edgeDescriptor | The descriptor of the edge to search for. |
WorkspaceSkeleton::vertex_iterator WorkspaceSkeleton::FindNearestVertex | ( | const mathtool::Point3d & | _target | ) |
Helper function to find the skeleton vertex that is closest to a given workspace point.
_target | The workspace point. |
WorkspaceSkeleton::vertex_iterator WorkspaceSkeleton::FindVertex | ( | const VD | _vertexDescriptor | ) |
Find a vertex iterator in the skeleton by descriptor.
_vertexDescriptor | The descriptor of the vertex to search for. |
void WorkspaceSkeleton::Prune | ( | const mathtool::Point3d & | _goal | ) |
Prune the skeleton by removing vertices and edges that are not reachable by back-tracking the edges from the vertex nearst to a goal point. Only makes sense after calling Direct.
_goal | A workspace goal point. |
void WorkspaceSkeleton::Read | ( | const std::string & | _file | ) |
Reads the graph from a file.
_file | the output file name. |
void WorkspaceSkeleton::RefineEdges | ( | double | _maxLength | ) |
Divide existing edges into sizes of at most _maxLength.
void WorkspaceSkeleton::Write | ( | const std::string & | _file | ) |
Writes the graph to a file.
_file | the output file name. |