hpp-manipulation  4.12.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>
27 
28 namespace hpp {
29  namespace manipulation {
30  using hpp::core::Path;
31  using hpp::core::PathPtr_t;
32  using hpp::core::PathVector;
33  using hpp::core::PathVectorPtr_t;
34 
37 
44  {
45  public:
46  typedef core::PathOptimizerBuilder_t PathOptimizerBuilder_t;
47 
48  template <typename TraitsOrInnerType>
49  static GraphOptimizerPtr_t create
50  (const core::ProblemConstPtr_t& problem);
51 
52  virtual PathVectorPtr_t optimize (const PathVectorPtr_t& path);
53 
56  {
57  return pathOptimizer_;
58  }
59 
60  protected:
63  PathOptimizerBuilder_t factory) :
64  PathOptimizer (problem), factory_ (factory), pathOptimizer_ ()
65  {}
66 
67  private:
68  PathOptimizerBuilder_t factory_;
69 
71  PathOptimizerPtr_t pathOptimizer_;
72  };
74 
76  template <typename TraitsOrInnerType>
78  (const core::ProblemConstPtr_t& problem)
79  {
80  return GraphOptimizerPtr_t (
81  new GraphOptimizer (problem, TraitsOrInnerType::create)
82  );
83  }
84 
85  } // namespace manipulation
86 } // namespace hpp
87 
88 #endif // HPP_MANIPULATION_GRAPHOPTIMIZER_HH
const PathOptimizerPtr_t & innerOptimizer()
Get the encapsulated optimizer.
Definition: graph-optimizer.hh:55
Definition: graph-optimizer.hh:43
GraphOptimizer(const core::ProblemConstPtr_t &problem, PathOptimizerBuilder_t factory)
Constructor.
Definition: graph-optimizer.hh:62
Definition: main.hh:1
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:56
shared_ptr< GraphOptimizer > GraphOptimizerPtr_t
Definition: fwd.hh:97
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
static GraphOptimizerPtr_t create(const core::ProblemConstPtr_t &problem)
Member function definition.
Definition: graph-optimizer.hh:78
core::PathOptimizerPtr_t PathOptimizerPtr_t
Definition: fwd.hh:95
core::PathOptimizerBuilder_t PathOptimizerBuilder_t
Definition: graph-optimizer.hh:46
core::PathOptimizer PathOptimizer
Definition: fwd.hh:94