]> rtime.felk.cvut.cz Git - hubacji1/rrts.git/commitdiff
Connect returns true
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 18 Sep 2019 11:33:46 +0000 (13:33 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 18 Sep 2019 11:33:48 +0000 (13:33 +0200)
Procedure `connect` is called form the `next` procedure only. Also, just
before `connect`, the collision is checked for the all of the `steered`
nodes. Therefore, there is no collision when `connect` is called.

src/rrts.cc

index 2c66246767b39a432c1eda26bde8b3756aa0388a..c09c59babb20414aa0ad9b71db048f851cc02427 100644 (file)
@@ -171,7 +171,6 @@ bool RRTS::goal_found(RRTNode &f)
 // RRT* procedures
 bool RRTS::connect()
 {
-        bool conn = false;
         RRTNode *t = &this->steered().front();
         RRTNode *f = this->nn(this->samples().back());
         double cost = this->cost_search(*f, *t);
@@ -188,8 +187,7 @@ bool RRTS::connect()
         t = &this->nodes().back();
         t->p(f);
         t->c(this->cost_build(*f, *t));
-        conn = true;
-        return conn;
+        return true;
 }
 
 void RRTS::rewire()