Parasol Planning Library (PPL)
PathStrategy.h
Go to the documentation of this file.
1 #ifndef PATH_STRATEGY_H_
2 #define PATH_STRATEGY_H_
3 
4 #include "MPStrategyMethod.h"
5 
6 #include "Utilities/XMLNode.h"
7 
20  public:
23 
25  typedef typename RoadmapType::VID VID;
27 
31 
32  PathStrategy();
33  PathStrategy(XMLNode& _node);
34 
38 
39  virtual void Print(ostream& _os) const override;
40 
44 
45  virtual void Initialize() override;
46  virtual void Run() override;
47  virtual void Finalize() override;
48 
50 
51  protected:
54 
57  void getUserPaths();
58 
64  bool ValidateCfg(Cfg& _cfg);
65 
73  Cfg RandomNearNode(Cfg& _invalidNode, Cfg& _nextNode, Cfg& _lastValidNode);
74 
80  void AddToRoadmap(vector<Point3d>& _points, vector<VID>& _vids);
81 
86  void ConnectPath(const vector<VID>& _vids);
87 
94  bool ConnectCC(VID _vid1, VID _vid2);
95 
98  void ConnectCCs();
99 
101 
102  private:
105 
106  string m_vcLabel{"pqp_solid"};
107  string m_dmLabel{"euclidean"};
108  string m_lpLabel{"sl"};
109  string m_ncLabel{"Closest"};
110  string m_nfLabel{"BFNF"};
111 
115 
116  vector<vector<Point3d>> m_userPaths;
117  vector<VID> m_endPoints;
118  string m_UserPathsFilename;
119  double m_radius;
120 
122 };
123 
124 #endif
Definition: Cfg.h:38
Definition: GenericStateGraph.h:67
STAPLGraph::vertex_descriptor VID
Definition: GenericStateGraph.h:83
std::unordered_set< VID > VertexSet
Definition: GenericStateGraph.h:86
Definition: MPStrategyMethod.h:33
size_t VID
Definition: MPStrategyMethod.h:40
PathStrategy generates configurations along user-generated paths.
Definition: PathStrategy.h:19
void getUserPaths()
Read the users paths from file.
Definition: PathStrategy.cpp:111
void AddToRoadmap(vector< Point3d > &_points, vector< VID > &_vids)
Validate and add configurations to the roadmap. Store their VID's for connection.
Definition: PathStrategy.cpp:148
MPBaseObject::RoadmapType RoadmapType
Definition: PathStrategy.h:24
virtual void Finalize() override
Clean-up and output results.
Definition: PathStrategy.cpp:81
Cfg RandomNearNode(Cfg &_invalidNode, Cfg &_nextNode, Cfg &_lastValidNode)
Samples a node near the invalid node trying to connect it to the previous and, if valid,...
Definition: PathStrategy.cpp:211
bool ConnectCC(VID _vid1, VID _vid2)
Tries to connect the two connected components represented by the given nodes.
Definition: PathStrategy.cpp:270
void ConnectPath(const vector< VID > &_vids)
Try to connect new nodes to the roadmap in the path sequence. If a connection attempt fails,...
Definition: PathStrategy.cpp:176
bool ValidateCfg(Cfg &_cfg)
Check the configuration's validity.
Definition: PathStrategy.cpp:137
virtual void Print(ostream &_os) const override
Definition: PathStrategy.cpp:28
RoadmapType::VID VID
Definition: PathStrategy.h:25
RoadmapType::VertexSet VertexSet
Definition: PathStrategy.h:26
virtual void Initialize() override
Definition: PathStrategy.cpp:38
PathStrategy()
Definition: PathStrategy.cpp:11
virtual void Run() override
Call Iterate until EvaluateMap is true.
Definition: PathStrategy.cpp:49
void ConnectCCs()
Attempts to connect all the connected components.
Definition: PathStrategy.cpp:248
Definition: XMLNode.h:27