hpp-core  4.11.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 
38  {
39  public:
48  static ReedsSheppPtr_t createWithGuess
49  (const ProblemConstPtr_t& problem)
50  {
51  ReedsShepp* ptr = new ReedsShepp (problem);
52  ReedsSheppPtr_t shPtr (ptr);
53  ptr->init (shPtr);
54  return shPtr;
55  }
56 
60  static ReedsSheppPtr_t create (const ProblemConstPtr_t& 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  ReedsShepp* ptr = new ReedsShepp (problem, turningRadius,
66  xyJoint, rzJoint, wheels);
67  ReedsSheppPtr_t shPtr (ptr);
68  ptr->init (shPtr);
69  return shPtr;
70  }
71 
73  static ReedsSheppPtr_t createCopy
74  (const ReedsSheppPtr_t& other)
75  {
76  ReedsShepp* ptr = new ReedsShepp (*other);
77  ReedsSheppPtr_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  ReedsShepp (const ProblemConstPtr_t& problem);
95 
97  ReedsShepp (const ProblemConstPtr_t& problem,
98  const value_type turningRadius,
99  JointPtr_t xyJoint, JointPtr_t rzJoint,
100  std::vector <JointPtr_t> wheels);
101 
103  ReedsShepp (const ReedsShepp& other);
104 
106  void init (ReedsSheppWkPtr_t weak)
107  {
108  CarLike::init (weak);
109  weak_ = weak;
110  }
111 
112  private:
113  WeighedDistancePtr_t weighedDistance_;
114  ReedsSheppWkPtr_t weak_;
115  }; // class ReedsShepp
116 
126  value_type extraLength, value_type rho, size_type xyId, size_type rzId,
127  const std::vector<JointPtr_t> wheels, ConstraintSetPtr_t constraints,
128  bool computeDistance, value_type& distance);
129 
131  } // namespace steeringMethod
132  } // namespace core
133 } // namespace hpp
134 #endif // HPP_CORE_STEERING_METHOD_REEDS_SHEPP_HH
pinocchio::DevicePtr_t DevicePtr_t
Definition: fwd.hh:114
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
shared_ptr< WeighedDistance > WeighedDistancePtr_t
Definition: fwd.hh:208
shared_ptr< PathVector > PathVectorPtr_t
Definition: fwd.hh:176
Definition: bi-rrt-planner.hh:24
pinocchio::size_type size_type
Definition: fwd.hh:156
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:180
Definition: car-like.hh:39
pinocchio::JointPtr_t JointPtr_t
Definition: fwd.hh:133
shared_ptr< ConstraintSet > ConstraintSetPtr_t
Definition: fwd.hh:110
PathVectorPtr_t reedsSheppPathOrDistance(const DevicePtr_t &device, ConfigurationIn_t init, ConfigurationIn_t end, value_type extraLength, value_type rho, size_type xyId, size_type rzId, const std::vector< JointPtr_t > wheels, ConstraintSetPtr_t constraints, bool computeDistance, value_type &distance)
pinocchio::value_type value_type
Definition: fwd.hh:157
shared_ptr< ReedsShepp > ReedsSheppPtr_t
Definition: fwd.hh:323
void init(ReedsSheppWkPtr_t weak)
Store weak pointer to itself.
Definition: reeds-shepp.hh:106
void init(CarLikeWkPtr_t weak)
Store weak pointer to itself.
Definition: car-like.hh:69
shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:195
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: reeds-shepp.hh:83
Definition: reeds-shepp.hh:37
#define HPP_CORE_DLLAPI
Definition: config.hh:64
shared_ptr< Path > PathPtr_t
Definition: fwd.hh:170
static ReedsSheppPtr_t create(const ProblemConstPtr_t &problem, const value_type turningRadius, JointPtr_t xyJoint, JointPtr_t rzJoint, std::vector< JointPtr_t > wheels=std::vector< JointPtr_t >())
Definition: reeds-shepp.hh:60