From d9290161b96d39eae84a82ba4853bd3af37f4170 Mon Sep 17 00:00:00 2001 From: Toefinder <43576719+Toefinder@users.noreply.github.com> Date: Sat, 2 Jul 2022 22:48:15 +0200 Subject: [PATCH] [SPF] Only set timeout innerPlanner if more than 0 The default timeout for innerPlanner is a positive value. However, if the user specifically sets it to be 0, the timeout will not be set and hence timeout will not be used to stop innerPlanner (default timeout in PathPlanner is infinity). --- src/path-planner/states-path-finder.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/path-planner/states-path-finder.cc b/src/path-planner/states-path-finder.cc index 6e8d4bf4..1dfa804c 100644 --- a/src/path-planner/states-path-finder.cc +++ b/src/path-planner/states-path-finder.cc @@ -1497,8 +1497,12 @@ namespace hpp { (core::DiffusingPlanner::create(inStateProblem_)); inStatePlanner->maxIterations(problem_->getParameter ("StatesPathFinder/innerPlannerMaxIterations").intValue()); - inStatePlanner->timeOut(problem_->getParameter - ("StatesPathFinder/innerPlannerTimeOut").floatValue()); + value_type innerPlannerTimeout = problem_->getParameter + ("StatesPathFinder/innerPlannerTimeOut").floatValue(); + // only set timeout if it is more than 0. default is infinity + if (innerPlannerTimeout > 0.) { + inStatePlanner->timeOut(innerPlannerTimeout); + } hppDout(info, "calling InStatePlanner_.solve for transition " << idxConfigList_); core::PathVectorPtr_t path; @@ -1615,7 +1619,9 @@ namespace hpp { "StatesPathFinder/innerPlannerTimeOut", "This will set ::timeOut accordingly in the inner" "planner used for building a path after intermediate" - "configurations have been found", + "configurations have been found." + "If set to 0, no timeout: only maxIterations will be used to stop" + "the innerPlanner if it does not find a path.", Parameter(2.0))); core::Problem::declareParameter(ParameterDescription(Parameter::INT, "StatesPathFinder/innerPlannerMaxIterations", -- GitLab