OMPL Plannification
Path planning with OMPL
StateChecker.hpp
1 
9 #include <string>
10 
11 using namespace std;
12 
13 //OCTOMAP//
14 #include <octomap/octomap.h>
15 
16 using namespace octomap;
17 
18 //OMPL//
19 #include <ompl/config.h>
20 #include <ompl/base/SpaceInformation.h>
21 #include <ompl/base/spaces/RealVectorStateSpace.h>
22 
23 namespace ob = ompl::base;
24 
30 {
31  double x;
32  double y;
33  double z;
34 };
35 
41 class StateChecker : public ob::StateValidityChecker
42 {
43  public:
44 
46 
49  StateChecker(const ob::SpaceInformationPtr &si);
50 
52  void loadMap(const std::string mapFile);
53  void loadMap(octomap::OcTree* octree);
54 
56  void setCollisionMask(double x, double y, double z = 0.2);
57 
59 
62  void setDepthLimit(double depth_limit);
63 
65 
68  virtual bool isValid(const ob::State *state) const;
69 
71 
74  ~StateChecker();
75 
76  private :
77 
78  int planningDimension;
79  //Octomap
80  octomap::OcTree* _map = nullptr;
81  double _map_res, _depth_limit;
82 
83  Checking_Box _check_box;
84 };
Class for state checking for 2D and 3D planning. Extension of an abstract class used to implement the...
Collision Mask : virtual representation of the drone as a box with x,y,z length.