From: Jiri Vlasak Date: Thu, 16 Mar 2023 13:32:49 +0000 (+0100) Subject: Rename set init pose to method X-Git-Url: https://rtime.felk.cvut.cz/gitweb/hubacji1/iamcar2.git/commitdiff_plain/113598e3b327a0849065cbc3fd30f6c5b24cb548 Rename set init pose to method --- diff --git a/rrts/incl/rrts.hh b/rrts/incl/rrts.hh index 6bab6ae..6f66e7a 100644 --- a/rrts/incl/rrts.hh +++ b/rrts/incl/rrts.hh @@ -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 path() const; diff --git a/rrts/src/rrts.cc b/rrts/src/rrts.cc index 4f13114..2c58e49 100644 --- a/rrts/src/rrts.cc +++ b/rrts/src/rrts.cc @@ -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 @@ -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(),