hpp-manipulation  4.9.0
Classes for manipulation planning.
graph-optimizer.hh
Go to the documentation of this file.
1 // Copyright (c) 2015, LAAS-CNRS
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of hpp-manipulation.
5 // hpp-manipulation is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-manipulation is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>.
16 
17 
18 #ifndef HPP_MANIPULATION_GRAPHOPTIMIZER_HH
19 # define HPP_MANIPULATION_GRAPHOPTIMIZER_HH
20 
21 # include <hpp/core/path-optimizer.hh>
22 # include <hpp/core/problem-solver.hh> // PathOptimizerBuilder_t
23 
24 # include <hpp/manipulation/fwd.hh>
25 # include <hpp/manipulation/config.hh>
27 
28 namespace hpp {
29  namespace manipulation {
30  using hpp::core::Path;
34 
37 
43  class HPP_MANIPULATION_DLLAPI GraphOptimizer : public PathOptimizer
44  {
45  public:
47 
48  template <typename TraitsOrInnerType>
50 
51  virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
52 
55  {
56  return pathOptimizer_;
57  }
58 
59  protected:
61  GraphOptimizer (const core::Problem& problem, PathOptimizerBuilder_t factory) :
62  PathOptimizer (problem), factory_ (factory), pathOptimizer_ ()
63  {}
64 
65  private:
66  PathOptimizerBuilder_t factory_;
67 
69  PathOptimizerPtr_t pathOptimizer_;
70  };
72 
74  template <typename TraitsOrInnerType>
77  {
78  return GraphOptimizerPtr_t (
80  );
81  }
82 
83  } // namespace manipulation
84 } // namespace hpp
85 
86 #endif // HPP_MANIPULATION_GRAPHOPTIMIZER_HH
const PathOptimizerPtr_t & innerOptimizer()
Get the encapsulated optimizer.
Definition: graph-optimizer.hh:54
boost::shared_ptr< GraphOptimizer > GraphOptimizerPtr_t
Definition: fwd.hh:94
Definition: graph-optimizer.hh:43
boost::shared_ptr< Path > PathPtr_t
static GraphOptimizerPtr_t create(const core::Problem &problem)
Member function definition.
Definition: graph-optimizer.hh:76
virtual PathVectorPtr_t optimize(const PathVectorPtr_t &path)
const Problem & problem() const
boost::function< PathOptimizerPtr_t(const Problem &) > PathOptimizerBuilder_t
core::PathOptimizerPtr_t PathOptimizerPtr_t
Definition: fwd.hh:92
static GradientBasedPtr_t create(const Problem &problem)
core::PathOptimizerBuilder_t PathOptimizerBuilder_t
Definition: graph-optimizer.hh:46
boost::shared_ptr< PathVector > PathVectorPtr_t
GraphOptimizer(const core::Problem &problem, PathOptimizerBuilder_t factory)
Constructor.
Definition: graph-optimizer.hh:61