hpp-core  4.9.0
Implement basic classes for canonical path planning for kinematic chains.
straight.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 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_STRAIGHT_HH
20 # define HPP_CORE_STEERING_METHOD_STRAIGHT_HH
21 
22 # include <hpp/core/config.hh>
23 # include <hpp/core/fwd.hh>
26 
27 namespace hpp {
28  namespace core {
29  namespace steeringMethod {
32 
35  class HPP_CORE_DLLAPI Straight : public SteeringMethod
36  {
37  public:
39  static StraightPtr_t create (const Problem& problem)
40  {
41  Straight* ptr = new Straight (problem);
42  StraightPtr_t shPtr (ptr);
43  ptr->init (shPtr);
44  return shPtr;
45  }
47  static StraightPtr_t createCopy
48  (const StraightPtr_t& other)
49  {
50  Straight* ptr = new Straight (*other);
51  StraightPtr_t shPtr (ptr);
52  ptr->init (shPtr);
53  return shPtr;
54  }
56  virtual SteeringMethodPtr_t copy () const
57  {
58  return createCopy (weak_.lock ());
59  }
60 
62  virtual PathPtr_t impl_compute (ConfigurationIn_t q1,
63  ConfigurationIn_t q2) const;
64 
65  protected:
68  Straight (const Problem& problem) :
69  SteeringMethod (problem), weak_ ()
70  {
71  }
73  Straight (const Straight& other) :
74  SteeringMethod (other), weak_ ()
75  {
76  }
77 
79  void init (StraightWkPtr_t weak)
80  {
81  SteeringMethod::init (weak);
82  weak_ = weak;
83  }
84 
85  private:
86 
87  StraightWkPtr_t weak_;
88  }; // Straight
89  }
91  } // namespace core
92 } // namespace hpp
93 #endif // HPP_CORE_STEERING_METHOD_STRAIGHT_HH
boost::shared_ptr< Path > PathPtr_t
Definition: fwd.hh:170
void init(StraightWkPtr_t weak)
Store weak pointer to itself.
Definition: straight.hh:79
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
Definition: problem.hh:48
Definition: steering-method.hh:38
Definition: straight.hh:35
void init(SteeringMethodWkPtr_t weak)
Store weak pointer to itself.
Definition: steering-method.hh:114
Straight(const Straight &other)
Copy constructor.
Definition: straight.hh:73
static StraightPtr_t create(const Problem &problem)
Create instance and return shared pointer.
Definition: straight.hh:39
boost::shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:194
boost::shared_ptr< Straight > StraightPtr_t
Definition: fwd.hh:26
Straight(const Problem &problem)
Definition: straight.hh:68
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: straight.hh:56