+/*
+ * SPDX-FileCopyrightText: 2021 Jiri Vlasak <jiri.vlasak.2@cvut.cz>
+ *
+ * SPDX-License-Identifier: GPL-3.0-only
+ */
+
/*! \file */
#ifndef BCAR_BCAR_H
#define BCAR_BCAR_H
*/
bool on_right_side_of(Line const& li) const;
+ /*! \brief Translate self.
+ *
+ * \param p `Point` offset to translate by.
+ */
+ void translate(Point const& p);
+
/*! \brief Rotate self around the point.
\param c Rotation center `Point`.
/*! Get end point. */
Point e() const&;
+ /*! Get middle point. */
+ Point m() const;
+
/*! Get intersection point. */
Point i1() const&;
class PoseRange : public virtual Pose {
private:
- double e_ = 0.0;
- using Pose::h;
+ Pose bp_;
+ Pose ep_;
+ void set_xyh();
public:
+ PoseRange(Pose bp, Pose ep);
+ PoseRange(double x, double y, double b, double e);
+
+ Pose bp() const;
+ Pose ep() const;
+
/*! Get heading's begin in the interval [-pi, +pi] radians. */
double b() const;
- /*! Set heading's begin in radians. It's recomputed to [-pi, +pi]. */
- void b(double b);
-
/*! Get heading's end in the interval [-pi, +pi] radians. */
double e() const;
- /*! Set heading's end in radians. It's recomputed to [-pi, +pi]. */
- void e(double e);
-
+ void translate(Point const& p);
void rotate(Point const& c, double const angl);
-
void reflect(Line const& li);
friend std::ostream& operator<<(std::ostream& out, PoseRange const& p);
/*! \brief Store car size.
*
- * - Default is https://en.wikipedia.org/wiki/Fiat_Punto
+ * - The default is Renault ZOE (www.car.info)
*/
class CarSize {
private:
- double curb_to_curb_ = 10.820;
- double width_ = 1.625;
- double wheelbase_ = 2.450;
- double distance_to_front_ = 3.105;
- double length_ = 3.760;
+ double curb_to_curb_ = 10.802166641822163;
+ double width_ = 1.945; // including mirrors
+ double wheelbase_ = 2.588;
+ double distance_to_front_ = 3.427;
+ double length_ = 4.084;
+ double _front_track = 1.511;
public:
/*! Get curb-to-curb distance. */
double ctc() const;
/*! Get distance from rear axle to rear. */
double dr() const;
+ /*! Set front track. */
+ void ft(double ft);
+
+ /*! Get front track. */
+ double ft() const;
+
/*! \brief Get minimum turning radius.
*
* Please, note that the method returns really _minimum turning radius_,