-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMotionPlanner.h
66 lines (59 loc) · 1.69 KB
/
MotionPlanner.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef _MOTION_PLANNER_H_
#define _MOTION_PLANNER_H_
#include <ompl/geometric/SimpleSetup.h>
#include <ompl/geometric/planners/prm/PRM.h>
#include <ompl/geometric/planners/rrt/RRTstar.h>
#include <ompl/geometric/planners/rrt/LBTRRT.h>
#include <ompl/geometric/planners/rrt/LazyRRT.h>
#include <ompl/geometric/planners/rrt/RRT.h>
#include <ompl/geometric/planners/rrt/RRTConnect.h>
#include <ompl/geometric/planners/rrt/TRRT.h>
#include <ompl/geometric/planners/rrt/pRRT.h>
#include <ompl/geometric/planners/est/EST.h>
#include <ompl/base/spaces/SE2StateSpace.h>
#include <ompl/base/PlannerData.h>
#include <cmath>
#include <iostream>
#include <fstream>
#include <ostream>
namespace ob = ompl::base;
namespace og = ompl::geometric;
typedef struct {
double xrange[2];
double yrange[2];
} RANGE;
class Planning{
public:
Planning(std::string fileName);
void initFromFile(std::string fileName);
void CreateCube();
void PlannerSelector();
void printEdge(std::ostream &os, const ob::StateSpacePtr &space, const ob::PlannerDataVertex &vertex);
bool isStateValid(const ob::State *state);
void planWithSimpleSetup();
void output_plt(std::string plt_output);
int OpenGnuplot();
private:
double* xMin;
double* xMax;
double* yMin;
double* yMax;
// Number of obstacles in space.
int numObstacles;
// Start position in space
double xStart;
double yStart;
// Goal position in space
double xGoal;
double yGoal;
// Max. distance toward each sampled position we
// should grow our tree
double stepSize;
// Boundaries of the space
double xLeft;
double xRight;
double yTop;
double yBottom;
int selector;
};
#endif