diff --git a/CMakeLists.txt b/CMakeLists.txt index 764cdc2fea7167834b9d0213237677f57fe999a6..5b57e8403703865ed6dbdd97694cd2137d1a66b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,7 +100,6 @@ SET (${PROJECT_NAME}_HEADERS include/hpp/manipulation/graph/helper.hh include/hpp/manipulation/path-optimization/small-steps.hh - include/hpp/manipulation/path-optimization/config-optimization.hh include/hpp/manipulation/path-optimization/enforce-transition-semantic.hh include/hpp/manipulation/path-optimization/keypoints.hh include/hpp/manipulation/path-optimization/spline-gradient-based.hh diff --git a/include/hpp/manipulation/path-optimization/config-optimization.hh b/include/hpp/manipulation/path-optimization/config-optimization.hh deleted file mode 100644 index c63473744a74c14a92d5373f21bf52b4e4aa41cc..0000000000000000000000000000000000000000 --- a/include/hpp/manipulation/path-optimization/config-optimization.hh +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) 2015 CNRS -// Authors: Joseph Mirabel -// -// This file is part of hpp-manipulation -// hpp-manipulation is free software: you can redistribute it -// and/or modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation, either version -// 3 of the License, or (at your option) any later version. -// -// hpp-manipulation is distributed in the hope that it will be -// useful, but WITHOUT ANY WARRANTY; without even the implied warranty -// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Lesser Public License for more details. You should have -// received a copy of the GNU Lesser General Public License along with -// hpp-manipulation If not, see -// <http://www.gnu.org/licenses/>. - -#ifndef HPP_MANIPULATION_PATH_OPTIMIZATION_CONFIG_OPTIMIZATION_HH -# define HPP_MANIPULATION_PATH_OPTIMIZATION_CONFIG_OPTIMIZATION_HH - -# include <hpp/core/path-optimization/config-optimization.hh> - -# include <hpp/manipulation/fwd.hh> - -namespace hpp { - namespace manipulation { - namespace pathOptimization { - /// \addtogroup path_optimization - /// \{ - - /// Optimize the waypoints of the path and optionally add the - /// constraint::ConfigurationConstraint to the ConfigProjector of the - /// path. - /// - /// See Parameters for information on how to tune the algorithm. - /// - /// \note The optimizer assumes that the input path is a vector of optimal - /// paths for the distance function. - struct ConfigOptimizationTraits - : core::pathOptimization::ConfigOptimizationTraits { - typedef core::PathPtr_t PathPtr_t; - - static size_type numberOfPass () { return 10; } - - static size_type numberOfIterations () { return 1; } - - static ConfigProjectorPtr_t getConfigProjector - (const PathPtr_t& before, const PathPtr_t& after, bool& reverse); - }; - /// \} - } // namespace pathOptimization - } // namespace manipulation -} // namespace hpp -#endif // HPP_MANIPULATION_PATH_OPTIMIZATION_CONFIG_OPTIMIZATION_HH diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d66da53e1e4908a79e50c881ec0c04cbef0f31bb..1036cb51f4e83c92f151eb35004417846c9f9ded 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -46,7 +46,6 @@ SET(SOURCES graph/dot.cc - path-optimization/config-optimization.cc path-optimization/keypoints.cc path-optimization/spline-gradient-based.cc path-optimization/enforce-transition-semantic.cc diff --git a/src/path-optimization/config-optimization.cc b/src/path-optimization/config-optimization.cc deleted file mode 100644 index cb2dc1a42f3abce3440b97530f1a76fa4419aa35..0000000000000000000000000000000000000000 --- a/src/path-optimization/config-optimization.cc +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) 2015, Joseph Mirabel -// Authors: Joseph Mirabel (joseph.mirabel@laas.fr) -// -// This file is part of hpp-manipulation. -// hpp-manipulation is free software: you can redistribute it -// and/or modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation, either version -// 3 of the License, or (at your option) any later version. -// -// hpp-manipulation is distributed in the hope that it will be -// useful, but WITHOUT ANY WARRANTY; without even the implied warranty -// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Lesser Public License for more details. You should have -// received a copy of the GNU Lesser General Public License along with -// hpp-manipulation. If not, see <http://www.gnu.org/licenses/>. - -#include <hpp/manipulation/path-optimization/config-optimization.hh> - -#include <hpp/util/pointer.hh> - -#include <hpp/core/path.hh> -#include <hpp/core/config-projector.hh> -#include <hpp/manipulation/device.hh> -#include <hpp/manipulation/graph/state.hh> -#include <hpp/manipulation/graph/edge.hh> -#include <hpp/manipulation/constraint-set.hh> - -namespace hpp { - namespace manipulation { - namespace pathOptimization { - ConfigProjectorPtr_t ConfigOptimizationTraits::getConfigProjector - (const PathPtr_t& before, const PathPtr_t& after, bool& reverse) - { - ConstraintSetPtr_t setB = - HPP_STATIC_PTR_CAST (ConstraintSet, before->constraints ()); - ConstraintSetPtr_t setA = - HPP_STATIC_PTR_CAST (ConstraintSet, after->constraints ()); - assert (setA->edge () && setB->edge()); - graph::GraphPtr_t graph = setA->edge()->parentGraph (); - /// Find if path were computed from init or goal config - /// There is a nasty case: when build a path fails partially, then you - /// end up where the edge->to() do not correspond to the node of - /// path->end(). In that case, path->end () should be in edge->node(). - /// (obviously, in this case, we have edge->isInNodeFrom_ = true) - const bool reverseB = setB->edge ()->direction(before); - //const bool reverseA = setA->edge ()->direction(after); - - reverse = reverseB; - - ConfigProjectorPtr_t p = ConfigProjector::create (graph->robot(), - "intersect_" + setB->edge()->name() + "_" + setA->edge()->name(), - graph->errorThreshold (), graph->maxIterations ()); - - setB->edge()->intersectionConstraint (setA->edge (), p); - - p->rightHandSideFromConfig (before->end ()); - return p; - } - } // namespace pathOptimization - } // namespace manipulation -} // namespace hpp diff --git a/src/problem-solver.cc b/src/problem-solver.cc index 75564fbc81d146874dd29d72ca50949b2e1fafb8..3e28acffe14b4bc5feb83d14cc133f5b7d76d26c 100644 --- a/src/problem-solver.cc +++ b/src/problem-solver.cc @@ -52,7 +52,6 @@ #include "hpp/manipulation/graph-optimizer.hh" #include "hpp/manipulation/graph-path-validation.hh" #include "hpp/manipulation/graph-node-optimizer.hh" -#include "hpp/manipulation/path-optimization/config-optimization.hh" #include "hpp/manipulation/path-optimization/keypoints.hh" #include "hpp/manipulation/path-optimization/spline-gradient-based.hh" #include "hpp/manipulation/path-optimization/enforce-transition-semantic.hh" @@ -75,15 +74,6 @@ namespace hpp { static bool removeLockedJoints () { return false; } }; - template <typename InnerConfigOptimizationTraits> - struct GraphConfigOptimizationTraits { - static core::PathOptimizerPtr_t create (const core::Problem& problem) - { - return core::pathOptimization::ConfigOptimization:: - createWithTraits <InnerConfigOptimizationTraits> (problem); - } - }; - template <typename ParentSM_t, typename ChildSM_t> core::SteeringMethodPtr_t createSMWithGuess (const core::Problem& problem) @@ -126,14 +116,6 @@ namespace hpp { PartialShortcut::createWithTraits <PartialShortcutTraits>); pathOptimizers.add ("Graph-PartialShortcut", GraphOptimizer::create <core::pathOptimization::PartialShortcut>); - pathOptimizers.add ("ConfigOptimization", - core::pathOptimization::ConfigOptimization::createWithTraits - <pathOptimization::ConfigOptimizationTraits>); - pathOptimizers.add ("Graph-ConfigOptimization", - GraphOptimizer::create < - GraphConfigOptimizationTraits - <pathOptimization::ConfigOptimizationTraits> - >); pathOptimizers.add ("EnforceTransitionSemantic", pathOptimization::EnforceTransitionSemantic::create);