hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
kinodynamic-oriented-path.hh
Go to the documentation of this file.
1 // Copyright (c) 2016, LAAS-CNRS
2 // Authors: Pierre Fernbach (pierre.fernbach@laas.fr)
3 //
4 // This file is part of hpp-core
5 // hpp-core is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-core is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-core If not, see
16 // <http://www.gnu.org/licenses/>.
17 
18 
19 #ifndef HPP_CORE_KINODYNAMIC_ORIENTED_PATH_HH
20 #define HPP_CORE_KINODYNAMIC_ORIENTED_PATH_HH
21 
23 
24 namespace hpp{
25  namespace core{
28 
29  class HPP_CORE_DLLAPI KinodynamicOrientedPath : public KinodynamicPath
30  {
31  public :
34 
40  ConfigurationIn_t init,
43  {
44  KinodynamicOrientedPath* ptr = new KinodynamicOrientedPath (device, init, end, length,a1,t0,t1,tv,t2,vLim,ignoreZValue);
45  KinodynamicOrientedPathPtr_t shPtr (ptr);
46  ptr->init (shPtr);
47  ptr->checkPath ();
48  return shPtr;
49  }
50 
57  ConfigurationIn_t init,
60  ConstraintSetPtr_t constraints, bool ignoreZValue = false)
61  {
62  KinodynamicOrientedPath* ptr = new KinodynamicOrientedPath (device, init, end, length,a1,t0,t1,tv,t2,vLim,
63  constraints,ignoreZValue);
64  KinodynamicOrientedPathPtr_t shPtr (ptr);
65  ptr->init (shPtr);
66  ptr->checkPath ();
67  return shPtr;
68  }
69 
73  {
75  KinodynamicOrientedPathPtr_t shPtr (ptr);
76  ptr->init (shPtr);
77  ptr->checkPath ();
78  return shPtr;
79  }
80 
81  static KinodynamicOrientedPathPtr_t create (const KinodynamicPathPtr_t& path,bool ignoreZValue = false)
82  {
83  KinodynamicOrientedPath* ptr = new KinodynamicOrientedPath (*path,ignoreZValue);
84  KinodynamicOrientedPathPtr_t shPtr (ptr);
85  ptr->init (shPtr);
86  ptr->checkPath ();
87  return shPtr;
88  }
89 
93  static KinodynamicOrientedPathPtr_t createCopy
94  (const KinodynamicOrientedPathPtr_t& path, const ConstraintSetPtr_t& constraints)
95  {
96  KinodynamicOrientedPath* ptr = new KinodynamicOrientedPath (*path, constraints);
97  KinodynamicOrientedPathPtr_t shPtr (ptr);
98  ptr->init (shPtr);
99  ptr->checkPath ();
100  return shPtr;
101  }
102 
107  virtual PathPtr_t copy () const
108  {
109  return createCopy (weak_.lock ());
110  }
111 
116  virtual PathPtr_t copy (const ConstraintSetPtr_t& constraints) const
117  {
118  return createCopy (weak_.lock (), constraints);
119  }
120 
121  bool ignoreZValue() const {return ignoreZValue_;}
122  void ignoreZValue(bool ignoreZValue){ignoreZValue_ = ignoreZValue;}
123 
124  protected:
126  virtual std::ostream& print (std::ostream &os) const
127  {
128  os << "KinodynamicOrientedPath:" << std::endl;
129  os << "interval: [ " << timeRange ().first << ", "
130  << timeRange ().second << " ]" << std::endl;
131  os << "initial configuration: " << pinocchio::displayConfig(initial_ )<< std::endl;
132  os << "final configuration: " << pinocchio::displayConfig(end_) << std::endl;
133  return os;
134  }
135 
136  void orienteInitAndGoal(const DevicePtr_t& device);
137 
141 
145  ConstraintSetPtr_t constraints,bool ignoreZValue);
146 
149 
150 
152  KinodynamicOrientedPath (const KinodynamicPath& path,bool ignoreZValue);
153 
156  const ConstraintSetPtr_t& constraints);
157 
159  {
160  parent_t::init (self);
161  weak_ = self;
162  checkPath ();
163  }
164 
165  virtual bool impl_compute (ConfigurationOut_t result,
166  value_type t) const;
167 
168  virtual PathPtr_t impl_extract (const interval_t& subInterval) const;
169 
170  private:
171  KinodynamicOrientedPathWkPtr_t weak_;
172  bool ignoreZValue_;
173  };//class kinodynamic oriented path
174  }//namespace core
175 }//namespace hpp
176 
177 #endif // HPP_CORE_KINODYNAMIC_ORIENTED_PATH_HH
boost::shared_ptr< Path > PathPtr_t
Definition: fwd.hh:170
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:114
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
Definition: kinodynamic-oriented-path.hh:29
KinodynamicPath parent_t
Definition: kinodynamic-oriented-path.hh:32
boost::shared_ptr< ConstraintSet > ConstraintSetPtr_t
Definition: fwd.hh:110
std::pair< value_type, value_type > interval_t
Definition: fwd.hh:158
static KinodynamicOrientedPathPtr_t create(const DevicePtr_t &device, ConfigurationIn_t init, ConfigurationIn_t end, value_type length, ConfigurationIn_t a1, ConfigurationIn_t t0, ConfigurationIn_t t1, ConfigurationIn_t tv, ConfigurationIn_t t2, ConfigurationIn_t vLim, bool ignoreZValue=false)
Definition: kinodynamic-oriented-path.hh:39
virtual void checkPath() const
Should be called by child classes after having init.
pinocchio::ConfigurationOut_t ConfigurationOut_t
Definition: fwd.hh:98
Definition: kinodynamic-path.hh:45
boost::shared_ptr< KinodynamicOrientedPath > KinodynamicOrientedPathPtr_t
Definition: fwd.hh:190
void ignoreZValue(bool ignoreZValue)
Definition: kinodynamic-oriented-path.hh:122
virtual ~KinodynamicOrientedPath()
Definition: kinodynamic-oriented-path.hh:33
void init(KinodynamicOrientedPathPtr_t self)
Definition: kinodynamic-oriented-path.hh:158
pinocchio::value_type value_type
Definition: fwd.hh:157
virtual PathPtr_t copy() const
Definition: kinodynamic-oriented-path.hh:107
static KinodynamicOrientedPathPtr_t create(const DevicePtr_t &device, ConfigurationIn_t init, ConfigurationIn_t end, value_type length, ConfigurationIn_t a1, ConfigurationIn_t t0, ConfigurationIn_t t1, ConfigurationIn_t tv, ConfigurationIn_t t2, ConfigurationIn_t vLim, ConstraintSetPtr_t constraints, bool ignoreZValue=false)
Definition: kinodynamic-oriented-path.hh:56
static KinodynamicOrientedPathPtr_t create(const KinodynamicPathPtr_t &path, bool ignoreZValue=false)
Definition: kinodynamic-oriented-path.hh:81
Transform3f t
FCL_REAL length[2]
static KinodynamicOrientedPathPtr_t createCopy(const KinodynamicOrientedPathPtr_t &path)
Definition: kinodynamic-oriented-path.hh:72
std::string displayConfig(ConfigurationIn_t q, int precision=20)
bool ignoreZValue() const
Definition: kinodynamic-oriented-path.hh:121
boost::shared_ptr< KinodynamicPath > KinodynamicPathPtr_t
Definition: fwd.hh:188
virtual PathPtr_t copy(const ConstraintSetPtr_t &constraints) const
Definition: kinodynamic-oriented-path.hh:116
virtual std::ostream & print(std::ostream &os) const
Print path in a stream.
Definition: kinodynamic-oriented-path.hh:126