hpp-core  6.0.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 
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are
8 // met:
9 //
10 // 1. Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 //
13 // 2. Redistributions in binary form must reproduce the above copyright
14 // notice, this list of conditions and the following disclaimer in the
15 // documentation and/or other materials provided with the distribution.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28 // DAMAGE.
29 
30 #ifndef HPP_CORE_STEERING_METHOD_STRAIGHT_HH
31 #define HPP_CORE_STEERING_METHOD_STRAIGHT_HH
32 
33 #include <hpp/core/config.hh>
34 #include <hpp/core/fwd.hh>
37 
38 namespace hpp {
39 namespace core {
40 namespace steeringMethod {
43 
47  public:
49  static StraightPtr_t create(const ProblemConstPtr_t& problem) {
50  Straight* ptr = new Straight(problem);
51  StraightPtr_t shPtr(ptr);
52  ptr->init(shPtr);
53  return shPtr;
54  }
56  static StraightPtr_t createCopy(const StraightPtr_t& other) {
57  Straight* ptr = new Straight(*other);
58  StraightPtr_t shPtr(ptr);
59  ptr->init(shPtr);
60  return shPtr;
61  }
63  virtual SteeringMethodPtr_t copy() const { return createCopy(weak_.lock()); }
64 
67  ConfigurationIn_t q2) const;
68 
69  protected:
72  Straight(const ProblemConstPtr_t& problem)
73  : SteeringMethod(problem), weak_() {}
75  Straight(const Straight& other) : SteeringMethod(other), weak_() {}
76 
78  void init(StraightWkPtr_t weak) {
80  weak_ = weak;
81  }
82 
83  private:
84  StraightWkPtr_t weak_;
85 }; // Straight
86 } // namespace steeringMethod
88 } // namespace core
89 } // namespace hpp
90 #endif // HPP_CORE_STEERING_METHOD_STRAIGHT_HH
Definition: steering-method.hh:48
void init(SteeringMethodWkPtr_t weak)
Store weak pointer to itself.
Definition: steering-method.hh:110
Definition: straight.hh:46
#define HPP_CORE_DLLAPI
Definition: config.hh:88
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition: straight.hh:63
Straight(const ProblemConstPtr_t &problem)
Definition: straight.hh:72
virtual PathPtr_t impl_compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
create a path between two configurations
void init(StraightWkPtr_t weak)
Store weak pointer to itself.
Definition: straight.hh:78
static StraightPtr_t create(const ProblemConstPtr_t &problem)
Create instance and return shared pointer.
Definition: straight.hh:49
static StraightPtr_t createCopy(const StraightPtr_t &other)
Copy instance and return shared pointer.
Definition: straight.hh:56
Straight(const Straight &other)
Copy constructor.
Definition: straight.hh:75
shared_ptr< Straight > StraightPtr_t
Definition: fwd.hh:37
shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:213
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:108
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:197
shared_ptr< Path > PathPtr_t
Definition: fwd.hh:187
Definition: bi-rrt-planner.hh:35