hpp-core 6.0.0
Implement basic classes for canonical path planning for kinematic chains.
Loading...
Searching...
No Matches
spline.hh
Go to the documentation of this file.
1//
2// Copyright (c) 2017 CNRS
3// Authors: Joseph Mirabel
4//
5
6// Redistribution and use in source and binary forms, with or without
7// modification, are permitted provided that the following conditions are
8// met:
9//
10// 1. Redistributions of source code must retain the above copyright
11// notice, this list of conditions and the following disclaimer.
12//
13// 2. Redistributions in binary form must reproduce the above copyright
14// notice, this list of conditions and the following disclaimer in the
15// documentation and/or other materials provided with the distribution.
16//
17// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28// DAMAGE.
29
30#ifndef HPP_CORE_STEERING_METHOD_SPLINE_HH
31#define HPP_CORE_STEERING_METHOD_SPLINE_HH
32
33#include <hpp/core/config.hh>
34#include <hpp/core/fwd.hh>
36#include <hpp/util/debug.hh>
37#include <hpp/util/pointer.hh>
38
39namespace hpp {
40namespace core {
41namespace steeringMethod {
44
47template <int _PolynomeBasis, int _SplineOrder>
49 public:
50 enum { PolynomeBasis = _PolynomeBasis, SplineOrder = _SplineOrder };
53
54 typedef shared_ptr<Spline> Ptr_t;
55 typedef weak_ptr<Spline> WkPtr_t;
56
57 static Ptr_t create(const ProblemConstPtr_t& problem) {
58 Spline* ptr = new Spline(problem);
59 Ptr_t shPtr(ptr);
60 ptr->init(shPtr);
61 return shPtr;
62 }
63
65 static Ptr_t createCopy(const Ptr_t& other) {
66 Spline* ptr = new Spline(*other);
67 Ptr_t shPtr(ptr);
68 ptr->init(shPtr);
69 return shPtr;
70 }
71
73 virtual SteeringMethodPtr_t copy() const { return createCopy(weak_.lock()); }
74
77 ConfigurationIn_t q2) const;
78
90 PathPtr_t steer(ConfigurationIn_t q1, std::vector<int> order1,
91 matrixIn_t derivatives1, ConfigurationIn_t q2,
92 std::vector<int> order2, matrixIn_t derivatives2,
93 value_type length = -1, bool se3Output = false) const;
94
95 protected:
97 Spline(const ProblemConstPtr_t& problem);
98
100 Spline(const Spline& other);
101
103 void init(WkPtr_t weak) {
104 SteeringMethod::init(weak);
105 weak_ = weak;
106 }
107
108 private:
110 template <typename Derived>
111 PathPtr_t impl_compute(ConfigurationIn_t q1, std::vector<int> order1,
112 const Eigen::MatrixBase<Derived>& derivatives1,
113 ConfigurationIn_t q2, std::vector<int> order2,
114 const Eigen::MatrixBase<Derived>& derivatives2,
115 value_type length, bool se3Output = false) const;
116
117 DeviceWkPtr_t device_;
118 WkPtr_t weak_;
119}; // Spline
121} // namespace steeringMethod
122} // namespace core
123} // namespace hpp
124#endif // HPP_CORE_STEERING_METHOD_REEDS_SHEPP_HH
Definition steering-method.hh:48
Definition spline.hh:91
shared_ptr< Spline > Ptr_t
Definition spline.hh:111
Definition spline.hh:48
Spline(const ProblemConstPtr_t &problem)
Constructor.
PathPtr_t steer(ConfigurationIn_t q1, std::vector< int > order1, matrixIn_t derivatives1, ConfigurationIn_t q2, std::vector< int > order2, matrixIn_t derivatives2, value_type length=-1, bool se3Output=false) const
void init(WkPtr_t weak)
Store weak pointer to itself.
Definition spline.hh:103
SplinePath::Ptr_t SplinePathPtr_t
Definition spline.hh:52
static Ptr_t create(const ProblemConstPtr_t &problem)
Definition spline.hh:57
shared_ptr< Spline > Ptr_t
Definition spline.hh:54
Spline(const Spline &other)
Copy constructor.
static Ptr_t createCopy(const Ptr_t &other)
Copy instance and return shared pointer.
Definition spline.hh:65
path::Spline< PolynomeBasis, SplineOrder > SplinePath
Definition spline.hh:51
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition spline.hh:73
weak_ptr< Spline > WkPtr_t
Definition spline.hh:55
virtual PathPtr_t impl_compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
create a path between two configurations
#define HPP_CORE_DLLAPI
Definition config.hh:88
pinocchio::DeviceWkPtr_t DeviceWkPtr_t
Definition fwd.hh:135
pinocchio::value_type value_type
Definition fwd.hh:174
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
constraints::matrixIn_t matrixIn_t
Definition fwd.hh:166
shared_ptr< Path > PathPtr_t
Definition fwd.hh:187
Definition bi-rrt-planner.hh:35