if (this->goals().size() == 0)
return path;
RRTNode *goal = &this->goals().front();
- for (auto &n: this->goals()) {
- if (
- n.p() != nullptr
- && (n.c() < goal->c() || goal->p() == nullptr)
- ) {
- goal = &n;
- }
- }
if (goal->p() == nullptr)
return path;
while (goal != nullptr) {