hpp-core: include/hpp/core/steering-method/straight.hh Source File

hpp-core 9.0.2 Implement basic classes for canonical path planning for kinematic chains.

Loading...
Searching...
No Matches
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>
35#include <hpp/core/steering-method.hh>
36#include <hpp/core/steering-method/fwd.hh>
37
38namespace hpp {
39namespace core {
40namespace steeringMethod {
43
46 class HPP_CORE_DLLAPI Straight : public SteeringMethod {
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
66 virtual PathPtr_t impl_compute(ConfigurationIn_t q1,
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) {
79 SteeringMethod::init(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
hpp::core::SteeringMethod
Definition steering-method.hh:48
hpp::core::steeringMethod::Straight
Definition straight.hh:46
config.hh
HPP_CORE_DLLAPI
#define HPP_CORE_DLLAPI
Definition config.hh:88
fwd.hh
hpp::core::steeringMethod::Straight::copy
virtual SteeringMethodPtr_t copy() const
Copy instance and return shared pointer.
Definition straight.hh:63
hpp::core::steeringMethod::Straight::Straight
Straight(const ProblemConstPtr_t &problem)
Definition straight.hh:72
hpp::core::steeringMethod::Straight::impl_compute
virtual PathPtr_t impl_compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
create a path between two configurations
hpp::core::steeringMethod::Straight::init
void init(StraightWkPtr_t weak)
Store weak pointer to itself.
Definition straight.hh:78
hpp::core::steeringMethod::Straight::create
static StraightPtr_t create(const ProblemConstPtr_t &problem)
Create instance and return shared pointer.
Definition straight.hh:49
hpp::core::steeringMethod::Straight::createCopy
static StraightPtr_t createCopy(const StraightPtr_t &other)
Copy instance and return shared pointer.
Definition straight.hh:56
hpp::core::steeringMethod::Straight::Straight
Straight(const Straight &other)
Copy constructor.
Definition straight.hh:75
hpp
hpp::core::steeringMethod::StraightPtr_t
shared_ptr< Straight > StraightPtr_t
Definition fwd.hh:37
hpp::core::SteeringMethodPtr_t
shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition fwd.hh:213
hpp::core::ConfigurationIn_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition fwd.hh:108
hpp::core::ProblemConstPtr_t
shared_ptr< const Problem > ProblemConstPtr_t
Definition fwd.hh:197
hpp::core::PathPtr_t
shared_ptr< Path > PathPtr_t
Definition fwd.hh:187
fwd.hh
steering-method.hh