]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Inherit pose from point
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 14 Jul 2021 20:53:24 +0000 (22:53 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 14 Jul 2021 20:53:24 +0000 (22:53 +0200)
incl/bcar.hh
src/bcar.cc

index 9f5017ecc8e8b97eeac4d9de792f2426f04c5d06..1e0b61bf2c1de59076729a28dac3324a26f7eaf2 100644 (file)
@@ -103,23 +103,12 @@ public:
 };
 
 /*! Store coordinates `x`, `y`, and heading `h`. */
-class Pose {
+class Pose : public Point {
 private:
-       double x_ = 0.0;
-       double y_ = 0.0;
        double h_ = 0.0;
 public:
-       /*! Get horizontal coordinate. */
-       double x() const;
-
-       /*! Set horizontal coordinate. */
-       void x(double x);
-
-       /*! Get vertical coordinate. */
-       double y() const;
-
-       /*! Set vertical coordinate. */
-       void y(double y);
+       Pose(double x, double y, double h);
+       Pose();
 
        /*! Get heading in the interval [-pi, +pi] radians. */
        double h() const;
index 44a593a1e2ba56db352dfb25ff8b691753f30150..75f220c9d3668c1462eeb49af00e9c3dcf2ed7ed 100644 (file)
@@ -191,28 +191,12 @@ Line::is_on_right_side(Point const& p) const
        }
 }
 
-double
-Pose::x() const
-{
-       return this->x_;
-}
-
-void
-Pose::x(double x)
-{
-       this->x_ = x;
-}
-
-double
-Pose::y() const
+Pose::Pose() : Point()
 {
-       return this->y_;
 }
 
-void
-Pose::y(double y)
+Pose::Pose(double x, double y, double h) : Point(x, y), h_(h)
 {
-       this->y_ = y;
 }
 
 double