double log_path_time_ = 0.1;
unsigned int log_path_iter_ = 20;
std::vector<double> log_path_cost_;
+ std::vector<double> log_opt_time_;
/*! \brief Update and return elapsed time.
*/
std::vector<RRTNode *> RRTExt3::path()
{
+ auto tstart = std::chrono::high_resolution_clock::now();
this->first_optimized_path_ = this->first_path_optimization();
if (this->first_optimized_path_.size() > 0)
this->first_optimized_path_cost(
);
else
return this->orig_path();
- return this->second_path_optimization();
+ auto opt2 = this->second_path_optimization();
+ auto tend = std::chrono::high_resolution_clock::now();
+ auto tdiff = std::chrono::duration_cast<std::chrono::duration<double>>(
+ tend - tstart);
+ this->log_opt_time_.push_back(tdiff.count());
+ return opt2;
}
Json::Value RRTExt3::json()
for (auto i: this->log_path_cost_)
jvo["log_path_cost"][cnt++] = i;
}
+ {
+ unsigned int cnt = 0;
+ for (auto i: this->log_opt_time_)
+ jvo["log_opt_time"][cnt++] = i;
+ }
//{
// unsigned int ncnt = 0;
// for (auto n: this->nodes()) {