};
/*! 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;
}
}
-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