]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Add set pose method
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Wed, 14 Jul 2021 12:37:56 +0000 (14:37 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 14 Jul 2021 15:52:34 +0000 (17:52 +0200)
incl/bcar.hh
src/bcar.cc

index 9f7a3697d06efb2b5756f59c7c500234af7158aa..9f5017ecc8e8b97eeac4d9de792f2426f04c5d06 100644 (file)
@@ -127,6 +127,9 @@ public:
        /*! Set heading in radians. It's recomputed to [-pi, +pi]. */
        void h(double h);
 
+       /*! Set pose (`x`, `y`, and `h`.) */
+       void set_pose(Pose const& p);
+
        /*! \brief Rotate self around the point.
 
        \param c Rotation center `Point`.
index ef7300e2ecdee573a3d951dab061b3a0f387b392..44a593a1e2ba56db352dfb25ff8b691753f30150 100644 (file)
@@ -233,6 +233,14 @@ Pose::h(double h)
        this->h_ = h;
 }
 
+void
+Pose::set_pose(Pose const& p)
+{
+       this->x(p.x());
+       this->y(p.y());
+       this->h(p.h());
+}
+
 void
 Pose::rotate(Point const& c, double const angl)
 {