hpp-manipulation  4.9.0
Classes for manipulation planning.
graph.hh
Go to the documentation of this file.
1 // Copyright (c) 2014, 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_STEERING_METHOD_GRAPH_HH
19 # define HPP_MANIPULATION_STEERING_METHOD_GRAPH_HH
20 
21 # include <hpp/core/problem-solver.hh> // SteeringMethodBuilder_t
22 # include <hpp/core/steering-method.hh>
23 
24 # include <hpp/manipulation/config.hh>
25 # include <hpp/manipulation/fwd.hh>
28 
29 namespace hpp {
30  namespace manipulation {
33  class HPP_MANIPULATION_DLLAPI SteeringMethod : public core::SteeringMethod
34  {
35  public:
37  {
38  return steeringMethod_;
39  }
40 
42  {
43  steeringMethod_ = sm;
44  }
45 
46  protected:
49 
51  SteeringMethod (const SteeringMethod& other);
52 
53  void init (SteeringMethodWkPtr_t weak)
54  {
56  }
57 
59  const Problem& problem_;
62  };
63 
64  namespace steeringMethod {
65  using core::PathPtr_t;
66 
67  class HPP_MANIPULATION_DLLAPI Graph : public SteeringMethod
68  {
69  typedef core::SteeringMethodBuilder_t SteeringMethodBuilder_t;
70 
71  public:
74  static GraphPtr_t create
75  (const core::Problem& problem);
76 
77  template <typename T>
78  static GraphPtr_t create
79  (const core::Problem& problem);
80 
82  static GraphPtr_t create (const Problem& problem);
83 
85  static GraphPtr_t createCopy
86  (const GraphPtr_t& other);
87 
90  {
91  return createCopy (weak_.lock ());
92  }
93 
94  protected:
96  Graph (const Problem& problem);
97 
99  Graph (const Graph&);
100 
102 
103  void init (GraphWkPtr_t weak)
104  {
105  SteeringMethod::init (weak);
106  weak_ = weak;
107  }
108 
109  private:
111  GraphWkPtr_t weak_;
112  };
113 
114  template <typename T>
117  {
118  GraphPtr_t gsm = Graph::create (problem);
119  gsm->innerSteeringMethod (T::create (problem));
120  return gsm;
121  }
122  } // namespace steeringMethod
124  } // namespace manipulation
125 } // namespace hpp
126 
127 #endif // HPP_MANIPULATION_STEERING_METHOD_GRAPH_HH
const core::SteeringMethodPtr_t & innerSteeringMethod() const
Definition: graph.hh:36
boost::shared_ptr< Path > PathPtr_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:38
boost::shared_ptr< Graph > GraphPtr_t
Definition: fwd.hh:30
Definition: problem.hh:32
boost::function< SteeringMethodPtr_t(const Problem &) > SteeringMethodBuilder_t
void init(SteeringMethodWkPtr_t weak)
Definition: graph.hh:53
void init(GraphWkPtr_t weak)
Definition: graph.hh:103
void init(SteeringMethodWkPtr_t weak)
core::SteeringMethodPtr_t steeringMethod_
The encapsulated steering method.
Definition: graph.hh:61
const Problem & problem_
A pointer to the manipulation problem.
Definition: graph.hh:59
static StraightPtr_t createCopy(const StraightPtr_t &other)
const Problem & problem() const
static GradientBasedPtr_t create(const Problem &problem)
SSM_t::Ptr_t steeringMethod_
void innerSteeringMethod(const core::SteeringMethodPtr_t &sm)
Definition: graph.hh:41
boost::shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: graph.hh:33
virtual core::SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: graph.hh:89
void impl_compute(result_ref, const_argument_ref) const