- Near vertices `nv2` procedure based on indexing over `y` axis.
- OpenMP parallelization of nearest neighbour and near vertices procedures.
- Rebase method that changes (rebases) RRT root to another RRT node.
+- Structure and method for logging tree edges.
### Changed
- Build with Ninja.
for (auto s: this->samples_)
if (s != this->goal_)
delete s;
+ for (auto edges: this->rlog_)
+ for (auto e: edges)
+ delete e;
delete this->root_;
delete this->goal_;
}
return this->nlog_;
}
+std::vector<std::vector<RRTEdge *>> &RRTBase::rlog()
+{
+ return this->rlog_;
+}
+
std::vector<float> &RRTBase::slog()
{
return this->slog_;
return dt.count();
}
+bool RRTBase::logr(RRTNode *root)
+{
+ std::vector<RRTEdge *> e; // Edges to log
+ std::vector<RRTNode *> s; // DFS stack
+ std::vector<RRTNode *> r; // reset visited_
+ RRTNode *tmp;
+ s.push_back(root);
+ while (s.size() > 0) {
+ tmp = s.back();
+ s.pop_back();
+ if (!tmp->visit()) {
+ r.push_back(tmp);
+ for (auto ch: tmp->children()) {
+ s.push_back(ch);
+ e.push_back(new RRTEdge(tmp, ch));
+ }
+ }
+ }
+ this->rlog_.push_back(e);
+ return true;
+}
+
bool RRTBase::tlog(std::vector<RRTNode *> t)
{
this->slog_.push_back(this->elapsed());
std::vector<float> clog_; // costs of trajectories
std::vector<float> nlog_; // #nodes of RRT
+ std::vector<std::vector<RRTEdge *>> rlog_; // log tree starting at root
std::vector<float> slog_; // seconds of trajectories
std::vector<std::vector<RRTNode *>> tlog_; // trajectories
public:
std::vector<SegmentObstacle> *sos();
std::vector<float> &clog();
std::vector<float> &nlog();
+ std::vector<std::vector<RRTEdge *>> &rlog();
std::vector<float> &slog();
std::vector<std::vector<RRTNode *>> &tlog();
bool goal_found();
float elapsed();
// setter
+ bool logr(RRTNode *root);
bool tlog(std::vector<RRTNode *> t);
void tstart();
void tend();