From: Jiri Vlasak Date: Tue, 31 May 2022 15:02:00 +0000 (+0200) Subject: Add start and goal setters X-Git-Tag: v0.10.0~1 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/hubacji1/rrts.git/commitdiff_plain/1bb72bb7ef47a143ce507e982730a08e0cbdd638?ds=sidebyside Add start and goal setters --- diff --git a/incl/rrts.hh b/incl/rrts.hh index d4f4719..7b730c1 100644 --- a/incl/rrts.hh +++ b/incl/rrts.hh @@ -114,6 +114,12 @@ public: /*! Set maximum number of iterations before reset. */ void set_imax_reset(unsigned int i); + /*! Set goal. */ + void set_goal(double x, double y, double b, double e); + + /*! Set start. */ + void set_start(double x, double y, double h); + /*! Get iterations counter. */ unsigned int icnt() const; diff --git a/src/rrts.cc b/src/rrts.cc index 8e175a2..46f289e 100644 --- a/src/rrts.cc +++ b/src/rrts.cc @@ -278,6 +278,20 @@ RRTS::set_imax_reset(unsigned int i) this->_imax = i; } +void +RRTS::set_goal(double x, double y, double b, double e) +{ + this->goal_ = RRTGoal(x, y, b, e); +} + +void +RRTS::set_start(double x, double y, double h) +{ + this->nodes_.front().x(x); + this->nodes_.front().y(y); + this->nodes_.front().h(h); +} + unsigned int RRTS::icnt() const {