]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blob - incl/rrtplanner.h
Merge branch 'feature/index-y'
[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
32                 // RRT framework
33                 RRTNode *(*nn)(
34 #if NNVERSION>1
35                                 std::vector<RRTNode *> (&nodes)[IYSIZE],
36 #else
37                                 std::vector<RRTNode *> &nodes,
38 #endif
39                                 RRTNode *node,
40                                 float (*cost)(RRTNode *, RRTNode *));
41                 RRTNode *(*sample)();
42                 std::vector<RRTNode *> (*steer)(
43                                 RRTNode *init,
44                                 RRTNode *goal);
45                 float (*cost)(RRTNode *init, RRTNode *goal);
46                 bool next();
47 };
48
49 class Kuwata2008: public RRTBase {
50         public:
51                 Kuwata2008(RRTNode *init, RRTNode *goal);
52
53                 // RRT framework
54                 RRTNode *(*nn)(
55 #if NNVERSION>1
56                                 std::vector<RRTNode *> (&nodes)[IYSIZE],
57 #else
58                                 std::vector<RRTNode *> &nodes,
59 #endif
60                                 RRTNode *node,
61                                 float (*cost)(RRTNode *, RRTNode *));
62                 RRTNode *(*sample)();
63                 std::vector<RRTNode *> (*steer)(
64                                 RRTNode *init,
65                                 RRTNode *goal);
66                 float (*cost)(RRTNode *init, RRTNode *goal);
67                 bool next();
68 };
69
70 class Karaman2011: public RRTBase {
71         public:
72                 Karaman2011(RRTNode *init, RRTNode *goal);
73
74                 // RRT framework
75                 RRTNode *(*nn)(
76 #if NNVERSION>1
77                                 std::vector<RRTNode *> (&nodes)[IYSIZE],
78 #else
79                                 std::vector<RRTNode *> &nodes,
80 #endif
81                                 RRTNode *node,
82                                 float (*cost)(RRTNode *, RRTNode *));
83                 std::vector<RRTNode *> (*nv)(
84                                 RRTNode *root,
85                                 RRTNode *node,
86                                 float (*cost)(RRTNode *, RRTNode *),
87                                 float dist);
88                 RRTNode *(*sample)();
89                 std::vector<RRTNode *> (*steer)(
90                                 RRTNode *init,
91                                 RRTNode *goal);
92                 float (*cost)(RRTNode *init, RRTNode *goal);
93                 bool next();
94 };
95
96 class T1: public RRTBase {
97         public:
98                 T1(RRTNode *init, RRTNode *goal);
99
100                 // RRT framework
101                 RRTNode *(*nn)(
102 #if NNVERSION>1
103                                 std::vector<RRTNode *> (&nodes)[IYSIZE],
104 #else
105                                 std::vector<RRTNode *> &nodes,
106 #endif
107                                 RRTNode *node,
108                                 float (*cost)(RRTNode *, RRTNode *));
109                 std::vector<RRTNode *> (*nv)(
110                                 RRTNode *root,
111                                 RRTNode *node,
112                                 float (*cost)(RRTNode *, RRTNode *),
113                                 float dist);
114                 RRTNode *(*sample)();
115                 std::vector<RRTNode *> (*steer)(
116                                 RRTNode *init,
117                                 RRTNode *goal);
118                 float (*cost)(RRTNode *init, RRTNode *goal);
119                 bool next();
120 };
121
122 #endif