Parasol Planning Library (PPL)
WorkspaceSkeleton Class Reference

Geometric skeleton of the workspace. More...

#include <WorkspaceSkeleton.h>

Inheritance diagram for WorkspaceSkeleton:
Inheritance graph
[legend]
Collaboration diagram for WorkspaceSkeleton:
Collaboration graph
[legend]

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< VIDVertexSet
 
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)
 
GenericStateGraphoperator= (const GenericStateGraph &_r)
 
GenericStateGraphoperator= (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, EIDAddEdge (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 VertexSetGetPredecessors (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 VertexSetGetAllVIDs () const noexcept
 Get the set of all VIDs in the roadmap. More...
 
RobotGetRobot () const noexcept
 Get the robot represented by this roadmap. More...
 
CCTrackerTypeGetCCTracker () const noexcept
 Get the connected component tracker. More...
 
VPGetVertex (T &_t) noexcept
 Retrieve a reference to a vertex property by descriptor or iterator. More...
 
VPGetVertex (VI &_t) noexcept
 
VPGetVertex (VID _t) noexcept
 
const VPGetVertex (T &_t) const noexcept
 
const VPGetVertex (CVI &_t) const noexcept
 
const VPGetVertex (VID _t) const noexcept
 
std::vector< VIDGetChildren (const VID _vid) const noexcept
 
size_t GetInDegree (const VID _vid) noexcept
 
std::vector< EIFindInboundEdges (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
 
EPGetEdge (const VID _source, const VID _target) noexcept
 
EPGetEdge (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 > >
Robotm_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, VertexHookm_addVertexHooks
 Hook functions to call when adding a vertex. More...
 
std::unordered_map< std::string, VertexHookm_deleteVertexHooks
 Hook functions to call when deleting a vertex. More...
 
std::unordered_map< std::string, EdgeHookm_addEdgeHooks
 Hook functions to call when adding an edge. More...
 
std::unordered_map< std::string, EdgeHookm_deleteEdgeHooks
 Hook functions to call when deleting an edge. More...
 
std::unique_ptr< CCTrackerTypem_ccTracker
 Tracks weak CCs within the roadmap. More...
 
std::unordered_map< VID, VertexSetm_predecessors
 
VertexSet m_allVIDs
 

Detailed Description

Geometric skeleton of the workspace.

Member Typedef Documentation

◆ adj_edge_iterator

◆ BaseType

typedef GenericStateGraph<mathtool::Point3d, std::vector<mathtool::Point3d> > WorkspaceSkeleton::BaseType

◆ CfgType

typedef mathtool::Point3d WorkspaceSkeleton::CfgType

◆ ED

◆ EdgeType

typedef std::vector<mathtool::Point3d> WorkspaceSkeleton::EdgeType

◆ VD

◆ vertex_descriptor

◆ vertex_iterator

Constructor & Destructor Documentation

◆ WorkspaceSkeleton()

WorkspaceSkeleton::WorkspaceSkeleton ( )

Member Function Documentation

◆ Direct()

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.

Parameters
_startA workspace point from which the direction should eminate.
Returns
A directed skeleton with flow pointing outward from _start.

◆ DoubleEdges()

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.

Note
This function assumes that all edges currently in the skeleton are unique and not reverse duplicates.

◆ FindEdge()

WorkspaceSkeleton::adj_edge_iterator WorkspaceSkeleton::FindEdge ( const ED _edgeDescriptor)

Find an edge iterator in the skeleton by descriptor.

Parameters
_edgeDescriptorThe descriptor of the edge to search for.
Returns
An iterator to the desired edge.

◆ FindNearestVertex()

WorkspaceSkeleton::vertex_iterator WorkspaceSkeleton::FindNearestVertex ( const mathtool::Point3d &  _target)

Helper function to find the skeleton vertex that is closest to a given workspace point.

Parameters
_targetThe workspace point.
Returns
An iterator to the nearest skeleton vertex.

◆ FindVertex()

WorkspaceSkeleton::vertex_iterator WorkspaceSkeleton::FindVertex ( const VD  _vertexDescriptor)

Find a vertex iterator in the skeleton by descriptor.

Parameters
_vertexDescriptorThe descriptor of the vertex to search for.
Returns
An iterator to the desired vertex.

◆ Prune()

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.

Parameters
_goalA workspace goal point.

◆ Read()

void WorkspaceSkeleton::Read ( const std::string &  _file)

Reads the graph from a file.

Parameters
_filethe output file name.

◆ RefineEdges()

void WorkspaceSkeleton::RefineEdges ( double  _maxLength)

Divide existing edges into sizes of at most _maxLength.

◆ Write()

void WorkspaceSkeleton::Write ( const std::string &  _file)

Writes the graph to a file.

Parameters
_filethe output file name.

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