bool Klemm2015::next()
{
+ RRTNode *xn = nullptr;
+ RRTNode *rs;
+#if GOALFIRST > 0
+ if (this->samples().size() == 0)
+ rs = this->goal();
+ else
+ rs = this->sample();
+#else
+ rs = this->sample();
+#endif
+ this->samples().push_back(rs);
+ //std::cerr << "next" << std::endl;
+ if (this->extendstar1(rs, &xn) != 2) {
+ // if (xn) {
+ // std::cerr << "- xn: " << xn->x() << ", " << xn->y();
+ // std::cerr << std::endl;
+ // } else {
+ // std::cerr << "- xn: nullptr" << std::endl;
+ // }
+ this->swap();
+ this->connectstar(xn);
+ } else {
+ this->swap();
+ }
return this->goal_found();
}