]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Fix sampling when slot planner not used
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Sun, 31 Mar 2019 11:30:21 +0000 (13:30 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Sun, 31 Mar 2019 11:30:21 +0000 (13:30 +0200)
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)