]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - incl/bcar.hh
Refactor and rename due to consistency
[hubacji1/bcar.git] / incl / bcar.hh
index ad33a7ddaf4410546fc288390f49b852e04def13..1ca3a7a0306dd52791546bee5c21abbe651e5351 100644 (file)
@@ -18,8 +18,8 @@ private:
        double x_ = 0.0;
        double y_ = 0.0;
 public:
-       Point(double x, double y);
        Point();
+       Point(double x, double y);
 
        /*! Get horizontal coordinate. */
        double x() const;
@@ -51,8 +51,8 @@ public:
 
        /*! \brief Return `true` if on the right side of the plane.
         *
-        * The plane is given by the line `li`, where `li->fp()` is the base
-        * point and the direction is given by `li->lp() - li->fp()`.
+        * The plane is given by the line `li`, where `li->b()` is the base
+        * point and the direction is given by `li->e() - li->b()`.
         *
         * \param li The plane to consider is given by `li`.
         */
@@ -73,29 +73,29 @@ public:
 
 class Line {
 private:
-       Point first;
-       Point last;
-       Point intersection1;
-       Point intersection2;
+       Point b_;
+       Point e_;
+       Point i1_;
+       Point i2_;
 public:
        Line(Point const& fp, Point const& lp);
 
-       /*! Get first point. */
-       Point fp() const&;
+       /*! Get beginning point. */
+       Point b() const&;
 
-       /*! Get last point. */
-       Point lp() const&;
+       /*! Get end point. */
+       Point e() const&;
 
        /*! Get intersection point. */
-       Point in1() const&;
+       Point i1() const&;
 
        /*! Get intersection point. */
-       Point in2() const&;
+       Point i2() const&;
 
        /*! \brief Return if `this` line intersects with line `li`.
         *
         * If the method returns `true`, the intersection `Point` is available
-        * in `this->in1()`.
+        * in `this->i1()`.
         *
         * \see https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection
         *
@@ -106,7 +106,7 @@ public:
        /*! \brief Return intersections of `this` (infinite) line and circle.
         *
         * If the method returns `true`, the intersection `Point`s are available
-        * in `this->in1()` and `this->in2()`.
+        * in `this->i1()` and `this->i2()`.
         *
         * \see https://mathworld.wolfram.com/Circle-LineIntersection.html
         *
@@ -125,8 +125,8 @@ class Pose : public virtual Point {
 private:
        double h_ = 0.0;
 public:
+       using Point::Point;
        Pose(double x, double y, double h);
-       Pose();
 
        /*! Get heading in the interval [-pi, +pi] radians. */
        double h() const;
@@ -170,11 +170,11 @@ public:
  */
 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.820;
+       double width_ = 1.625;
+       double wheelbase_ = 2.450;
+       double distance_to_front_ = 3.105;
+       double length_ = 3.760;
 public:
        /*! Get curb-to-curb distance. */
        double ctc() const;
@@ -212,7 +212,7 @@ public:
        /*! \brief Get minimum turning radius.
         *
         * Please, note that the method returns really _minimum turning radius_,
-        * which is the distance from the reare axle center to the center of
+        * which is the distance from the rear axle center to the center of
         * left or right rotation given by the kinematics constrants, i.e.
         * _wheelbase_ and _curb-to-curb_ distance.
         *
@@ -259,8 +259,8 @@ public:
 /*! Store car motion. */
 class CarMove {
 private:
-       double speed = 0.0;
-       double steer = 0.0;
+       double speed_ = 0.0;
+       double steer_ = 0.0;
 public:
        /*! Get speed. */
        double sp() const;