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/>.
26 virtual bool collide(RRTNode *n) = 0;
27 virtual bool collide(RRTEdge *e) = 0;
28 virtual bool collide(std::vector<RRTEdge *> &lines) = 0;
29 virtual float dist_to(RRTNode *n) = 0;
32 class CircleObstacle : public RRTNode, Obstacle {
34 using RRTNode::RRTNode;
36 bool collide(RRTNode *n);
37 bool collide(RRTEdge *e);
38 bool collide(std::vector<RRTEdge *> &edges);
39 float dist_to(RRTNode *n);
42 class PolygonObstacle : public Obstacle {
44 std::vector<RRTNode *> bnodes_;
46 void add_bnode(RRTNode *n);
47 bool collide(RRTNode *n);
48 bool collide(RRTEdge *e);
49 bool collide(std::vector<RRTEdge *> &edges);
50 bool collide(std::vector<RRTEdge *> edges);
51 float dist_to(RRTNode *n);
52 std::vector<RRTEdge *> frame();
55 std::vector<RRTNode *> &bnodes();
58 class SegmentObstacle : public RRTEdge, Obstacle {
60 using RRTEdge::RRTEdge;
61 bool collide(RRTNode *n);
62 bool collide(RRTEdge *e);
63 bool collide(std::vector<RRTEdge *> &edges);
64 float dist_to(RRTNode *n);