}
std::vector<RRTNode *> RRTBase::findt()
+{
+ return this->findt(this->goal_);
+}
+
+std::vector<RRTNode *> RRTBase::findt(RRTNode *n)
{
std::vector<RRTNode *> nodes;
- if (!this->goal_->parent())
+ if (!n->parent())
return nodes;
- RRTNode *tmp = this->goal_;
+ RRTNode *tmp = n;
while (tmp != this->root_) {
nodes.push_back(tmp);
if (!tmp->parent())
float (*cost)(RRTNode *, RRTNode *));
bool collide(RRTNode *init, RRTNode *goal);
std::vector<RRTNode *> findt();
+ std::vector<RRTNode *> findt(RRTNode *n);
// virtuals - implemented by child classes
virtual bool next() = 0;