hpp-core
9.0.2
Implement basic classes for canonical path planning for kinematic chains.
Toggle main menu visibility
Loading...
Searching...
No Matches
partial-shortcut.hh
Go to the documentation of this file.
1
//
2
// Copyright (c) 2015 CNRS
3
// Authors: Joseph Mirabel
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_PATH_OPTIMIZATION_PARTIAL_SHORTCUT_HH
31
#define HPP_CORE_PATH_OPTIMIZATION_PARTIAL_SHORTCUT_HH
32
33
#include <
hpp/core/path-optimizer.hh
>
34
35
namespace
hpp
{
36
namespace
core
{
37
namespace
pathOptimization
{
38
39
typedef
std::vector<JointConstPtr_t>
JointStdVector_t
;
40
43
56
struct
PartialShortcutTraits
{
57
static
bool
removeLockedJoints
() {
return
true
; }
58
static
bool
onlyFullShortcut
() {
return
false
; }
59
static
std::size_t
numberOfConsecutiveFailurePerJoints
() {
return
5; }
60
static
value_type
progressionMargin
() {
return
1e-3; }
61
};
62
63
class
HPP_CORE_DLLAPI
PartialShortcut
:
public
PathOptimizer
{
64
public
:
66
template
<
typename
Traits>
67
static
PartialShortcutPtr_t
createWithTraits
(
68
const
ProblemConstPtr_t
&
problem
);
69
71
static
PartialShortcutPtr_t
create
(
const
ProblemConstPtr_t
&
problem
);
72
74
virtual
PathVectorPtr_t
optimize
(
const
PathVectorPtr_t
&
path
);
75
76
struct
Parameters
{
81
bool
removeLockedJoints
;
82
85
bool
onlyFullShortcut
;
86
90
std::size_t
numberOfConsecutiveFailurePerJoints
;
91
95
value_type
progressionMargin
;
96
97
Parameters
();
98
} parameters;
99
100
protected
:
101
PartialShortcut
(
const
ProblemConstPtr_t
&
problem
);
102
103
private
:
104
PathVectorPtr_t
generatePath(
PathVectorPtr_t
path
,
JointConstPtr_t
joint,
105
const
value_type
t1,
ConfigurationIn_t
q1,
106
const
value_type
t2,
ConfigurationIn_t
q2)
const
;
107
108
JointStdVector_t
generateJointVector(
const
PathVectorPtr_t
& pv)
const
;
109
116
PathVectorPtr_t
optimizeFullPath(
const
PathVectorPtr_t
& pv,
117
const
JointStdVector_t
& jvIn,
118
JointStdVector_t
& jvOut)
const
;
119
124
PathVectorPtr_t
optimizeRandom(
const
PathVectorPtr_t
& pv,
125
const
JointStdVector_t
& jv)
const
;
126
};
// class RandomShortcut
127
128
129
template
<
typename
Traits>
130
PartialShortcutPtr_t
PartialShortcut::createWithTraits
(
131
const
ProblemConstPtr_t
&
problem
) {
132
PartialShortcut
* ptr =
new
PartialShortcut
(
problem
);
133
ptr->
parameters
.
removeLockedJoints
= Traits::removeLockedJoints();
134
ptr->
parameters
.
onlyFullShortcut
= Traits::onlyFullShortcut();
135
ptr->
parameters
.
progressionMargin
= Traits::progressionMargin();
136
ptr->
parameters
.
numberOfConsecutiveFailurePerJoints
=
137
Traits::numberOfConsecutiveFailurePerJoints();
138
return
PartialShortcutPtr_t
(ptr);
139
}
140
}
// namespace pathOptimization
141
}
// namespace core
142
}
// namespace hpp
143
#endif
// HPP_CORE_PATH_OPTIMIZATION_PARTIAL_SHORTCUT_HH
hpp::core::pathOptimization::PartialShortcut::optimize
virtual PathVectorPtr_t optimize(const PathVectorPtr_t &path)
Optimize path.
hpp::core::pathOptimization::PartialShortcut::PartialShortcut
PartialShortcut(const ProblemConstPtr_t &problem)
hpp::core::pathOptimization::PartialShortcut::parameters
struct hpp::core::pathOptimization::PartialShortcut::Parameters parameters
hpp::core::pathOptimization::PartialShortcut::create
static PartialShortcutPtr_t create(const ProblemConstPtr_t &problem)
Return shared pointer to new object.
hpp::core::pathOptimization::PartialShortcut::createWithTraits
static PartialShortcutPtr_t createWithTraits(const ProblemConstPtr_t &problem)
Return shared pointer to new object.
Definition
partial-shortcut.hh:130
HPP_CORE_DLLAPI
#define HPP_CORE_DLLAPI
Definition
config.hh:88
hpp::core::PathOptimizer::problem
ProblemConstPtr_t problem() const
Get problem.
Definition
path-optimizer.hh:49
hpp::core::PathOptimizer::PathOptimizer
PathOptimizer(const ProblemConstPtr_t &problem)
hpp
hpp::core::pathOptimization
Definition
fwd.hh:289
hpp::core::pathOptimization::JointStdVector_t
std::vector< JointConstPtr_t > JointStdVector_t
Definition
partial-shortcut.hh:39
hpp::core::pathOptimization::PartialShortcutPtr_t
shared_ptr< PartialShortcut > PartialShortcutPtr_t
Definition
fwd.hh:301
hpp::core::path
Definition
fwd.hh:242
hpp::core
Definition
bi-rrt-planner.hh:36
hpp::core::value_type
pinocchio::value_type value_type
Definition
fwd.hh:174
hpp::core::PathVectorPtr_t
shared_ptr< PathVector > PathVectorPtr_t
Definition
fwd.hh:193
hpp::core::JointConstPtr_t
pinocchio::JointConstPtr_t JointConstPtr_t
Definition
fwd.hh:150
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
path-optimizer.hh
hpp::core::pathOptimization::PartialShortcutTraits
Definition
partial-shortcut.hh:56
hpp::core::pathOptimization::PartialShortcutTraits::progressionMargin
static value_type progressionMargin()
Definition
partial-shortcut.hh:60
hpp::core::pathOptimization::PartialShortcutTraits::numberOfConsecutiveFailurePerJoints
static std::size_t numberOfConsecutiveFailurePerJoints()
Definition
partial-shortcut.hh:59
hpp::core::pathOptimization::PartialShortcutTraits::removeLockedJoints
static bool removeLockedJoints()
Definition
partial-shortcut.hh:57
hpp::core::pathOptimization::PartialShortcutTraits::onlyFullShortcut
static bool onlyFullShortcut()
Definition
partial-shortcut.hh:58
hpp::core::pathOptimization::PartialShortcut::Parameters::Parameters
Parameters()
hpp::core::pathOptimization::PartialShortcut::Parameters::onlyFullShortcut
bool onlyFullShortcut
Definition
partial-shortcut.hh:85
hpp::core::pathOptimization::PartialShortcut::Parameters::removeLockedJoints
bool removeLockedJoints
Definition
partial-shortcut.hh:81
hpp::core::pathOptimization::PartialShortcut::Parameters::numberOfConsecutiveFailurePerJoints
std::size_t numberOfConsecutiveFailurePerJoints
Definition
partial-shortcut.hh:90
hpp::core::pathOptimization::PartialShortcut::Parameters::progressionMargin
value_type progressionMargin
Definition
partial-shortcut.hh:95
include
hpp
core
path-optimization
partial-shortcut.hh
Generated by
1.17.0