hpp-manipulation  4.11.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 
25 # include <hpp/manipulation/fwd.hh>
29 
30 namespace hpp {
31  namespace manipulation {
32  namespace steeringMethod {
35 
87  public SteeringMethod
88  {
89  public:
90  struct OptimizationData;
91 
92  static CrossStateOptimizationPtr_t create
93  (const ProblemConstPtr_t& problem);
94 
96  static CrossStateOptimizationPtr_t create
97  (const core::ProblemConstPtr_t& problem);
98 
99  template <typename T>
100  static CrossStateOptimizationPtr_t create
101  (const core::ProblemConstPtr_t& problem);
102 
103  core::SteeringMethodPtr_t copy () const;
104 
105  protected:
107  SteeringMethod (problem),
108  sameRightHandSide_ ()
109  {
110  gatherGraphConstraints ();
111  }
112 
114  SteeringMethod (other), constraints_ (other.constraints_),
115  index_ (other.index_), sameRightHandSide_
116  (other.sameRightHandSide_), weak_ ()
117  {}
118 
119  core::PathPtr_t impl_compute (ConfigurationIn_t q1, ConfigurationIn_t q2) const;
120 
121  void init (CrossStateOptimizationWkPtr_t weak)
122  {
123  SteeringMethod::init (weak);
124  weak_ = weak;
125  }
126 
127  private:
128  typedef constraints::solver::BySubstitution Solver_t;
129  struct GraphSearchData;
130 
132  void gatherGraphConstraints ();
133 
136  bool findTransitions (GraphSearchData& data) const;
137 
139  graph::Edges_t getTransitionList (GraphSearchData& data, const std::size_t& i) const;
140 
142  bool buildOptimizationProblem
143  (OptimizationData& d, const graph::Edges_t& transitions) const;
144 
146  bool solveOptimizationProblem (OptimizationData& d) const;
147 
148  bool checkConstantRightHandSide (OptimizationData& d,
149  size_type index) const;
150 
151  core::PathVectorPtr_t buildPath (OptimizationData& d, const graph::Edges_t& edges) const;
152 
153  bool contains (const Solver_t& solver, const ImplicitPtr_t& c) const;
154 
156  NumericalConstraints_t constraints_;
158  std::map < std::string, std::size_t > index_;
159 
162  std::map <ImplicitPtr_t, ImplicitPtr_t> sameRightHandSide_;
163 
165  CrossStateOptimizationWkPtr_t weak_;
166  }; // class CrossStateOptimization
168 
169  template <typename T>
171  (const core::ProblemConstPtr_t& problem)
172  {
174  (problem);
175  gsm->innerSteeringMethod (T::create (problem));
176  return gsm;
177  }
178  } // namespace steeringMethod
179  } // namespace manipulation
180 } // namespace hpp
181 
182 #endif // HPP_MANIPULATION_STEERING_METHOD_CROSS_STATE_OPTIMIZATION_HH
CrossStateOptimization(const ProblemConstPtr_t &problem)
Definition: cross-state-optimization.hh:106
std::vector< EdgePtr_t > Edges_t
Definition: fwd.hh:46
shared_ptr< SteeringMethod > SteeringMethodPtr_t
Definition: fwd.hh:93
shared_ptr< CrossStateOptimization > CrossStateOptimizationPtr_t
Definition: fwd.hh:32
Definition: main.hh:1
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:38
static CrossStateOptimizationPtr_t create(const ProblemConstPtr_t &problem)
shared_ptr< const Problem > ProblemConstPtr_t
Definition: fwd.hh:56
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
void init(SteeringMethodWkPtr_t weak)
Definition: graph.hh:53
Definition: cross-state-optimization.hh:86
constraints::ImplicitPtr_t ImplicitPtr_t
Definition: fwd.hh:108
core::NumericalConstraints_t NumericalConstraints_t
Definition: fwd.hh:120
CrossStateOptimization(const CrossStateOptimization &other)
Definition: cross-state-optimization.hh:113
core::size_type size_type
Definition: fwd.hh:83
Definition: graph.hh:33
void init(CrossStateOptimizationWkPtr_t weak)
Definition: cross-state-optimization.hh:121