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