]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Fix missing nearest neighbour version check
authorJiri Hubacek <hubacji1@fel.cvut.cz>
Thu, 20 Sep 2018 13:11:12 +0000 (15:11 +0200)
committerJiri Hubacek <hubacji1@fel.cvut.cz>
Thu, 20 Sep 2018 13:11:13 +0000 (15:11 +0200)
base/main.cc
base/rrtbase.cc

index 649e7b41f61da322b7addb4340934473f634c5db..8d2153711e1edef72adc4b4a9f711424cd75492f 100644 (file)
@@ -73,7 +73,11 @@ int main()
                         p.next();
                         p.tend();
                 }
+#if NNVERSION>0
                 nn = p.nn(p.iy_, p.goal(), p.cost);
+#else
+                nn = p.nn(p.nodes(), p.goal(), p.cost);
+#endif
                 tr = p.findt(nn);
                 p.tlog(tr);
 #if JSONLOGEDGES > 0
index d455a033057258e88600738ffefc08e8c0acf6ae..beeaa1f8f3b61a9e52f102c81425c91478fe3088 100644 (file)
@@ -367,6 +367,7 @@ bool RRTBase::rebase(RRTNode *nr)
                 }
                 if (to_del < this->nodes_.size())
                         this->nodes_.erase(this->nodes_.begin() + to_del);
+#if NNVERSION > 0
                 iy = floor(tmp->y() / IYSTEP);
                 to_del = this->iy_[iy].size();
                 #pragma omp parallel  for reduction(min: to_del)
@@ -376,6 +377,7 @@ bool RRTBase::rebase(RRTNode *nr)
                 }
                 if (to_del < this->iy_[iy].size())
                         this->iy_[iy].erase(this->iy_[iy].begin() + to_del);
+#endif
                 this->dnodes().push_back(tmp);
         }
         this->root_ = nr;