hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
constant-curvature.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
3 // Authors: Florent Lamiraux
4 //
5 // This file is part of hpp-core
6 // hpp-core is free software: you can redistribute it
7 // and/or modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation, either version
9 // 3 of the License, or (at your option) any later version.
10 //
11 // hpp-core is distributed in the hope that it will be
12 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Lesser Public License for more details. You should have
15 // received a copy of the GNU Lesser General Public License along with
16 // hpp-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CORE_STEERING_METHOD_CONSTANT_CURVATURE_HH
20 # define HPP_CORE_STEERING_METHOD_CONSTANT_CURVATURE_HH
21 
22 # include <hpp/core/fwd.hh>
23 # include <hpp/core/path.hh>
25 
26 namespace hpp {
27  namespace core {
28  namespace steeringMethod {
30  class ConstantCurvature : public Path {
31  public:
32  typedef Path parent_t;
33  virtual ~ConstantCurvature () {}
50  (const DevicePtr_t& robot, ConfigurationIn_t init,
52  value_type curveLength, value_type pathLength,
53  value_type curvature, size_type xyId, size_type rzId,
54  const JointPtr_t rz, const std::vector<JointPtr_t> wheels,
56 
59  (const ConstantCurvaturePtr_t& other);
60 
63  (const ConstantCurvaturePtr_t& other,
64  const ConstraintSetPtr_t& constraints);
65 
67  virtual PathPtr_t copy () const;
68 
72  virtual PathPtr_t copy (const ConstraintSetPtr_t& constraints) const
73  {
74  return createCopy (weak_.lock (), constraints);
75  }
76 
78  inline Configuration_t initial () const
79  {
80  return initial_;
81  }
82 
84  inline Configuration_t end () const
85  {
86  return end_;
87  }
88 
89  protected:
91  virtual std::ostream& print (std::ostream &os) const;
92 
107  ConstantCurvature (const DevicePtr_t& robot, ConfigurationIn_t init,
108  ConfigurationIn_t end,
109  value_type curveLength, value_type pathLength,
110  value_type curvature, size_type xyId,
111  size_type rzId, const JointPtr_t rz,
112  const std::vector<JointPtr_t> wheels);
113 
129  ConstantCurvature (const DevicePtr_t& robot, ConfigurationIn_t init,
130  ConfigurationIn_t end,
131  value_type curveLength, value_type pathLength,
132  value_type curvature, size_type xyId, size_type rzId,
133  const JointPtr_t rz,
134  const std::vector<JointPtr_t> wheels,
135  ConstraintSetPtr_t constraints);
136 
138  ConstantCurvature (const ConstantCurvature& other);
139 
141  ConstantCurvature (const ConstantCurvature& other,
142  const ConstraintSetPtr_t& constraints);
143 
144  virtual bool impl_compute (ConfigurationOut_t result,
145  value_type param) const;
147  virtual void impl_derivative
148  (vectorOut_t result, const value_type& param, size_type order) const;
150  virtual void impl_velocityBound (vectorOut_t bound,
151  const value_type& param0,
152  const value_type& param1) const;
153 
155  virtual PathPtr_t impl_extract (const interval_t& paramInterval) const;
156 
158  void init (const ConstantCurvatureWkPtr_t& weak)
159  {
160  parent_t::init (weak);
161  weak_ = weak;
162  }
163  private:
168  void setWheelJoints (const JointPtr_t rz,
169  const std::vector<JointPtr_t> wheels);
170 
171  const DevicePtr_t robot_;
172  Configuration_t initial_;
173  Configuration_t end_;
174  value_type curveLength_;
175  const value_type curvature_;
176  const size_type xyId_,rzId_;
177  size_type dxyId_,drzId_;
178  value_type forward_;
179  struct Wheels_t {
180  value_type value; // Constant value of the wheel angle
181  JointPtr_t j;
182  Wheels_t () : j () {}
183  };
184  std::vector<Wheels_t> wheels_;
185  ConstantCurvatureWkPtr_t weak_;
186  }; // class ConstantCurvature
187  } // namespace steeringMethod
188  } // namespace core
189 } // namespace hpp
190 
191 #endif // HPP_CORE_STEERING_METHOD_CONSTANT_CURVATURE_HH
boost::shared_ptr< Path > PathPtr_t
Definition: fwd.hh:170
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)
virtual void impl_velocityBound(vectorOut_t bound, const value_type &param0, const value_type &param1) const
Virtual implementation of velocity bound.
virtual std::ostream & print(std::ostream &os) const
Print path in a stream.
virtual bool impl_compute(ConfigurationOut_t result, value_type param) const
Function evaluation without applying constraints.
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:114
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
boost::shared_ptr< ConstraintSet > ConstraintSetPtr_t
Definition: fwd.hh:110
std::pair< value_type, value_type > interval_t
Definition: fwd.hh:158
pinocchio::ConfigurationOut_t ConfigurationOut_t
Definition: fwd.hh:98
Path parent_t
Definition: constant-curvature.hh:32
pinocchio::size_type size_type
Definition: fwd.hh:156
static ConstantCurvaturePtr_t createCopy(const ConstantCurvaturePtr_t &other)
Create instance and return shared pointer.
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:133
const ConstraintSetPtr_t & constraints() const
Get constraints the path is subject to.
Definition: path.hh:227
virtual PathPtr_t copy(const ConstraintSetPtr_t &constraints) const
Definition: constant-curvature.hh:72
Configuration_t end() const
Get the final configuration.
Definition: constant-curvature.hh:84
void init(const PathWkPtr_t &self)
Path of constant curvature for a carlike robot.
Definition: constant-curvature.hh:30
void init(const ConstantCurvatureWkPtr_t &weak)
store weak pointer to itself
Definition: constant-curvature.hh:158
virtual PathPtr_t copy() const
Return a shared pointer to a copy of this.
pinocchio::value_type value_type
Definition: fwd.hh:157
boost::shared_ptr< ConstantCurvature > ConstantCurvaturePtr_t
Definition: fwd.hh:32
Configuration_t initial() const
Get the initial configuration.
Definition: constant-curvature.hh:78
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)
pinocchio::vectorOut_t vectorOut_t
Definition: fwd.hh:203
virtual ~ConstantCurvature()
Definition: constant-curvature.hh:33
Definition: path.hh:60
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:96
virtual void impl_derivative(vectorOut_t result, const value_type &param, size_type order) const
Virtual implementation of derivative.
virtual PathPtr_t impl_extract(const interval_t &paramInterval) const
Virtual implementation of path extraction.