]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blob - incl/rrtplanner.h
Add RRT* planner based or [Karaman2011] paper
[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 class LaValle1998: public RRTBase {
26         public:
27                 //using RRTBase::RRTBase;
28                 LaValle1998(RRTNode *init, RRTNode *goal);
29
30                 // RRT framework
31                 RRTNode *(*nn)(
32                                 RRTNode *root,
33                                 RRTNode *node,
34                                 float (*cost)(RRTNode *, RRTNode *));
35                 RRTNode *(*sample)();
36                 std::vector<RRTNode *> (*steer)(
37                                 RRTNode *init,
38                                 RRTNode *goal);
39                 float (*cost)(RRTNode *init, RRTNode *goal);
40                 bool next();
41 };
42
43 class Karaman2011: public RRTBase {
44         public:
45                 Karaman2011(RRTNode *init, RRTNode *goal);
46
47                 // RRT framework
48                 RRTNode *(*nn)(
49                                 RRTNode *root,
50                                 RRTNode *node,
51                                 float (*cost)(RRTNode *, RRTNode *));
52                 std::vector<RRTNode *> (*nv)(
53                                 RRTNode *root,
54                                 RRTNode *node,
55                                 float (*cost)(RRTNode *, RRTNode *),
56                                 float dist);
57                 RRTNode *(*sample)();
58                 std::vector<RRTNode *> (*steer)(
59                                 RRTNode *init,
60                                 RRTNode *goal);
61                 float (*cost)(RRTNode *init, RRTNode *goal);
62                 bool next();
63 };
64
65 #endif