{
RRTNode *t = &this->steered().front();
RRTNode *f = this->nn(this->samples().back());
- double cost = this->cost_search(*f, *t);
+ double cost = this->cost_build(*f, *t);
for (auto n: this->nv(*t)) {
if (
!std::get<0>(this->collide_two_nodes(*n, *t))
- && this->cost_search(*n, *t) < cost
+ && this->cost_build(*n, *t) < cost
) {
f = n;
- cost = this->cost_search(*n, *t);
+ cost = this->cost_build(*n, *t);
}
}
// steer from f->t and then continue with the steered.
for (auto n: this->nv(*f)) {
if (
!std::get<0>(this->collide_two_nodes(*f, *n))
- && cc(*f) + this->cost_search(*f, *n) < cc(*n)
+ && cc(*f) + this->cost_build(*f, *n) < cc(*n)
) {
+ this->tmp_steer(*f, *n);
+ if (this->tmp_steered_.size() > 0) {
+ auto col = this->collide_tmp_steered_from(*f);
+ if (std::get<0>(col))
+ continue;
+ this->join_tmp_steered(f);
+ f = &this->nodes().back();
+ }
n->p(f);
n->c(this->cost_build(*f, *n));
}