Parasol Planning Library (PPL)
ObstacleBasedSampler.h
Go to the documentation of this file.
1 #ifndef OBSTACLE_BASED_SAMPLER_H_
2 #define OBSTACLE_BASED_SAMPLER_H_
3 
4 #include "SamplerMethod.h"
5 
15 class ObstacleBasedSampler : virtual public SamplerMethod {
16 
17  public:
18 
21 
23  typedef std::map<Robot*, const Boundary*> BoundaryMap;
24 
28 
29  ObstacleBasedSampler(string _vcLabel = "", string _dmLabel = "",
30  int _free = 1, int _coll = 0, double _step = 0,
31  bool _useBBX = true, string _pointSelection = "cspace");
32 
34 
35  virtual ~ObstacleBasedSampler() = default;
36 
40 
41  virtual void Print(ostream& _os) const override;
42 
44 
45  protected:
46 
47  // ///@name XML Parser
48  // ///@{
49 
50  // void ParseXML(XMLNode& _node);
51 
52  // ///@}
55 
63  virtual bool Sampler(Cfg& _cfg, const Boundary* const _boundary,
64  std::vector<Cfg>& _result, std::vector<Cfg>& _collision);
65 
72  virtual bool Sampler(GroupCfgType& _cfg, const Boundary* const _boundary,
73  std::vector<GroupCfgType>& _result, std::vector<GroupCfgType>& _invalid);
74 
81  virtual bool Sampler(GroupCfgType& _cfg, const BoundaryMap& _boundaryMap,
82  std::vector<GroupCfgType>& _result, std::vector<GroupCfgType>& _collision);
83 
92  void GenerateShells(const Boundary* const _boundary,
93  Cfg& _cFree, Cfg& _cColl, Cfg& _incr,
94  std::vector<Cfg>& _result, std::vector<Cfg>& _collision);
95 
104  void GenerateShells(const Boundary* const _boundary,
105  GroupCfgType& _cFree, GroupCfgType& _cColl, GroupCfgType& _incr,
106  std::vector<GroupCfgType>& _result, std::vector<GroupCfgType>& _collision);
107 
116  // void GenerateShells(const Environment* const _environment,
117  void GenerateShells(const BoundaryMap& _boundaryMap,
118  GroupCfgType& _cFree, GroupCfgType& _cColl, GroupCfgType& _incr,
119  std::vector<GroupCfgType>& _result, std::vector<GroupCfgType>& _collision);
120 
125 
126  // Returns a Cfg at a random vertex of the MultiBody
130 
136  Vector3d ChoosePointOnTriangle(Vector3d _p, Vector3d _q, Vector3d _r);
137 
142 
147 
152 
156  virtual Cfg ChooseASample(Cfg& _cfg);
157 
161  virtual GroupCfgType ChooseASample(GroupCfgType& _cfg);
162 
166 
170  Cfg GetCfgWithParams(const Vector3d& _v);
171 
176  bool GroupInBounds(GroupCfgType& _groupCfg, const BoundaryMap& _boundaryMap);
177 
182  bool GroupInBounds(GroupCfgType& _groupCfg, const Boundary* const _boundary);
184 
185  private:
186 
189 
190  string m_vcLabel, m_dmLabel;
191  int m_nShellsFree, m_nShellsColl;
192  double m_stepSize;
193  bool m_useBBX;
194  string m_pointSelection;
195 
197 };
198 
199 #endif
Definition: Boundary.h:30
Definition: Cfg.h:38
Definition: GroupCfg.h:39
Definition: MultiBody.h:65
Obstacle-based sampling.
Definition: ObstacleBasedSampler.h:15
std::map< Robot *, const Boundary * > BoundaryMap
Definition: ObstacleBasedSampler.h:23
virtual bool Sampler(Cfg &_cfg, const Boundary *const _boundary, std::vector< Cfg > &_result, std::vector< Cfg > &_collision)
Definition: ObstacleBasedSampler.cpp:68
void GenerateShells(const Boundary *const _boundary, Cfg &_cFree, Cfg &_cColl, Cfg &_incr, std::vector< Cfg > &_result, std::vector< Cfg > &_collision)
Definition: ObstacleBasedSampler.cpp:372
virtual Cfg ChooseASample(Cfg &_cfg)
Definition: ObstacleBasedSampler.cpp:585
Cfg ChooseASampleOtherMethods()
Definition: ObstacleBasedSampler.cpp:611
Cfg ChooseCenterOfMass(MultiBody *_mBody)
Definition: ObstacleBasedSampler.cpp:483
Cfg ChooseRandomVertex(MultiBody *_mBody)
Definition: ObstacleBasedSampler.cpp:494
Cfg ChooseRandomTriangle(MultiBody *_mBody)
Definition: ObstacleBasedSampler.cpp:547
Vector3d ChoosePointOnTriangle(Vector3d _p, Vector3d _q, Vector3d _r)
Definition: ObstacleBasedSampler.cpp:504
Cfg ChooseExtremeVertex(MultiBody *_mBody)
Definition: ObstacleBasedSampler.cpp:565
Cfg ChooseRandomWeightedTriangle(MultiBody *_mBody)
Definition: ObstacleBasedSampler.cpp:521
virtual void Print(ostream &_os) const override
Definition: ObstacleBasedSampler.cpp:52
bool GroupInBounds(GroupCfgType &_groupCfg, const BoundaryMap &_boundaryMap)
Definition: ObstacleBasedSampler.cpp:341
Cfg GetCfgWithParams(const Vector3d &_v)
Definition: ObstacleBasedSampler.cpp:666
ObstacleBasedSampler(string _vcLabel="", string _dmLabel="", int _free=1, int _coll=0, double _step=0, bool _useBBX=true, string _pointSelection="cspace")
Definition: ObstacleBasedSampler.cpp:8
virtual ~ObstacleBasedSampler()=default
MPBaseObject::GroupCfgType GroupCfgType
Definition: ObstacleBasedSampler.h:22
Definition: SamplerMethod.h:70
Definition: XMLNode.h:27