]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/commitdiff
Rename set init pose to method
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 16 Mar 2023 13:32:49 +0000 (14:32 +0100)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 16 Mar 2023 13:32:49 +0000 (14:32 +0100)
rrts/incl/rrts.hh
rrts/src/rrts.cc

index 6bab6ae71f6fadd06e2bf63e36a34a9e57933da1..6f66e7a679a721546d09665d5f47c346d4aa0c34 100644 (file)
@@ -149,8 +149,8 @@ public:
        /*! Return elapsed time. */
        double scnt() const;
 
-       /*! Set start. */
-       void start(double x, double y, double h);
+       /*! Set init pose. */
+       void set_init_pose_to(Pose const& p);
 
        /*! Get path. */
        std::vector<Pose> path() const;
index 4f131145c63ae19c45cdf7cd5c38a7334b04ccc0..2c58e49c9e29efb7d61cfb7ad241cdd359da6747 100644 (file)
@@ -328,11 +328,11 @@ RRTS::scnt() const
 }
 
 void
-RRTS::start(double x, double y, double h)
+RRTS::set_init_pose_to(Pose const& p)
 {
-       this->_nodes.front().x(x);
-       this->_nodes.front().y(y);
-       this->_nodes.front().h(h);
+       this->_nodes.front().x(p.x());
+       this->_nodes.front().y(p.y());
+       this->_nodes.front().h(p.h());
 }
 
 std::vector<Pose>
@@ -418,10 +418,10 @@ RRTS::json(Json::Value jvi)
 {
        assert(jvi["init"] != Json::nullValue);
        assert(jvi["goal"] != Json::nullValue);
-       this->start(
+       this->set_init_pose_to(Pose(
                jvi["init"][0].asDouble(),
                jvi["init"][1].asDouble(),
-               jvi["init"][2].asDouble());
+               jvi["init"][2].asDouble()));
        if (jvi["goal"].size() == 4) {
                this->goal(
                        jvi["goal"][0].asDouble(),