2 This file is part of I am car.
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.
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.
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/>.
29 RRTNode *root_ = nullptr;
30 RRTNode *goal_ = nullptr;
32 std::vector<RRTNode *> nodes_;
33 std::vector<RRTNode *> samples_;
34 std::vector<CircleObstacle> *cobstacles_;
35 std::vector<SegmentObstacle> *sobstacles_;
37 bool goal_found_ = false;
38 std::chrono::high_resolution_clock::time_point tstart_;
39 std::chrono::high_resolution_clock::time_point tend_;
41 std::vector<std::vector<RRTNode *>> tlog_; // trajectories
43 const float GOAL_FOUND_DISTANCE = 1;
44 const float GOAL_FOUND_ANGLE = 2 * M_PI;
45 const float TMAX = 100; // computation time limit
48 RRTBase(RRTNode *init, RRTNode *goal);
53 std::vector<RRTNode *> &nodes();
54 std::vector<RRTNode *> &samples();
55 std::vector<std::vector<RRTNode *>> &tlog();
60 bool tlog(std::vector<RRTNode *> t);
64 std::vector<CircleObstacle> *cobstacles,
65 std::vector<SegmentObstacle> *sobstacles);
70 float (*cost)(RRTNode *, RRTNode *));
71 bool collide(RRTNode *init, RRTNode *goal);