]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blobdiff - base/rrtbase.cc
Fix sampling when slot planner not used
[hubacji1/iamcar.git] / base / rrtbase.cc
index fcec42d5059c87b393dc37906e702995251bdd08..ad60cc550d52c73c109f44099f85b2fd6e582ef2 100644 (file)
@@ -867,6 +867,7 @@ std::vector<RRTNode *> RRTBase::findt(RRTNode *n)
 // RRT Framework
 RRTNode *RRTBase::sample()
 {
+#ifdef USE_SLOTPLANNER
         float x = this->samplingInfo_.x;
         float y = this->samplingInfo_.y;
         std::normal_distribution<float> xdist(
@@ -895,6 +896,9 @@ RRTNode *RRTBase::sample()
                 y,
                 this->samplingInfo_.sh + this->samplingInfo_.dh * h
         );
+#else
+        return sa1();
+#endif
 }
 
 float RRTBase::cost(RRTNode *init, RRTNode *goal)