hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
reeds-shepp.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015 CNRS
3 // Authors: Joseph Mirabel
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_REEDS_SHEPP_HH
20 # define HPP_CORE_STEERING_METHOD_REEDS_SHEPP_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 ReedsShepp : public CarLike
38  {
39  public:
48  static ReedsSheppPtr_t createWithGuess (const Problem& problem)
49  {
50  ReedsShepp* ptr = new ReedsShepp (problem);
51  ReedsSheppPtr_t shPtr (ptr);
52  ptr->init (shPtr);
53  return shPtr;
54  }
55 
59  static ReedsSheppPtr_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  ReedsShepp* ptr = new ReedsShepp (problem, turningRadius,
65  xyJoint, rzJoint, wheels);
66  ReedsSheppPtr_t shPtr (ptr);
67  ptr->init (shPtr);
68  return shPtr;
69  }
70 
72  static ReedsSheppPtr_t createCopy
73  (const ReedsSheppPtr_t& other)
74  {
75  ReedsShepp* ptr = new ReedsShepp (*other);
76  ReedsSheppPtr_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  ReedsShepp (const Problem& problem);
94 
96  ReedsShepp (const Problem& problem,
97  const value_type turningRadius,
98  JointPtr_t xyJoint, JointPtr_t rzJoint,
99  std::vector <JointPtr_t> wheels);
100 
102  ReedsShepp (const ReedsShepp& other);
103 
105  void init (ReedsSheppWkPtr_t weak)
106  {
107  CarLike::init (weak);
108  weak_ = weak;
109  }
110 
111  private:
112  ReedsSheppWkPtr_t weak_;
113  }; // ReedsShepp
115  } // namespace steeringMethod
116  } // namespace core
117 } // namespace hpp
118 #endif // HPP_CORE_STEERING_METHOD_REEDS_SHEPP_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< ReedsShepp > ReedsSheppPtr_t
Definition: fwd.hh:322
Definition: car-like.hh:39
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:133
static ReedsSheppPtr_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: reeds-shepp.hh:59
pinocchio::value_type value_type
Definition: fwd.hh:157
void init(ReedsSheppWkPtr_t weak)
Store weak pointer to itself.
Definition: reeds-shepp.hh:105
void init(CarLikeWkPtr_t weak)
Store weak pointer to itself.
Definition: car-like.hh:75
static ReedsSheppPtr_t createWithGuess(const Problem &problem)
Definition: reeds-shepp.hh:48
boost::shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:194
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: reeds-shepp.hh:82
Definition: reeds-shepp.hh:37