From 1bb72bb7ef47a143ce507e982730a08e0cbdd638 Mon Sep 17 00:00:00 2001 From: Jiri Vlasak Date: Tue, 31 May 2022 17:02:00 +0200 Subject: [PATCH] Add start and goal setters --- incl/rrts.hh | 6 ++++++ src/rrts.cc | 14 ++++++++++++++ 2 files changed, 20 insertions(+) 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 { -- 2.39.2