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

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

Loading...
Searching...
No Matches
constant-curvature.hh
Go to the documentation of this file.
1//
2// Copyright (c) 2017 CNRS
3// Authors: Florent Lamiraux
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_CONSTANT_CURVATURE_HH
31#define HPP_CORE_STEERING_METHOD_CONSTANT_CURVATURE_HH
32
33#include <hpp/core/fwd.hh>
34#include <hpp/core/path.hh>
35#include <hpp/core/steering-method/fwd.hh>
36
37namespace hpp {
38namespace core {
39namespace steeringMethod {
41 class ConstantCurvature : public Path {
42 public:
43 typedef Path parent_t;
44 virtual ~ConstantCurvature() {}
60 static ConstantCurvaturePtr_t create(
61 const DevicePtr_t& robot, ConfigurationIn_t init, ConfigurationIn_t end,
62 value_type curveLength, value_type pathLength, value_type curvature,
63 size_type xyId, size_type rzId, const JointPtr_t rz,
64 const std::vector<JointPtr_t> wheels,
65 const ConstraintSetPtr_t& constraints);
66
68 static ConstantCurvaturePtr_t createCopy(const ConstantCurvaturePtr_t& other);
69
71 static ConstantCurvaturePtr_t createCopy(
72 const ConstantCurvaturePtr_t& other,
73 const ConstraintSetPtr_t& constraints);
74
76 virtual PathPtr_t copy() const;
77
81 virtual PathPtr_t copy(const ConstraintSetPtr_t& constraints) const {
82 return createCopy(weak_.lock(), constraints);
83 }
84
86 inline Configuration_t initial() const { return initial_; }
87
89 inline Configuration_t end() const { return end_; }
90
91 virtual PathPtr_t reverse() const;
92
93 struct Wheels_t {
94 value_type value; // Constant value of the wheel angle
95 JointPtr_t j;
96 Wheels_t() : j() {}
97 };
98
99 protected:
101 virtual std::ostream& print(std::ostream& os) const;
102
117 ConstantCurvature(const DevicePtr_t& robot, ConfigurationIn_t init,
118 ConfigurationIn_t end, value_type curveLength,
119 value_type pathLength, value_type curvature, size_type xyId,
120 size_type rzId, const JointPtr_t rz,
121 const std::vector<JointPtr_t> wheels);
122
138 ConstantCurvature(const DevicePtr_t& robot, ConfigurationIn_t init,
139 ConfigurationIn_t end, value_type curveLength,
140 value_type pathLength, value_type curvature, size_type xyId,
141 size_type rzId, const JointPtr_t rz,
142 const std::vector<JointPtr_t> wheels,
143 ConstraintSetPtr_t constraints);
144
146 ConstantCurvature(const ConstantCurvature& other);
147
149 ConstantCurvature(const ConstantCurvature& other,
150 const ConstraintSetPtr_t& constraints);
151
152 virtual bool impl_compute(ConfigurationOut_t result, value_type param) const;
154 virtual void impl_derivative(vectorOut_t result, const value_type& param,
155 size_type order) const;
157 virtual void impl_velocityBound(vectorOut_t bound, const value_type& param0,
158 const value_type& param1) const;
159
161 virtual PathPtr_t impl_extract(const interval_t& paramInterval) const;
162
164 void init(const ConstantCurvatureWkPtr_t& weak) {
165 parent_t::init(weak);
166 weak_ = weak;
167 }
168
170 ConstantCurvature() : curvature_(0), xyId_(0), rzId_(0) {}
171
172 private:
177 void setWheelJoints(const JointPtr_t rz,
178 const std::vector<JointPtr_t> wheels);
179
180 DevicePtr_t robot_;
181 Configuration_t initial_;
182 Configuration_t end_;
183 value_type curveLength_;
184 const value_type curvature_;
185 const size_type xyId_, rzId_;
186 size_type dxyId_, drzId_;
187 value_type forward_;
188 std::vector<Wheels_t> wheels_;
189 ConstantCurvatureWkPtr_t weak_;
190
191 HPP_SERIALIZABLE();
192}; // class ConstantCurvature
193} // namespace steeringMethod
194} // namespace core
195} // namespace hpp
196
197#endif // HPP_CORE_STEERING_METHOD_CONSTANT_CURVATURE_HH
hpp::core::Path
Definition path.hh:71
hpp::core::Path::init
void init(const PathWkPtr_t &self)
hpp::core::Path::constraints
const ConstraintSetPtr_t & constraints() const
Get constraints the path is subject to.
Definition path.hh:204
hpp::core::steeringMethod::ConstantCurvature
Path of constant curvature for a carlike robot.
Definition constant-curvature.hh:41
hpp::core::steeringMethod::ConstantCurvature::ConstantCurvature
ConstantCurvature(const ConstantCurvature &other)
Copy constructor.
hpp::core::steeringMethod::ConstantCurvature::print
virtual std::ostream & print(std::ostream &os) const
Print path in a stream.
hpp::core::steeringMethod::ConstantCurvature::impl_velocityBound
virtual void impl_velocityBound(vectorOut_t bound, const value_type &param0, const value_type &param1) const
Virtual implementation of velocity bound.
hpp::core::steeringMethod::ConstantCurvature::create
static ConstantCurvaturePtr_t create(const DevicePtr_t &robot, ConfigurationIn_t init, ConfigurationIn_t end, value_type curveLength, value_type pathLength, value_type curvature, size_type xyId, size_type rzId, const JointPtr_t rz, const std::vector< JointPtr_t > wheels, const ConstraintSetPtr_t &constraints)
hpp::core::steeringMethod::ConstantCurvature::ConstantCurvature
ConstantCurvature()
For serialization only.
Definition constant-curvature.hh:170
hpp::core::steeringMethod::ConstantCurvature::ConstantCurvature
ConstantCurvature(const DevicePtr_t &robot, ConfigurationIn_t init, ConfigurationIn_t end, value_type curveLength, value_type pathLength, value_type curvature, size_type xyId, size_type rzId, const JointPtr_t rz, const std::vector< JointPtr_t > wheels, ConstraintSetPtr_t constraints)
hpp::core::steeringMethod::ConstantCurvature::createCopy
static ConstantCurvaturePtr_t createCopy(const ConstantCurvaturePtr_t &other, const ConstraintSetPtr_t &constraints)
Create instance and return shared pointer.
hpp::core::steeringMethod::ConstantCurvature::copy
virtual PathPtr_t copy() const
Return a shared pointer to a copy of this.
hpp::core::steeringMethod::ConstantCurvature::impl_extract
virtual PathPtr_t impl_extract(const interval_t &paramInterval) const
Virtual implementation of path extraction.
hpp::core::steeringMethod::ConstantCurvature::impl_compute
virtual bool impl_compute(ConfigurationOut_t result, value_type param) const
Function evaluation without applying constraints.
hpp::core::steeringMethod::ConstantCurvature::copy
virtual PathPtr_t copy(const ConstraintSetPtr_t &constraints) const
Definition constant-curvature.hh:81
hpp::core::steeringMethod::ConstantCurvature::createCopy
static ConstantCurvaturePtr_t createCopy(const ConstantCurvaturePtr_t &other)
Create instance and return shared pointer.
hpp::core::steeringMethod::ConstantCurvature::initial
Configuration_t initial() const
Get the initial configuration.
Definition constant-curvature.hh:86
hpp::core::steeringMethod::ConstantCurvature::impl_derivative
virtual void impl_derivative(vectorOut_t result, const value_type &param, size_type order) const
Virtual implementation of derivative.
hpp::core::steeringMethod::ConstantCurvature::ConstantCurvature
ConstantCurvature(const DevicePtr_t &robot, ConfigurationIn_t init, ConfigurationIn_t end, value_type curveLength, value_type pathLength, value_type curvature, size_type xyId, size_type rzId, const JointPtr_t rz, const std::vector< JointPtr_t > wheels)
hpp::core::steeringMethod::ConstantCurvature::reverse
virtual PathPtr_t reverse() const
hpp::core::steeringMethod::ConstantCurvature::end
Configuration_t end() const
Get the final configuration.
Definition constant-curvature.hh:89
hpp::core::steeringMethod::ConstantCurvature::~ConstantCurvature
virtual ~ConstantCurvature()
Definition constant-curvature.hh:44
hpp::core::steeringMethod::ConstantCurvature::init
void init(const ConstantCurvatureWkPtr_t &weak)
store weak pointer to itself
Definition constant-curvature.hh:164
hpp::core::steeringMethod::ConstantCurvature::ConstantCurvature
ConstantCurvature(const ConstantCurvature &other, const ConstraintSetPtr_t &constraints)
Copy constructor with constraints.
hpp::core::steeringMethod::ConstantCurvature::parent_t
Path parent_t
Definition constant-curvature.hh:43
fwd.hh
hpp
hpp::core::steeringMethod::ConstantCurvaturePtr_t
shared_ptr< ConstantCurvature > ConstantCurvaturePtr_t
Definition fwd.hh:43
hpp::core::value_type
pinocchio::value_type value_type
Definition fwd.hh:174
hpp::core::vectorOut_t
pinocchio::vectorOut_t vectorOut_t
Definition fwd.hh:222
hpp::core::ConfigurationOut_t
pinocchio::ConfigurationOut_t ConfigurationOut_t
Definition fwd.hh:109
hpp::core::JointPtr_t
pinocchio::JointPtr_t JointPtr_t
Definition fwd.hh:151
hpp::core::ConfigurationIn_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition fwd.hh:108
hpp::core::interval_t
std::pair< value_type, value_type > interval_t
Definition fwd.hh:175
hpp::core::size_type
pinocchio::size_type size_type
Definition fwd.hh:173
hpp::core::Configuration_t
pinocchio::Configuration_t Configuration_t
Definition fwd.hh:107
hpp::core::DevicePtr_t
pinocchio::DevicePtr_t DevicePtr_t
Definition fwd.hh:134
hpp::core::ConstraintSetPtr_t
shared_ptr< ConstraintSet > ConstraintSetPtr_t
Definition fwd.hh:130
hpp::core::PathPtr_t
shared_ptr< Path > PathPtr_t
Definition fwd.hh:187
path.hh
fwd.hh
hpp::core::steeringMethod::ConstantCurvature::Wheels_t
Definition constant-curvature.hh:93
hpp::core::steeringMethod::ConstantCurvature::Wheels_t::j
JointPtr_t j
Definition constant-curvature.hh:95
hpp::core::steeringMethod::ConstantCurvature::Wheels_t::Wheels_t
Wheels_t()
Definition constant-curvature.hh:96
hpp::core::steeringMethod::ConstantCurvature::Wheels_t::value
value_type value
Definition constant-curvature.hh:94