hpp-core  6.0.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 
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // 1. Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // 2. Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27 // DAMAGE.
28 
29 #ifndef HPP_CORE_STEERING_METHOD_HERMITE_HH
30 #define HPP_CORE_STEERING_METHOD_HERMITE_HH
31 
32 #include <hpp/core/fwd.hh>
33 #include <hpp/core/path/hermite.hh>
34 #include <hpp/core/problem.hh>
38 
39 namespace hpp {
40 namespace core {
41 namespace steeringMethod {
44 
48  public:
50  static HermitePtr_t create(const ProblemConstPtr_t& problem) {
51  Hermite* ptr = new Hermite(problem);
52  HermitePtr_t shPtr(ptr);
53  ptr->init(shPtr);
54  return shPtr;
55  }
56 
58  static HermitePtr_t createCopy(const HermitePtr_t& other) {
59  Hermite* ptr = new Hermite(*other);
60  HermitePtr_t shPtr(ptr);
61  ptr->init(shPtr);
62  return shPtr;
63  }
64 
66  virtual SteeringMethodPtr_t copy() const { return createCopy(weak_.lock()); }
67 
70  ConfigurationIn_t q2) const {
71  path::HermitePtr_t path =
72  path::Hermite::create(problem()->robot(), q1, q2, constraints());
73 
74  path->computeHermiteLength();
75  return path;
76  }
77 
78  protected:
80  Hermite(const ProblemConstPtr_t& problem)
81  : SteeringMethod(problem), weak_() {}
82 
84  Hermite(const Hermite& other) : SteeringMethod(other), weak_() {}
85 
87  void init(HermiteWkPtr_t 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
Definition: steering-method.hh:48
void init(SteeringMethodWkPtr_t weak)
Store weak pointer to itself.
Definition: steering-method.hh:110
static HermitePtr_t create(const DevicePtr_t &device, ConfigurationIn_t init, ConfigurationIn_t end, ConstraintSetPtr_t constraints)
Definition: hermite.hh:49
Definition: hermite.hh:47
static HermitePtr_t createCopy(const HermitePtr_t &other)
Copy instance and return shared pointer.
Definition: hermite.hh:58
static HermitePtr_t create(const ProblemConstPtr_t &problem)
Create instance and return shared pointer.
Definition: hermite.hh:50
void init(HermiteWkPtr_t weak)
Store weak pointer to itself.
Definition: hermite.hh:87
Hermite(const Hermite &other)
Copy constructor.
Definition: hermite.hh:84
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: hermite.hh:66
virtual PathPtr_t impl_compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
create a path between two configurations
Definition: hermite.hh:69
Hermite(const ProblemConstPtr_t &problem)
Constructor with weighed distance.
Definition: hermite.hh:80
#define HPP_CORE_DLLAPI
Definition: config.hh:88
shared_ptr< Hermite > HermitePtr_t
Definition: fwd.hh:246
shared_ptr< Hermite > HermitePtr_t
Definition: fwd.hh:53
shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:213
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:108
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:197
shared_ptr< Path > PathPtr_t
Definition: fwd.hh:187
Definition: bi-rrt-planner.hh:35