]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blob - incl/rrtplanner.h
Merge branch 'release/0.7.0'
[hubacji1/iamcar.git] / incl / rrtplanner.h
1 /*
2 This file is part of I am car.
3
4 I am car is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 I am car is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with I am car. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef RRTPLANNER_H
19 #define RRTPLANNER_H
20
21 #include <vector>
22 #include "rrtbase.h"
23 #include "rrtnode.h"
24
25 #define GOALFIRST 1
26
27 class LaValle1998: public RRTBase {
28         public:
29                 //using RRTBase::RRTBase;
30                 LaValle1998(RRTNode *init, RRTNode *goal);
31                 bool next();
32 };
33
34 class Kuwata2008: public RRTBase {
35         public:
36                 Kuwata2008(RRTNode *init, RRTNode *goal);
37                 bool next();
38 };
39
40 class Karaman2011: public RRTBase {
41         protected:
42                 bool connect(
43                                 RRTNode *pn,
44                                 RRTNode *ns,
45                                 std::vector<RRTNode *> nvs);
46                 bool rewire(std::vector<RRTNode *> nvs, RRTNode *ns);
47         public:
48                 Karaman2011();
49                 Karaman2011(RRTNode *init, RRTNode *goal);
50                 bool next();
51 };
52
53 class T1: public RRTBase {
54         public:
55                 T1(RRTNode *init, RRTNode *goal);
56                 bool next();
57 };
58
59 class T2: public Karaman2011 {
60         public:
61                 using Karaman2011::Karaman2011;
62                 bool next();
63                 float goal_cost();
64 };
65
66 class T3: public RRTBase {
67         protected:
68         public:
69                 T2 p_root_;
70                 T2 p_goal_;
71                 ~T3();
72                 T3();
73                 T3(RRTNode *init, RRTNode *goal);
74                 bool next();
75                 bool link_obstacles(
76                                 std::vector<CircleObstacle> *cobstacles,
77                                 std::vector<SegmentObstacle> *sobstacles);
78                 bool connecttrees(RRTNode *rn, RRTNode *gn);
79                 bool overlaptrees(RRTNode **ron, RRTNode **gon);
80 };
81
82 class Klemm2015: public Karaman2011 {
83         private:
84                 RRTNode *orig_root_ = nullptr;
85                 RRTNode *orig_goal_ = nullptr;
86         protected:
87                 int extendstar1(RRTNode *rs, RRTNode **xn);
88                 int extendstarC(RRTNode *rs);
89                 int connectstar(RRTNode *x);
90                 void swap();
91         public:
92                 Klemm2015(RRTNode *init, RRTNode *goal);
93                 bool next();
94 };
95
96 #endif