hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
snibud.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_SNIBUD_HH
20 # define HPP_CORE_STEERING_METHOD_SNIBUD_HH
21 
22 # include <hpp/util/debug.hh>
23 # include <hpp/util/pointer.hh>
24 
25 # include <hpp/core/fwd.hh>
26 # include <hpp/core/config.hh>
28 
29 namespace hpp {
30  namespace core {
31  namespace steeringMethod {
34 
37  class HPP_CORE_DLLAPI Snibud : public CarLike
38  {
39  public:
48  static SnibudPtr_t createWithGuess (const Problem& problem)
49  {
50  Snibud* ptr = new Snibud (problem);
51  SnibudPtr_t shPtr (ptr);
52  ptr->init (shPtr);
53  return shPtr;
54  }
55 
59  static SnibudPtr_t create (const Problem& problem,
60  const value_type turningRadius,
61  JointPtr_t xyJoint, JointPtr_t rzJoint,
62  std::vector <JointPtr_t> wheels = std::vector<JointPtr_t>())
63  {
64  Snibud* ptr = new Snibud (problem, turningRadius,
65  xyJoint, rzJoint, wheels);
66  SnibudPtr_t shPtr (ptr);
67  ptr->init (shPtr);
68  return shPtr;
69  }
70 
72  static SnibudPtr_t createCopy
73  (const SnibudPtr_t& other)
74  {
75  Snibud* ptr = new Snibud (*other);
76  SnibudPtr_t shPtr (ptr);
77  ptr->init (shPtr);
78  return shPtr;
79  }
80 
82  virtual SteeringMethodPtr_t copy () const
83  {
84  return createCopy (weak_.lock ());
85  }
86 
88  virtual PathPtr_t impl_compute (ConfigurationIn_t q1,
89  ConfigurationIn_t q2) const;
90 
91  protected:
93  Snibud (const Problem& problem);
94 
96  Snibud (const Problem& problem,
97  const value_type turningRadius,
98  JointPtr_t xyJoint, JointPtr_t rzJoint,
99  std::vector <JointPtr_t> wheels);
100 
102  Snibud (const Snibud& other);
103 
105  void init (SnibudWkPtr_t weak)
106  {
107  CarLike::init (weak);
108  weak_ = weak;
109  }
110 
111  private:
112  SnibudWkPtr_t weak_;
113  }; // Snibud
115  } // namespace steeringMethod
116  } // namespace core
117 } // namespace hpp
118 #endif // HPP_CORE_STEERING_METHOD_SNIBUD_HH
boost::shared_ptr< Path > PathPtr_t
Definition: fwd.hh:170
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
Definition: problem.hh:48
static SnibudPtr_t create(const Problem &problem, const value_type turningRadius, JointPtr_t xyJoint, JointPtr_t rzJoint, std::vector< JointPtr_t > wheels=std::vector< JointPtr_t >())
Definition: snibud.hh:59
Definition: car-like.hh:39
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:133
void init(SnibudWkPtr_t weak)
Store weak pointer to itself.
Definition: snibud.hh:105
Definition: snibud.hh:37
pinocchio::value_type value_type
Definition: fwd.hh:157
void init(CarLikeWkPtr_t weak)
Store weak pointer to itself.
Definition: car-like.hh:75
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: snibud.hh:82
boost::shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:194
boost::shared_ptr< Snibud > SnibudPtr_t
Definition: fwd.hh:38
static SnibudPtr_t createWithGuess(const Problem &problem)
Definition: snibud.hh:48