hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
dubins.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_DUBINS_HH
20 # define HPP_CORE_STEERING_METHOD_DUBINS_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>
29 
30 namespace hpp {
31  namespace core {
32  namespace steeringMethod {
35 
38  class HPP_CORE_DLLAPI Dubins : public CarLike
39  {
40  public:
49  static DubinsPtr_t createWithGuess (const Problem& problem)
50  {
51  Dubins* ptr = new Dubins (problem);
52  DubinsPtr_t shPtr (ptr);
53  ptr->init (shPtr);
54  return shPtr;
55  }
56 
60  static DubinsPtr_t create (const Problem& problem,
61  const value_type turningRadius,
62  JointPtr_t xyJoint, JointPtr_t rzJoint,
63  std::vector <JointPtr_t> wheels = std::vector<JointPtr_t>())
64  {
65  Dubins* ptr = new Dubins (problem, turningRadius,
66  xyJoint, rzJoint, wheels);
67  DubinsPtr_t shPtr (ptr);
68  ptr->init (shPtr);
69  return shPtr;
70  }
71 
73  static DubinsPtr_t createCopy
74  (const DubinsPtr_t& other)
75  {
76  Dubins* ptr = new Dubins (*other);
77  DubinsPtr_t shPtr (ptr);
78  ptr->init (shPtr);
79  return shPtr;
80  }
81 
83  virtual SteeringMethodPtr_t copy () const
84  {
85  return createCopy (weak_.lock ());
86  }
87 
89  virtual PathPtr_t impl_compute (ConfigurationIn_t q1,
90  ConfigurationIn_t q2) const;
91 
92  protected:
94  Dubins (const Problem& problem);
95 
97  Dubins (const Problem& problem,
98  const value_type turningRadius,
99  JointPtr_t xyJoint, JointPtr_t rzJoint,
100  std::vector <JointPtr_t> wheels);
101 
103  Dubins (const Dubins& other);
104 
106  void init (DubinsWkPtr_t weak)
107  {
108  CarLike::init (weak);
109  weak_ = weak;
110  }
111 
112  private:
113  DubinsWkPtr_t weak_;
114  }; // Dubins
116  } // namespace steeringMethod
117  } // namespace core
118 } // namespace hpp
119 #endif // HPP_CORE_STEERING_METHOD_DUBINS_HH
boost::shared_ptr< Path > PathPtr_t
Definition: fwd.hh:170
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
Definition: problem.hh:48
boost::shared_ptr< Dubins > DubinsPtr_t
Definition: fwd.hh:34
static DubinsPtr_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: dubins.hh:60
Definition: dubins.hh:38
Definition: car-like.hh:39
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:133
pinocchio::value_type value_type
Definition: fwd.hh:157
void init(CarLikeWkPtr_t weak)
Store weak pointer to itself.
Definition: car-like.hh:75
void init(DubinsWkPtr_t weak)
Store weak pointer to itself.
Definition: dubins.hh:106
static DubinsPtr_t createWithGuess(const Problem &problem)
Definition: dubins.hh:49
boost::shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:194
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: dubins.hh:83