hpp-manipulation
9.0.2
Classes for manipulation planning.
Toggle main menu visibility
Loading...
Searching...
No Matches
cross-state-optimization.hh
Go to the documentation of this file.
1
// Copyright (c) 2017, Joseph Mirabel
2
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr),
3
// Florent Lamiraux (florent.lamiraux@laas.fr)
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_MANIPULATION_STEERING_METHOD_CROSS_STATE_OPTIMIZATION_HH
31
#define HPP_MANIPULATION_STEERING_METHOD_CROSS_STATE_OPTIMIZATION_HH
32
33
#include <
hpp/core/config-projector.hh
>
34
#include <
hpp/core/steering-method.hh
>
35
#include <
hpp/manipulation/config.hh
>
36
#include <
hpp/manipulation/fwd.hh
>
37
#include <
hpp/manipulation/problem.hh
>
38
#include <
hpp/manipulation/steering-method/fwd.hh
>
39
#include <
hpp/manipulation/steering-method/graph.hh
>
40
41
namespace
hpp
{
42
namespace
manipulation
{
43
namespace
steeringMethod
{
46
99
class
HPP_MANIPULATION_DLLAPI
CrossStateOptimization
:
public
SteeringMethod
{
100
public
:
101
struct
OptimizationData;
102
103
static
CrossStateOptimizationPtr_t
create
(
const
ProblemConstPtr_t
&
problem
);
104
106
static
CrossStateOptimizationPtr_t
create
(
107
const
core::ProblemConstPtr_t
&
problem
);
108
109
template
<
typename
T>
110
static
CrossStateOptimizationPtr_t
create
(
111
const
core::ProblemConstPtr_t
&
problem
);
112
113
core::SteeringMethodPtr_t
copy
()
const
;
114
115
protected
:
116
CrossStateOptimization
(
const
ProblemConstPtr_t
&
problem
)
117
:
SteeringMethod
(
problem
), sameRightHandSide_() {
118
gatherGraphConstraints();
119
}
120
121
CrossStateOptimization
(
const
CrossStateOptimization
& other)
122
:
SteeringMethod
(other),
123
constraints_(other.constraints_),
124
index_(other.index_),
125
sameRightHandSide_(other.sameRightHandSide_),
126
weak_() {}
127
128
core::PathPtr_t
impl_compute
(
ConfigurationIn_t
q1,
129
ConfigurationIn_t
q2)
const
;
130
131
void
init
(CrossStateOptimizationWkPtr_t weak) {
132
SteeringMethod::init
(weak);
133
weak_ = weak;
134
}
135
136
private
:
137
typedef
constraints::solver::BySubstitution
Solver_t;
138
struct
GraphSearchData;
139
141
void
gatherGraphConstraints();
142
145
bool
findTransitions(GraphSearchData& data)
const
;
146
148
graph::Edges_t
getTransitionList(GraphSearchData& data,
149
const
std::size_t& i)
const
;
150
152
bool
buildOptimizationProblem(OptimizationData& d,
153
const
graph::Edges_t
& transitions)
const
;
154
156
bool
solveOptimizationProblem(OptimizationData& d)
const
;
157
158
bool
checkConstantRightHandSide(OptimizationData& d,
size_type
index)
const
;
159
160
core::PathVectorPtr_t
buildPath(OptimizationData& d,
161
const
graph::Edges_t
& edges)
const
;
162
163
bool
contains(
const
Solver_t& solver,
const
ImplicitPtr_t
& c)
const
;
164
166
NumericalConstraints_t
constraints_;
168
std::map<std::string, std::size_t> index_;
169
172
std::map<ImplicitPtr_t, ImplicitPtr_t> sameRightHandSide_;
173
175
CrossStateOptimizationWkPtr_t weak_;
176
};
// class CrossStateOptimization
177
178
179
template
<
typename
T>
180
CrossStateOptimizationPtr_t
CrossStateOptimization::create
(
181
const
core::ProblemConstPtr_t
&
problem
) {
182
CrossStateOptimizationPtr_t
gsm =
CrossStateOptimization::create
(
problem
);
183
gsm->innerSteeringMethod(T::create(
problem
));
184
return
gsm;
185
}
186
}
// namespace steeringMethod
187
}
// namespace manipulation
188
}
// namespace hpp
189
190
#endif
// HPP_MANIPULATION_STEERING_METHOD_CROSS_STATE_OPTIMIZATION_HH
hpp::constraints::solver::BySubstitution
hpp::core::SteeringMethod::problem
ProblemConstPtr_t problem() const
hpp::manipulation::SteeringMethod::SteeringMethod
SteeringMethod(const ProblemConstPtr_t &problem)
Constructor.
hpp::manipulation::SteeringMethod::init
void init(SteeringMethodWkPtr_t weak)
Definition
graph.hh:60
hpp::manipulation::steeringMethod::CrossStateOptimization::create
static CrossStateOptimizationPtr_t create(const ProblemConstPtr_t &problem)
hpp::manipulation::steeringMethod::CrossStateOptimization::impl_compute
core::PathPtr_t impl_compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
hpp::manipulation::steeringMethod::CrossStateOptimization::init
void init(CrossStateOptimizationWkPtr_t weak)
Definition
cross-state-optimization.hh:131
hpp::manipulation::steeringMethod::CrossStateOptimization::copy
core::SteeringMethodPtr_t copy() const
hpp::manipulation::steeringMethod::CrossStateOptimization::create
static CrossStateOptimizationPtr_t create(const core::ProblemConstPtr_t &problem)
hpp::manipulation::steeringMethod::CrossStateOptimization::CrossStateOptimization
CrossStateOptimization(const ProblemConstPtr_t &problem)
Definition
cross-state-optimization.hh:116
hpp::manipulation::steeringMethod::CrossStateOptimization::CrossStateOptimization
CrossStateOptimization(const CrossStateOptimization &other)
Definition
cross-state-optimization.hh:121
config-projector.hh
config.hh
HPP_MANIPULATION_DLLAPI
#define HPP_MANIPULATION_DLLAPI
Definition
config.hh:88
fwd.hh
create
static GradientBasedPtr_t create(const ProblemConstPtr_t &problem)
hpp::constraints::ImplicitPtr_t
shared_ptr< Implicit > ImplicitPtr_t
hpp::core::PathVectorPtr_t
shared_ptr< PathVector > PathVectorPtr_t
hpp::core::SteeringMethodPtr_t
shared_ptr< SteeringMethod > SteeringMethodPtr_t
hpp::core::ProblemConstPtr_t
shared_ptr< const Problem > ProblemConstPtr_t
hpp::core::PathPtr_t
shared_ptr< Path > PathPtr_t
hpp::manipulation::graph::Edges_t
std::vector< EdgePtr_t > Edges_t
Definition
fwd.hh:57
hpp::manipulation::steeringMethod
Definition
fwd.hh:113
hpp::manipulation::steeringMethod::CrossStateOptimizationPtr_t
shared_ptr< CrossStateOptimization > CrossStateOptimizationPtr_t
Definition
fwd.hh:43
hpp::manipulation
Definition
main.hh:2
hpp::manipulation::NumericalConstraints_t
core::NumericalConstraints_t NumericalConstraints_t
Definition
fwd.hh:143
hpp::manipulation::ProblemConstPtr_t
shared_ptr< const Problem > ProblemConstPtr_t
Definition
fwd.hh:66
hpp::manipulation::size_type
core::size_type size_type
Definition
fwd.hh:90
hpp::manipulation::ConfigurationIn_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition
fwd.hh:49
hpp
problem.hh
fwd.hh
graph.hh
steering-method.hh
include
hpp
manipulation
steering-method
cross-state-optimization.hh
Generated by
1.17.0