6 /*! \brief Bicycle car basic class.
8 This class contains some geometrical computations of bicycle car.
10 \param x Horizontal coordinate of rear axle center.
11 \param y Vertical coordinate of rear axle center.
12 \param h Heading of the car.
13 \param mtr Minimum turning radius.
15 \param w The width of the car.
16 \param l The length of the car.
17 \param he The height of the car.
18 \param sd The safety distance.
19 \param df Distance from rear axle center to the front of the car.
20 \param dr Distance from rear axle center to the back of the car.
21 \param sp Speed of the car.
22 \param st Steering of the car.
30 // kinematic constraints
44 // kinematic constraints
45 /*! \brief Return `false` if `bc` is not achievable.
47 When `true` is returned the `bc` may still be not
48 achievable because in the current implementation,
49 heading is not considered.
51 \param[in] bc The bicycle car to achieve.
53 bool drivable(const BicycleCar &bc) const;
54 /*! \brief Return inner radius.
56 The inner radius is the distance from minimum turning
57 radius circle center to the nearest point on the car. In
58 this case, the nearest points on the car are rear axle
62 /*! \brief Return outer front radius.
64 The outer front radius is the distance from minimum
65 turning radius circle center to the farthest point on
66 the front (from the rear axle view) part of the car.
68 double ofradi() const;
69 /*! \brief Return outer rear radius.
71 The outer rear radius is the distance from minimum
72 turning radius circle center to the farthest point on
73 the rear (from the rear axle view) part of the car.
75 double orradi() const;
78 double lfx() const; double lfy() const;
79 double lrx() const; double lry() const;
80 double rrx() const; double rry() const;
81 double rfx() const; double rfy() const;
83 double ralx() const; double raly() const;
84 double rarx() const; double rary() const;
86 /*! \brief Min. turning radius circle center on left.
88 Important are coordinates `x` and `y`. The heading `h`
89 is set as the heading of `this->h()`.
91 BicycleCar ccl() const;
92 /*! \brief Min. turning radius circle center on rigth.
94 Important are coordinates `x` and `y`. The heading `h`
95 is set as the heading of `this->h()`.
97 BicycleCar ccr() const;
100 /*! \brief Next car position based on `sp` and `st`.
102 Where `sp` is speed and `st` is steering of the car.
107 double x() const { return this->x_; }
108 void x(double x) { this->x_ = x; }
110 double y() const { return this->y_; }
111 void y(double y) { this->y_ = y; }
113 double h() const { return this->h_; }
114 void h(double h) { this->h_ = h; }
116 double mtr() const { return this->mtr_; }
117 void mtr(double mtr) { this->mtr_ = mtr; }
119 double wb() const { return this->wb_; }
120 void wb(double wb) { this->wb_ = wb; }
122 double w() const { return this->w_; }
123 void w(double w) { this->w_ = w; }
125 double l() const { return this->l_; }
126 void l(double l) { this->l_ = l; }
128 double he() const { return this->he_; }
129 void he(double he) { this->he_ = he; }
131 double sd() const { return this->sd_; }
132 void sd(double sd) { this->sd_ = sd; }
134 double df() const { return this->df_; }
135 void df(double df) { this->df_ = df; }
137 double dr() const { return this->dr_; }
138 void dr(double dr) { this->dr_ = dr; }
140 double sp() const { return this->sp_; }
141 void sp(double sp) { this->sp_ = sp; }
143 double st() const { return this->st_; }
144 void st(double st) { this->st_ = st; }
147 friend std::ostream &operator<<(
152 out << "[" << bc.x();
153 out << "," << bc.y();
154 out << "," << bc.h();