]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
Add start and goal setters
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 31 May 2022 15:02:00 +0000 (17:02 +0200)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Tue, 31 May 2022 15:02:09 +0000 (17:02 +0200)
incl/rrts.hh
src/rrts.cc

index d4f4719aca9026f3eb847a121348d44df927040c..7b730c1af6dbb5fc02db93781ea2293c8ab082af 100644 (file)
@@ -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;
 
index 8e175a27ff787335c10337175a3c24c498c6bd7f..46f289eb2b08f68ae69893e70f7a68895b01409f 100644 (file)
@@ -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
 {