diff --git a/include/hpp/manipulation/fwd.hh b/include/hpp/manipulation/fwd.hh index bf933f7df188fb97cc3fd40edf0e61c1b8a48bfa..cc19d68783a693f88fa82fb6044a40a331be4609 100644 --- a/include/hpp/manipulation/fwd.hh +++ b/include/hpp/manipulation/fwd.hh @@ -90,6 +90,7 @@ namespace hpp { typedef core::ConfigurationShooter ConfigurationShooter; typedef core::ConfigurationShooterPtr_t ConfigurationShooterPtr_t; typedef core::ValidationReport ValidationReport; + typedef core::PathValidationReportPtr_t PathValidationReportPtr_t; typedef std::pair< GripperPtr_t, HandlePtr_t> Grasp_t; typedef boost::shared_ptr <Grasp_t> GraspPtr_t; diff --git a/include/hpp/manipulation/graph-path-validation.hh b/include/hpp/manipulation/graph-path-validation.hh index 661ecceeae38cdc0bbd2d845b5abb21afdebd79e..6c3dfc9da18294dbbb15eba1573103a90fb7c58a 100644 --- a/include/hpp/manipulation/graph-path-validation.hh +++ b/include/hpp/manipulation/graph-path-validation.hh @@ -50,7 +50,10 @@ namespace hpp { public: /// Check that the path is valid regarding the constraint graph and call /// the encapsulated PathValidation::validate. - bool validate (const PathPtr_t& path, bool reverse, PathPtr_t& validPart); + /// \deprecated Use the method that takes as input a reference to a + /// ValidationReportPtr_t instead. + bool validate (const PathPtr_t& path, bool reverse, + PathPtr_t& validPart) HPP_MANIPULATION_DEPRECATED; /// Call the GraphPathValidation::validate without validation report. /// @@ -61,9 +64,27 @@ namespace hpp { /// \retval report information about the validation process. unused in /// this case, /// \return whether the whole path is valid. + /// \deprecated Use the method that takes as input a reference to a + /// ValidationReportPtr_t instead. virtual bool validate (const PathPtr_t& path, bool reverse, PathPtr_t& validPart, - ValidationReport& report); + ValidationReport& report) + HPP_MANIPULATION_DEPRECATED; + + /// Check that path is valid regarding the constraint graph. + /// + /// \param path the path to check for validity, + /// \param reverse if true check from the end, + /// \retval the extracted valid part of the path, pointer to path if + /// path is valid, + /// \retval report information about the validation process. unused in + /// this case, + /// \return whether the whole path is valid. + /// + /// \notice Call the encapsulated PathValidation::validate. + virtual bool validate (const PathPtr_t& path, bool reverse, + PathPtr_t& validPart, + PathValidationReportPtr_t& report); /// Set the encapsulated path validator. void innerValidation (const PathValidationPtr_t& pathValidation) diff --git a/src/graph-path-validation.cc b/src/graph-path-validation.cc index 94a070ed8df0a0fb8eab39698ff13d8a5492c675..74646b667560257823d4e17ca1aaac67e714e722 100644 --- a/src/graph-path-validation.cc +++ b/src/graph-path-validation.cc @@ -47,6 +47,14 @@ namespace hpp { return impl_validate (path, reverse, validPart); } + bool GraphPathValidation::validate (const PathPtr_t& path, bool reverse, + PathPtr_t& validPart, + PathValidationReportPtr_t&) + { + assert (path); + return impl_validate (path, reverse, validPart); + } + bool GraphPathValidation::impl_validate ( const PathVectorPtr_t& path, bool reverse, PathPtr_t& validPart) { @@ -95,7 +103,8 @@ namespace hpp { return impl_validate (pathVector, reverse, validPart); PathPtr_t pathNoCollision; - if (pathValidation_->validate (path, reverse, pathNoCollision)) { + PathValidationReportPtr_t report; + if (pathValidation_->validate (path, reverse, pathNoCollision, report)) { validPart = path; return true; } diff --git a/src/manipulation-planner.cc b/src/manipulation-planner.cc index b92c1404d04a9b05aee8194cd5955599927fd501..9bc5c030f7506807cea5cd1e0cbf1b843ad0983d 100644 --- a/src/manipulation-planner.cc +++ b/src/manipulation-planner.cc @@ -133,7 +133,8 @@ namespace hpp { } } else projPath = path; GraphPathValidationPtr_t pathValidation (problem_.pathValidation ()); - pathValidation->validate (projPath, false, validPath); + PathValidationReportPtr_t report; + pathValidation->validate (projPath, false, validPath, report); if (validPath->length () == 0) addFailure (PATH_VALIDATION, edge); else { @@ -190,7 +191,8 @@ namespace hpp { if (pathProjector) { if (!pathProjector->apply (path, projPath)) continue; } else projPath = path; - if (pathValidation->validate (projPath, false, validPath)) { + PathValidationReportPtr_t report; + if (pathValidation->validate (projPath, false, validPath, report)) { roadmap ()->addEdge (*itn1, *itn2, projPath); core::interval_t timeRange = projPath->timeRange (); roadmap ()->addEdge (*itn2, *itn1, projPath->extract