hpp-manipulation  4.11.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 
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:
48  SteeringMethod (const ProblemConstPtr_t& problem);
49 
51  SteeringMethod (const SteeringMethod& other);
52 
53  void init (SteeringMethodWkPtr_t weak)
54  {
55  core::SteeringMethod::init (weak);
56  }
57 
62  };
63 
64  namespace steeringMethod {
65  using core::PathPtr_t;
66 
68  {
69  typedef core::SteeringMethodBuilder_t SteeringMethodBuilder_t;
70 
71  public:
74  static GraphPtr_t create
75  (const core::ProblemConstPtr_t& problem);
76 
77  template <typename T>
78  static GraphPtr_t create
79  (const core::ProblemConstPtr_t& problem);
80 
82  static GraphPtr_t createCopy
83  (const GraphPtr_t& other);
84 
87  {
88  return createCopy (weak_.lock ());
89  }
90 
91  protected:
93  Graph (const ProblemConstPtr_t& problem);
94 
96  Graph (const Graph&);
97 
98  virtual PathPtr_t impl_compute (ConfigurationIn_t q1, ConfigurationIn_t q2) const;
99 
100  void init (GraphWkPtr_t weak)
101  {
102  SteeringMethod::init (weak);
103  weak_ = weak;
104  }
105 
106  private:
108  GraphWkPtr_t weak_;
109  };
110 
111  template <typename T>
112  GraphPtr_t Graph::create
113  (const core::ProblemConstPtr_t& problem)
114  {
115  GraphPtr_t gsm = Graph::create (problem);
116  gsm->innerSteeringMethod (T::create (problem));
117  return gsm;
118  }
119  } // namespace steeringMethod
121  } // namespace manipulation
122 } // namespace hpp
123 
124 #endif // HPP_MANIPULATION_STEERING_METHOD_GRAPH_HH
const core::SteeringMethodPtr_t & innerSteeringMethod() const
Definition: graph.hh:36
shared_ptr< Graph > GraphPtr_t
Definition: fwd.hh:30
shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:93
Definition: main.hh:1
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:38
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:56
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
ProblemConstPtr_t problem_
A pointer to the manipulation problem.
Definition: graph.hh:59
void init(SteeringMethodWkPtr_t weak)
Definition: graph.hh:53
void init(GraphWkPtr_t weak)
Definition: graph.hh:100
core::SteeringMethodPtr_t steeringMethod_
The encapsulated steering method.
Definition: graph.hh:61
void innerSteeringMethod(const core::SteeringMethodPtr_t &sm)
Definition: graph.hh:41
Definition: graph.hh:33
virtual core::SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: graph.hh:86