Commit bfb460d0 authored by florent's avatar florent
Browse files

In ChppPlanner::solveOneProblem, if path is null after calling rdmBuilder return KD_ERROR.

This should be useless since rdmBuilder already returns KD_OK or KD_ERROR, but two tests
are better than one.
parent ecf5726b
42. In ChppPlanner::solveOneProblem, if path is null after calling rdmBuilder return KD_ERROR.
41. Added a method to interrupt the roadmap builder during path planning process. 41. Added a method to interrupt the roadmap builder during path planning process.
hppCore 1.4 released June 13, 2008 hppCore 1.4 released June 13, 2008
......
...@@ -287,7 +287,9 @@ ktStatus ChppPlanner::roadmapBuilderIthProblem(unsigned int rank, ...@@ -287,7 +287,9 @@ ktStatus ChppPlanner::roadmapBuilderIthProblem(unsigned int rank,
/* /*
Add an interruption delegate to the roadmap builder Add an interruption delegate to the roadmap builder
*/ */
#if 0
inRoadmapBuilder->addDelegate(attStopRdmBuilderDelegate); inRoadmapBuilder->addDelegate(attStopRdmBuilderDelegate);
#endif
ChppProblem& hppProblem = hppProblemVector[rank]; ChppProblem& hppProblem = hppProblemVector[rank];
hppProblem.roadmapBuilder(inRoadmapBuilder); hppProblem.roadmapBuilder(inRoadmapBuilder);
...@@ -551,6 +553,12 @@ ktStatus ChppPlanner::solveOneProblem(unsigned int problemId) ...@@ -551,6 +553,12 @@ ktStatus ChppPlanner::solveOneProblem(unsigned int problemId)
return KD_ERROR; return KD_ERROR;
} }
if (!kwsPath) {
ODEBUG1(":solveOneProblem: no path after successfully solving the problem");
ODEBUG1(":solveOneProblem: this should not happen.");
return KD_ERROR;
}
// optimizer for the path // optimizer for the path
if (hppProblem.pathOptimizer()) { if (hppProblem.pathOptimizer()) {
hppProblem.pathOptimizer()->optimizePath(kwsPath, hppProblem.roadmapBuilder()->penetration()); hppProblem.pathOptimizer()->optimizePath(kwsPath, hppProblem.roadmapBuilder()->penetration());
...@@ -562,10 +570,11 @@ ktStatus ChppPlanner::solveOneProblem(unsigned int problemId) ...@@ -562,10 +570,11 @@ ktStatus ChppPlanner::solveOneProblem(unsigned int problemId)
ODEBUG1(":solveOneProblem: no Optimizer Defined "); ODEBUG1(":solveOneProblem: no Optimizer Defined ");
} }
ODEBUG2(":solveOneProblem: number of direct path: "<<kwsPath->countDirectPaths()); if (kwsPath) {
ODEBUG2(":solveOneProblem: number of direct path: "<<kwsPath->countDirectPaths());
// Add the path to vector of paths of the problem. // Add the path to vector of paths of the problem.
hppProblem.addPath(kwsPath); hppProblem.addPath(kwsPath);
}
} else { } else {
ODEBUG1(":solveOneProblem: no roadmap builder"); ODEBUG1(":solveOneProblem: no roadmap builder");
return KD_ERROR ; return KD_ERROR ;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment