* radius.
*/
double mtr() const;
+
+ /*! \brief Return inner radius.
+ *
+ * The inner radius is the distance from minimum turning radius circle
+ * center to the nearest point on the car. In this case, the nearest
+ * points on the car are rear axle endpoints.
+ */
+ double iradi() const;
+
+ /*! \brief Return outer front radius.
+ *
+ * The outer front radius is the distance from minimum turning radius
+ * circle center to the farthest point on the front (from the rear axle
+ * view) part of the car.
+ */
+ double ofradi() const;
+
+ /*! \brief Return outer rear radius.
+ *
+ * The outer rear radius is the distance from minimum turning radius
+ * circle center to the farthest point on the rear (from the rear axle
+ * view) part of the car.
+ */
+ double orradi() const;
+
+ /*! \brief Return length of perfect parking slot.
+ *
+ * The width of the slot is the same as the width of the car.
+ *
+ * \see Simon R. Blackburn *The Geometry of Perfect Parking*
+ * \see https://www.ma.rhul.ac.uk/SRBparking
+ */
+ double perfect_parking_slot_len() const;
};
/*! Store car motion. */
bool drivable(PoseRange const& p) const;
bool drivable(Pose const& p) const;
- /*! \brief Return inner radius.
- *
- * The inner radius is the distance from minimum turning radius circle
- * center to the nearest point on the car. In this case, the nearest
- * points on the car are rear axle endpoints.
- */
- double iradi() const;
-
- /*! \brief Return outer front radius.
- *
- * The outer front radius is the distance from minimum turning radius
- * circle center to the farthest point on the front (from the rear axle
- * view) part of the car.
- */
- double ofradi() const;
-
- /*! \brief Return outer rear radius.
- *
- * The outer rear radius is the distance from minimum turning radius
- * circle center to the farthest point on the rear (from the rear axle
- * view) part of the car.
- */
- double orradi() const;
-
- /*! \brief Return length of perfect parking slot.
- *
- * The width of the slot is the same as the width of the car.
- *
- * \see Simon R. Blackburn *The Geometry of Perfect Parking*
- * \see https://www.ma.rhul.ac.uk/SRBparking
- */
- double perfect_parking_slot_len() const;
-
/*! Set maximum steering angle. */
void set_max_steer();
return sqrt(ctc2 - wb2) - this->w() / 2.0;
}
+double
+CarSize::iradi() const
+{
+ return this->mtr() - this->w() / 2;
+}
+
+double
+CarSize::ofradi() const
+{
+ auto mtrw2 = pow(this->mtr() + this->w() / 2.0, 2.0);
+ auto df2 = pow(this->df(), 2.0);
+ return sqrt(mtrw2 + df2);
+}
+
+double
+CarSize::orradi() const
+{
+ auto mtrw2 = pow(this->mtr() + this->w() / 2.0, 2.0);
+ auto dr2 = pow(this->dr(), 2.0);
+ return sqrt(mtrw2 + dr2);
+}
+
+double
+CarSize::perfect_parking_slot_len() const
+{
+ auto r = this->ctc() / 2.0;
+ auto l = this->wb();
+ auto k = this->df() - this->wb();
+ auto w = this->w();
+ auto r2l2 = r * r - l * l;
+ auto s = r2l2 + pow(l + k, 2.0) - pow(sqrt(r2l2) - w, 2.0);
+ return this->len() + sqrt(s) - l - k;
+}
+
double
CarMove::sp() const
{
return false;
}
-double
-BicycleCar::iradi() const
-{
- return this->mtr() - this->w() / 2;
-}
-
-double
-BicycleCar::ofradi() const
-{
- auto mtrw2 = pow(this->mtr() + this->w() / 2.0, 2.0);
- auto df2 = pow(this->df(), 2.0);
- return sqrt(mtrw2 + df2);
-}
-
-double
-BicycleCar::orradi() const
-{
- auto mtrw2 = pow(this->mtr() + this->w() / 2.0, 2.0);
- auto dr2 = pow(this->dr(), 2.0);
- return sqrt(mtrw2 + dr2);
-}
-
-double
-BicycleCar::perfect_parking_slot_len() const
-{
- auto r = this->ctc() / 2.0;
- auto l = this->wb();
- auto k = this->df() - this->wb();
- auto w = this->w();
- auto r2l2 = r * r - l * l;
- auto s = r2l2 + pow(l + k, 2.0) - pow(sqrt(r2l2) - w, 2.0);
- return this->len() + sqrt(s) - l - k;
-}
-
void
BicycleCar::set_max_steer()
{