hpp-core: include/hpp/core/steering-method/hermite.hh Source File

hpp-core 9.0.2 Implement basic classes for canonical path planning for kinematic chains.

Loading...
Searching...
No Matches
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>
35#include <hpp/core/steering-method.hh>
36#include <hpp/core/steering-method/fwd.hh>
37#include <hpp/core/weighed-distance.hh>
38
39namespace hpp {
40namespace core {
41namespace steeringMethod {
44
47 class HPP_CORE_DLLAPI Hermite : public SteeringMethod {
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
69 virtual PathPtr_t impl_compute(ConfigurationIn_t q1,
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) {
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
hpp::core::SteeringMethod
Definition steering-method.hh:48
hpp::core::steeringMethod::Hermite
Definition hermite.hh:47
hpp::core::steeringMethod::Hermite::createCopy
static HermitePtr_t createCopy(const HermitePtr_t &other)
Copy instance and return shared pointer.
Definition hermite.hh:58
hpp::core::steeringMethod::Hermite::create
static HermitePtr_t create(const ProblemConstPtr_t &problem)
Create instance and return shared pointer.
Definition hermite.hh:50
hpp::core::steeringMethod::Hermite::init
void init(HermiteWkPtr_t weak)
Store weak pointer to itself.
Definition hermite.hh:87
hpp::core::steeringMethod::Hermite::Hermite
Hermite(const Hermite &other)
Copy constructor.
Definition hermite.hh:84
hpp::core::steeringMethod::Hermite::copy
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition hermite.hh:66
hpp::core::steeringMethod::Hermite::impl_compute
virtual PathPtr_t impl_compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
create a path between two configurations
Definition hermite.hh:69
hpp::core::steeringMethod::Hermite::Hermite
Hermite(const ProblemConstPtr_t &problem)
Constructor with weighed distance.
Definition hermite.hh:80
HPP_CORE_DLLAPI
#define HPP_CORE_DLLAPI
Definition config.hh:88
fwd.hh
hpp
hpp::core::path::HermitePtr_t
shared_ptr< Hermite > HermitePtr_t
Definition fwd.hh:246
hpp::core::steeringMethod::HermitePtr_t
shared_ptr< Hermite > HermitePtr_t
Definition fwd.hh:53
hpp::core::SteeringMethodPtr_t
shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition fwd.hh:213
hpp::core::ConfigurationIn_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition fwd.hh:108
hpp::core::ProblemConstPtr_t
shared_ptr< const Problem > ProblemConstPtr_t
Definition fwd.hh:197
hpp::core::PathPtr_t
shared_ptr< Path > PathPtr_t
Definition fwd.hh:187
hermite.hh
problem.hh
fwd.hh
steering-method.hh
weighed-distance.hh