Skip to content
Snippets Groups Projects
Commit 4f9cd9dd authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

ManipulationPlanner use pathProjector::Progressive instead of Dichotomy.

parent 5c975724
Branches
Tags
No related merge requests found
...@@ -86,14 +86,15 @@ namespace hpp { ...@@ -86,14 +86,15 @@ namespace hpp {
PROJECTION, PROJECTION,
STEERING_METHOD, STEERING_METHOD,
PATH_VALIDATION, PATH_VALIDATION,
PATH_PROJECTION PATH_PROJECTION_SHORTER,
PATH_PROJECTION_ZERO
}; };
struct Reasons { struct Reasons {
typedef ::hpp::statistics::SuccessBin::Reason Reason; typedef ::hpp::statistics::SuccessBin::Reason Reason;
Reason projFailed, smFailed, pvFailed, pprojFailed; Reason projFailed, smFailed, pvFailed, pprojShorter, pprojZero;
Reasons (const Reason& proj, const Reason& sm, const Reason& pv, const Reason& pp) : Reasons (const Reason& proj, const Reason& sm, const Reason& pv, const Reason& pps, const Reason& ppz) :
projFailed (proj), smFailed (sm), pvFailed (pv), pprojFailed (pp) {} projFailed (proj), smFailed (sm), pvFailed (pv), pprojShorter (pps), pprojZero (ppz) {}
const Reason& get (TypeOfFailure t) const Reason& get (TypeOfFailure t)
{ {
switch (t) { switch (t) {
...@@ -103,8 +104,10 @@ namespace hpp { ...@@ -103,8 +104,10 @@ namespace hpp {
return smFailed; return smFailed;
case PATH_VALIDATION: case PATH_VALIDATION:
return pvFailed; return pvFailed;
case PATH_PROJECTION: case PATH_PROJECTION_SHORTER:
return pprojFailed; return pprojShorter;
case PATH_PROJECTION_ZERO:
return pprojZero;
} }
return ::hpp::statistics::SuccessBin::REASON_UNKNOWN; return ::hpp::statistics::SuccessBin::REASON_UNKNOWN;
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "hpp/manipulation/problem.hh" #include "hpp/manipulation/problem.hh"
#include "hpp/manipulation/path-projector.hh" #include "hpp/manipulation/path-projector.hh"
#include "hpp/manipulation/path-projector/dichotomy.hh" #include "hpp/manipulation/path-projector/dichotomy.hh"
#include "hpp/manipulation/path-projector/progressive.hh"
#include "hpp/manipulation/manipulation-planner.hh" #include "hpp/manipulation/manipulation-planner.hh"
#include "hpp/manipulation/graph/edge.hh" #include "hpp/manipulation/graph/edge.hh"
...@@ -52,7 +53,6 @@ namespace hpp { ...@@ -52,7 +53,6 @@ namespace hpp {
return false; return false;
} }
void ManipulationPlanner::oneStep () void ManipulationPlanner::oneStep ()
{ {
RobotPtr_t robot = HPP_DYNAMIC_PTR_CAST(Robot, problem ().robot ()); RobotPtr_t robot = HPP_DYNAMIC_PTR_CAST(Robot, problem ().robot ());
...@@ -120,8 +120,11 @@ namespace hpp { ...@@ -120,8 +120,11 @@ namespace hpp {
} }
core::PathPtr_t projPath; core::PathPtr_t projPath;
if (!pathProjector_->apply (path, projPath)) { if (!pathProjector_->apply (path, projPath)) {
addFailure (PATH_PROJECTION, edge); if (!projPath || projPath->length () == 0) {
if (!projPath || projPath->length () == 0) return false; addFailure (PATH_PROJECTION_ZERO, edge);
return false;
}
addFailure (PATH_PROJECTION_SHORTER, edge);
} }
GraphPathValidationPtr_t pathValidation (problem_.pathValidation ()); GraphPathValidationPtr_t pathValidation (problem_.pathValidation ());
pathValidation->validate (projPath, false, validPath); pathValidation->validate (projPath, false, validPath);
...@@ -140,19 +143,19 @@ namespace hpp { ...@@ -140,19 +143,19 @@ namespace hpp {
{ {
EdgeReasonMap::iterator it = failureReasons_.find (edge); EdgeReasonMap::iterator it = failureReasons_.find (edge);
if (it == failureReasons_.end ()) { if (it == failureReasons_.end ()) {
std::string edgeStr = "(" + edge->name () + ")"; std::string edgeStr = edge->name () + " - ";
Reasons r (SuccessBin::createReason ("Projection for " + edgeStr), Reasons r (SuccessBin::createReason (edgeStr + "Projection"),
SuccessBin::createReason ("SteeringMethod for " + edgeStr), SuccessBin::createReason (edgeStr + "SteeringMethod"),
SuccessBin::createReason ("PathValidation returned length 0 for " + edgeStr), SuccessBin::createReason (edgeStr + "PathValidation returned length 0"),
SuccessBin::createReason ("Path could not be fully projected for " + edgeStr)); SuccessBin::createReason (edgeStr + "Path could not be fully projected"),
SuccessBin::createReason (edgeStr + "Path could not be projected"));
failureReasons_.insert (EdgeReasonPair (edge, r)); failureReasons_.insert (EdgeReasonPair (edge, r));
extendStatistics_.addFailure (r.get (t)); extendStatistics_.addFailure (r.get (t));
return; return;
} }
Reasons r = it->second; Reasons r = it->second;
extendStatistics_.addFailure (r.get (t)); extendStatistics_.addFailure (r.get (t));
hppDout (info, "Extension failed." << std::endl hppDout (info, "Extension failed." << std::endl << extendStatistics_);
<< extendStatistics_);
} }
inline void ManipulationPlanner::tryConnect (const core::Nodes_t nodes) inline void ManipulationPlanner::tryConnect (const core::Nodes_t nodes)
...@@ -195,7 +198,7 @@ namespace hpp { ...@@ -195,7 +198,7 @@ namespace hpp {
const core::RoadmapPtr_t& roadmap) : const core::RoadmapPtr_t& roadmap) :
core::PathPlanner (problem, roadmap), core::PathPlanner (problem, roadmap),
shooter_ (new core::BasicConfigurationShooter (problem.robot ())), shooter_ (new core::BasicConfigurationShooter (problem.robot ())),
problem_ (problem), pathProjector_ (new pathProjector::Dichotomy (problem_.distance (), 0.1)), problem_ (problem), pathProjector_ (new pathProjector::Progressive (problem_.distance (), 0.2)),
qProj_ (problem.robot ()->configSize ()) qProj_ (problem.robot ()->configSize ())
{} {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment