hpp-manipulation  4.9.0
Classes for manipulation planning.
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 // This file is part of hpp-manipulation.
6 // hpp-manipulation 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-manipulation 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-manipulation. If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef HPP_MANIPULATION_STEERING_METHOD_CROSS_STATE_OPTIMIZATION_HH
19 # define HPP_MANIPULATION_STEERING_METHOD_CROSS_STATE_OPTIMIZATION_HH
20 
21 # include <hpp/core/steering-method.hh>
22 # include <hpp/core/config-projector.hh>
23 
24 # include <hpp/manipulation/config.hh>
25 # include <hpp/manipulation/fwd.hh>
29 
30 namespace hpp {
31  namespace manipulation {
32  namespace steeringMethod {
35 
86  class HPP_MANIPULATION_DLLAPI CrossStateOptimization :
87  public SteeringMethod
88  {
89  public:
90  struct OptimizationData;
91 
93 
96  (const core::Problem& problem);
97 
98  template <typename T>
100  (const core::Problem& problem);
101 
103 
104  protected:
105  CrossStateOptimization (const Problem& problem) :
106  SteeringMethod (problem),
107  sameRightHandSide_ ()
108  {
109  gatherGraphConstraints ();
110  }
111 
113  SteeringMethod (other), constraints_ (other.constraints_),
114  index_ (other.index_), sameRightHandSide_
115  (other.sameRightHandSide_), weak_ ()
116  {}
117 
119 
120  void init (CrossStateOptimizationWkPtr_t weak)
121  {
122  SteeringMethod::init (weak);
123  weak_ = weak;
124  }
125 
126  private:
128  struct GraphSearchData;
129 
131  void gatherGraphConstraints ();
132 
135  bool findTransitions (GraphSearchData& data) const;
136 
138  graph::Edges_t getTransitionList (GraphSearchData& data, const std::size_t& i) const;
139 
141  bool buildOptimizationProblem
142  (OptimizationData& d, const graph::Edges_t& transitions) const;
143 
145  bool solveOptimizationProblem (OptimizationData& d) const;
146 
147  bool checkConstantRightHandSide (OptimizationData& d,
148  size_type index) const;
149 
150  core::PathVectorPtr_t buildPath (OptimizationData& d, const graph::Edges_t& edges) const;
151 
152  bool contains (const Solver_t& solver, const ImplicitPtr_t& c) const;
153 
155  NumericalConstraints_t constraints_;
157  std::map < std::string, std::size_t > index_;
158 
161  std::map <ImplicitPtr_t, ImplicitPtr_t> sameRightHandSide_;
162 
164  CrossStateOptimizationWkPtr_t weak_;
165  }; // class CrossStateOptimization
167 
168  template <typename T>
171  {
173  gsm->innerSteeringMethod (T::create (problem));
174  return gsm;
175  }
176  } // namespace steeringMethod
177  } // namespace manipulation
178 } // namespace hpp
179 
180 #endif // HPP_MANIPULATION_STEERING_METHOD_CROSS_STATE_OPTIMIZATION_HH
boost::shared_ptr< Path > PathPtr_t
std::vector< EdgePtr_t > Edges_t
Definition: fwd.hh:46
static CrossStateOptimizationPtr_t create(const Problem &problem)
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:38
Definition: problem.hh:32
Vec3f c
void init(SteeringMethodWkPtr_t weak)
Definition: graph.hh:53
Definition: cross-state-optimization.hh:86
FCL_REAL d
const Problem & problem() const
constraints::ImplicitPtr_t ImplicitPtr_t
Definition: fwd.hh:105
core::NumericalConstraints_t NumericalConstraints_t
Definition: fwd.hh:117
static GradientBasedPtr_t create(const Problem &problem)
CrossStateOptimization(const CrossStateOptimization &other)
Definition: cross-state-optimization.hh:112
core::size_type size_type
Definition: fwd.hh:80
boost::shared_ptr< PathVector > PathVectorPtr_t
boost::shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: graph.hh:33
boost::shared_ptr< CrossStateOptimization > CrossStateOptimizationPtr_t
Definition: fwd.hh:32
void init(CrossStateOptimizationWkPtr_t weak)
Definition: cross-state-optimization.hh:120
CrossStateOptimization(const Problem &problem)
Definition: cross-state-optimization.hh:105
void impl_compute(result_ref, const_argument_ref) const
virtual SteeringMethodPtr_t copy() const