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/>.
24 #define MAXSTEER(wb, tr) ((wb) / (tr))
26 class BicycleCar: public RRTNode {
28 // see https://en.wikipedia.org/wiki/Fiat_Punto
29 const float height_ = 1.450;
30 const float length_ = 3.760;
31 const float safety_dist_ = 0;
32 const float turning_radius_ = 10.82;
33 const float wheel_base_ = 2.450;
34 const float width_ = 1.625;
39 using RRTNode::RRTNode;
59 /** Return circle center on the left side of the car */
61 /** Return circle center on the right side of the car */
72 std::vector<RRTEdge *> frame();
74 bool next(float speed, float steer);
76 /** Outer radius of the farthest point */
78 /** Angle between wheelbase line and outer radius */
80 /** Return true if `n` not inside of `ccl`, `ccr` */
81 bool drivable(RRTNode *n);
82 /** Return node rotated by `dh` around `c` */
83 BicycleCar *move(RRTNode *c, float dh);