]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blob - incl/rrtplanner.h
Make `steer` procedure part of RRTBase
[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(RRTNode *init, RRTNode *goal);
49                 bool next();
50 };
51
52 class T1: public RRTBase {
53         public:
54                 T1(RRTNode *init, RRTNode *goal);
55                 bool next();
56 };
57
58 class T2: public Karaman2011 {
59         public:
60                 using Karaman2011::Karaman2011;
61                 bool next();
62                 float goal_cost();
63 };
64
65 class T3: public RRTBase {
66         protected:
67                 T2 p_root_;
68                 T2 p_goal_;
69         public:
70                 T3(RRTNode *init, RRTNode *goal);
71                 bool next();
72                 bool link_obstacles(
73                                 std::vector<CircleObstacle> *cobstacles,
74                                 std::vector<SegmentObstacle> *sobstacles);
75                 bool connecttrees(RRTNode *rn, RRTNode *gn);
76                 bool overlaptrees(RRTNode **ron, RRTNode **gon);
77 };
78
79 class Klemm2015: public Karaman2011 {
80         private:
81                 RRTNode *orig_root_ = nullptr;
82                 RRTNode *orig_goal_ = nullptr;
83         protected:
84                 int extendstar1(RRTNode *rs, RRTNode **xn);
85                 int extendstarC(RRTNode *rs);
86                 int connectstar(RRTNode *x);
87                 void swap();
88         public:
89                 Klemm2015(RRTNode *init, RRTNode *goal);
90                 bool next();
91 };
92
93 #endif