]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Return false if trying to rebase on root/goal
authorJiri Hubacek <hubacji1@fel.cvut.cz>
Wed, 19 Sep 2018 12:35:11 +0000 (14:35 +0200)
committerJiri Hubacek <hubacji1@fel.cvut.cz>
Wed, 19 Sep 2018 13:49:43 +0000 (15:49 +0200)
base/rrtbase.cc

index 198e7a83341184efa61ca6aae4817569d6776598..6607fdf7486c1bc56930782e42072803daea0ac5 100644 (file)
@@ -332,6 +332,8 @@ bool RRTBase::collide(RRTNode *init, RRTNode *goal)
 
 bool RRTBase::rebase(RRTNode *nr)
 {
+        if (this->goal_ == nr || this->root_ == nr)
+                return false;
         std::vector<RRTNode *> s; // DFS stack
         RRTNode *tmp;
         unsigned int i = 0;