// log cost
for (j = 0; j < p.clog().size(); j++)
jvo["cost"][j] = p.clog()[j];
+ // log #nodes
+ for (j = 0; j < p.nlog().size(); j++)
+ jvo["node"][j] = p.nlog()[j];
// log seconds
for (j = 0; j < p.slog().size(); j++)
jvo["secs"][j] = p.slog()[j];
return this->clog_;
}
+std::vector<float> &RRTBase::nlog()
+{
+ return this->nlog_;
+}
+
std::vector<float> &RRTBase::slog()
{
return this->slog_;
duration<float>>(
std::chrono::high_resolution_clock::now() -
this->tstart_).count());
- this->tlog_.push_back(t);
this->clog_.push_back(this->goal_->ccost());
+ this->nlog_.push_back(this->nodes_.size());
+ this->tlog_.push_back(t);
return true;
}
std::chrono::high_resolution_clock::time_point tend_;
std::vector<float> clog_; // costs of trajectories
+ std::vector<float> nlog_; // #nodes of RRT
std::vector<float> slog_; // seconds of trajectories
std::vector<std::vector<RRTNode *>> tlog_; // trajectories
public:
std::vector<CircleObstacle> *cos();
std::vector<SegmentObstacle> *sos();
std::vector<float> &clog();
+ std::vector<float> &nlog();
std::vector<float> &slog();
std::vector<std::vector<RRTNode *>> &tlog();
bool goal_found();