]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Fix find trajectory return if no path
authorJiri Hubacek <hubacji1@fel.cvut.cz>
Thu, 5 Jul 2018 07:45:14 +0000 (09:45 +0200)
committerJiri Hubacek <hubacji1@fel.cvut.cz>
Thu, 5 Jul 2018 07:45:14 +0000 (09:45 +0200)
base/rrtbase.cc

index 29b3cecf4d9439607b1a2c7c4503b1c2c9311c4c..779c19d520d45a00e7377341a48fe0d617bfad70 100644 (file)
@@ -208,6 +208,8 @@ bool RRTBase::collide(RRTNode *init, RRTNode *goal)
 std::vector<RRTNode *> RRTBase::findt()
 {
         std::vector<RRTNode *> nodes;
+        if (!this->goal_->parent())
+                return nodes;
         RRTNode *tmp = this->goal_;
         while (tmp != this->root_) {
                 nodes.push_back(tmp);