#include <cassert>
#include "rrts.hh"
+#ifndef USE_RRTS
+#define USE_RRTS 0 // TODO improve, this solution isn't clear.
+#endif
+
namespace rrts {
void
{
RRTNode* f = this->nn_;
RRTNode* t = &this->steered_.front();
+#if USE_RRTS
double cost = f->cc() + this->cost_build(*f, *t);
for (auto n: this->nv_) {
double nc = n->cc() + this->cost_build(*n, *t);
if (!this->bc_.drivable(*t)) {
f = this->nn_;
}
+#endif
this->store(this->steered_.front());
t = &this->nodes_.back();
t->p(*f);
if (this->collide_steered()) {
return this->should_continue();
}
+#if USE_RRTS
this->find_nv(this->steered_.front());
+#endif
if (!this->connect()) {
return this->should_continue();
}
+#if USE_RRTS
this->rewire();
+#endif
unsigned int ss = this->steered_.size();
this->join_steered(&this->nodes_.back());
RRTNode* just_added = &this->nodes_.back();