if (!this->connect())
return next;
this->rewire();
+ unsigned scnt = this->steered().size();
this->steered().erase(this->steered().begin());
while (this->steered().size() > 0) {
RRTNode *f = &this->nodes().back();
t->c(this->cost(*f, *t));
this->steered().erase(this->steered().begin());
}
+ RRTNode *just_added = &this->nodes().back();
+ while (scnt > 0) {
+ scnt--;
+ for (auto &g: this->goals()) {
+ this->steer(*just_added, g);
+ if (this->collide_steered_from(*just_added))
+ continue;
+ RRTNode *f = just_added;
+ while (this->steered().size() > 0) {
+ RRTNode s = this->steered().front();
+ this->nodes().push_back(s);
+ RRTNode *t = &this->nodes().back();
+ t->p(f);
+ t->c(this->cost(*f, *t));
+ this->steered().erase(this->steered().begin());
+ f = t;
+ }
+ }
+ just_added = just_added->p();
+ }
for (auto &g: this->goals()) {
double cost = this->cost(this->nodes().back(), g);
double edist = sqrt(