make
```
+To build with ninja:
+```
+mkdir build
+cd build
+cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ../
+ninja -v
+```
+
# RRT Extensions
There is basic RRT\* algorithm in `rrts.cc` file. To test different approaches
and upgrades to RRT, *extensions* are declared in `rrtext.h` and implemented in
collide_steered_from(RRTNode &f);
std::tuple<bool, unsigned int, unsigned int>
collide_two_nodes(RRTNode &f, RRTNode &t);
- double cost_build(RRTNode &f, RRTNode &t);
- double cost_search(RRTNode &f, RRTNode &t);
+ virtual double cost_build(RRTNode &f, RRTNode &t);
+ virtual double cost_search(RRTNode &f, RRTNode &t);
void sample();
std::default_random_engine gen_;
std::normal_distribution<double> ndx_;
);
// getters, setters
+ unsigned int icnt() const { return this->icnt_; }
std::vector<RRTNode> &goals() { return this->goals_; }
std::vector<RRTNode> &nodes() { return this->nodes_; }
std::vector<Obstacle> &obstacles() { return this->obstacles_; }
// RRT* procedures
bool RRTS::connect()
{
- bool conn = false;
RRTNode *t = &this->steered().front();
RRTNode *f = this->nn(this->samples().back());
double cost = this->cost_search(*f, *t);
t = &this->nodes().back();
t->p(f);
t->c(this->cost_build(*f, *t));
- conn = true;
- return conn;
+ return true;
}
void RRTS::rewire()
bool RRTS::next()
{
bool next = true;
- this->icnt_++;
+ if (++this->icnt_ > 999)
+ next = false;
this->sample();
this->steer(
*this->nn(this->samples().back()),
next = !this->goal_found(this->nodes().back());
just_added = just_added->p();
}
- if (this->icnt_ > 999)
- next = false;
return next;
}