ompl::geometric::SPARS::SPARS(const base::SpaceInformationPtr &si) : base::Planner(si, "SPARS"), geomPath_(si), stateProperty_(boost::get(vertex_state_t(), g_)), sparseStateProperty_(boost::get(vertex_state_t(), s_)), sparseColorProperty_(boost::get(vertex_color_t(), s_)), representativesProperty_(boost::get(vertex_representative_t(), g_)), nonInterfaceListsProperty_(boost::get(vertex_list_t(), s_)), interfaceListsProperty_(boost::get(vertex_interface_list_t(), s_)), weightProperty_(boost::get(boost::edge_weight, g_)), sparseDJSets_(boost::get(boost::vertex_rank, s_), boost::get(boost::vertex_predecessor, s_)), consecutiveFailures_(0), iterations_(0), stretchFactor_(3.), maxFailures_(1000), addedSolution_(false), denseDeltaFraction_(.001), sparseDeltaFraction_(.25), denseDelta_(0.), sparseDelta_(0.) { specs_.recognizedGoal = base::GOAL_SAMPLEABLE_REGION; specs_.approximateSolutions = false; specs_.optimizingPaths = false; psimp_.reset(new PathSimplifier(si_)); psimp_->freeStates(false); Planner::declareParam<double>("stretch_factor", this, &SPARS::setStretchFactor, &SPARS::getStretchFactor, "1.1:0.1:3.0"); Planner::declareParam<double>("sparse_delta_fraction", this, &SPARS::setSparseDeltaFraction, &SPARS::getSparseDeltaFraction, "0.0:0.01:1.0"); Planner::declareParam<double>("dense_delta_fraction", this, &SPARS::setDenseDeltaFraction, &SPARS::getDenseDeltaFraction, "0.0:0.0001:0.1"); Planner::declareParam<unsigned int>("max_failures", this, &SPARS::setMaxFailures, &SPARS::getMaxFailures, "100:10:3000"); }
ompl::geometric::SPARS::SPARS(const base::SpaceInformationPtr &si) : base::Planner(si, "SPARS") , geomPath_(si) , stateProperty_(boost::get(vertex_state_t(), g_)) , sparseStateProperty_(boost::get(vertex_state_t(), s_)) , sparseColorProperty_(boost::get(vertex_color_t(), s_)) , representativesProperty_(boost::get(vertex_representative_t(), g_)) , nonInterfaceListsProperty_(boost::get(vertex_list_t(), s_)) , interfaceListsProperty_(boost::get(vertex_interface_list_t(), s_)) , weightProperty_(boost::get(boost::edge_weight, g_)) , sparseDJSets_(boost::get(boost::vertex_rank, s_), boost::get(boost::vertex_predecessor, s_)) , consecutiveFailures_(0) , stretchFactor_(3.) , maxFailures_(1000) , addedSolution_(false) , denseDeltaFraction_(.001) , sparseDeltaFraction_(.25) , denseDelta_(0.) , sparseDelta_(0.) , iterations_(0) , bestCost_(std::numeric_limits<double>::quiet_NaN()) { specs_.recognizedGoal = base::GOAL_SAMPLEABLE_REGION; specs_.approximateSolutions = false; specs_.optimizingPaths = true; specs_.multithreaded = true; psimp_ = std::make_shared<PathSimplifier>(si_); psimp_->freeStates(false); Planner::declareParam<double>("stretch_factor", this, &SPARS::setStretchFactor, &SPARS::getStretchFactor, "1.1:0.1:" "3.0"); Planner::declareParam<double>("sparse_delta_fraction", this, &SPARS::setSparseDeltaFraction, &SPARS::getSparseDeltaFraction, "0.0:0.01:1.0"); Planner::declareParam<double>("dense_delta_fraction", this, &SPARS::setDenseDeltaFraction, &SPARS::getDenseDeltaFraction, "0.0:0.0001:0.1"); Planner::declareParam<unsigned int>("max_failures", this, &SPARS::setMaxFailures, &SPARS::getMaxFailures, "100:10:" "3000"); addPlannerProgressProperty("iterations INTEGER", [this] { return getIterationCount(); }); addPlannerProgressProperty("best cost REAL", [this] { return getBestCost(); }); }