hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
hermite.hh
Go to the documentation of this file.
1 // Copyright (c) 2016 CNRS
2 // Authors: Joseph Mirabel
3 //
4 // This file is part of hpp-core
5 // hpp-core 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-core 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-core If not, see
16 // <http://www.gnu.org/licenses/>.
17 
18 #ifndef HPP_CORE_STEERING_METHOD_HERMITE_HH
19 # define HPP_CORE_STEERING_METHOD_HERMITE_HH
20 
21 # include <hpp/core/fwd.hh>
22 # include <hpp/core/problem.hh>
25 # include <hpp/core/path/hermite.hh>
27 
28 namespace hpp {
29  namespace core {
30  namespace steeringMethod {
33 
36  class HPP_CORE_DLLAPI Hermite : public SteeringMethod
37  {
38  public:
40  static HermitePtr_t create (const Problem& problem)
41  {
42  Hermite* ptr = new Hermite (problem);
43  HermitePtr_t shPtr (ptr);
44  ptr->init (shPtr);
45  return shPtr;
46  }
47 
49  static HermitePtr_t createCopy (const HermitePtr_t& other)
50  {
51  Hermite* ptr = new Hermite (*other);
52  HermitePtr_t shPtr (ptr);
53  ptr->init (shPtr);
54  return shPtr;
55  }
56 
58  virtual SteeringMethodPtr_t copy () const
59  {
60  return createCopy (weak_.lock ());
61  }
62 
65  ConfigurationIn_t q2) const
66  {
68  (problem_.robot(), q1, q2, constraints ());
69 
70  path->computeHermiteLength();
71  return path;
72  }
73 
74  protected:
76  Hermite (const Problem& problem) :
77  SteeringMethod (problem), weak_ ()
78  {}
79 
81  Hermite (const Hermite& other) :
82  SteeringMethod (other), weak_ ()
83  {}
84 
86  void init (HermiteWkPtr_t weak)
87  {
88  SteeringMethod::init (weak);
89  weak_ = weak;
90  }
91 
92  private:
93  HermiteWkPtr_t weak_;
94  }; // Hermite
96  } // namespace steeringMethod
97  } // namespace core
98 } // namespace hpp
99 #endif // HPP_CORE_STEERING_METHOD_HERMITE_HH
boost::shared_ptr< Path > PathPtr_t
Definition: fwd.hh:170
boost::shared_ptr< Hermite > HermitePtr_t
Definition: fwd.hh:226
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
static HermitePtr_t create(const DevicePtr_t &device, ConfigurationIn_t init, ConfigurationIn_t end, ConstraintSetPtr_t constraints)
Definition: hermite.hh:39
Definition: problem.hh:48
Definition: steering-method.hh:38
boost::shared_ptr< Hermite > HermitePtr_t
Definition: fwd.hh:41
static HermitePtr_t create(const Problem &problem)
Create instance and return shared pointer.
Definition: hermite.hh:40
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: hermite.hh:58
static HermitePtr_t createCopy(const HermitePtr_t &other)
Copy instance and return shared pointer.
Definition: hermite.hh:49
void init(SteeringMethodWkPtr_t weak)
Store weak pointer to itself.
Definition: steering-method.hh:114
virtual PathPtr_t impl_compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
create a path between two configurations
Definition: hermite.hh:64
Hermite(const Problem &problem)
Constructor with weighed distance.
Definition: hermite.hh:76
Hermite(const Hermite &other)
Copy constructor.
Definition: hermite.hh:81
Definition: hermite.hh:36
boost::shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:194
void init(HermiteWkPtr_t weak)
Store weak pointer to itself.
Definition: hermite.hh:86