hpp-manipulation  4.9.0
Classes for manipulation planning.
problem-solver.hh
Go to the documentation of this file.
1 // Copyright (c) 2014 CNRS
2 // Author: Florent Lamiraux, Joseph Mirabel
3 //
4 // This file is part of hpp-manipulation-corba.
5 // hpp-manipulation-corba is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-manipulation-corba is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-manipulation-corba. If not, see
16 // <http://www.gnu.org/licenses/>.
17 
18 #ifndef HPP_MANIPULATION_PROBLEM_SOLVER_HH
19 # define HPP_MANIPULATION_PROBLEM_SOLVER_HH
20 
21 # include <map>
22 # include <hpp/pinocchio/device.hh>
23 # include <hpp/core/problem-solver.hh>
24 # include <hpp/core/container.hh>
26 # include "hpp/manipulation/fwd.hh"
27 # include "hpp/manipulation/deprecated.hh"
30 
31 namespace hpp {
32  namespace manipulation {
33  class HPP_MANIPULATION_DLLAPI ProblemSolver :
34  public core::ProblemSolver
35  {
36  public:
38  typedef std::vector <std::string> Names_t;
39 
41  virtual ~ProblemSolver ()
42  {}
43 
44  ProblemSolver ();
45 
46  static ProblemSolverPtr_t create ();
47 
50  virtual void robot (const core::DevicePtr_t& robot)
51  {
53  assert (robot_);
54  parent_t::robot (robot);
55  }
56 
58  const DevicePtr_t& robot () const
59  {
60  return robot_;
61  }
62 
65 
67  void constraintGraph (const std::string& graph);
68 
70  graph::GraphPtr_t constraintGraph () const;
71 
73  void initConstraintGraph ();
75 
82  void createPlacementConstraint (const std::string& name,
83  const StringList_t& surface1,
84  const StringList_t& surface2,
85  const value_type& margin = 1e-4);
86 
94  void createPrePlacementConstraint (const std::string& name,
95  const StringList_t& surface1,
96  const StringList_t& surface2,
97  const value_type& width,
98  const value_type& margin = 1e-4);
99 
108  void createGraspConstraint (const std::string& name,
109  const std::string& gripper,
110  const std::string& handle);
111 
117  void createPreGraspConstraint (const std::string& name,
118  const std::string& gripper,
119  const std::string& handle);
120 
121  virtual void pathValidationType (const std::string& type,
122  const value_type& tolerance);
123 
125  virtual void resetProblem ();
126 
128  virtual void resetRoadmap ();
129 
132  {
133  return problem_;
134  }
135 
136  void setTargetState (const graph::StatePtr_t state);
137 
139 
141 
142  protected:
143  virtual void initializeProblem (ProblemPtr_t problem);
144 
145  private:
148  graph::GraphComponents_t components_;
149 
152  ProblemPtr_t problem_;
153  graph::GraphPtr_t constraintGraph_;
154  }; // class ProblemSolver
155  } // namespace manipulation
156 } // namespace hpp
157 
158 #endif // HPP_MANIPULATION_PROBLEM_SOLVER_HH
pinocchio::DevicePtr_t DevicePtr_t
DevicePtr_t robot_
ConstraintsAndComplements_t constraintsAndComplements
Definition: problem-solver.hh:140
core::Container< graph::GraphPtr_t > graphs
Definition: problem-solver.hh:138
boost::shared_ptr< State > StatePtr_t
Definition: fwd.hh:36
#define HPP_DYNAMIC_PTR_CAST(t, x)
core::value_type value_type
Definition: fwd.hh:79
std::vector< ConstraintAndComplement_t > ConstraintsAndComplements_t
Definition: constraint-set.hh:79
std::vector< std::string > Names_t
Definition: problem-solver.hh:38
assert(d.lhs()._blocks()==d.rhs()._blocks())
boost::shared_ptr< Problem > ProblemPtr_t
Definition: fwd.hh:55
Definition: device.hh:38
boost::shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:29
const DevicePtr_t & robot() const
Get robot.
Definition: problem-solver.hh:58
virtual ~ProblemSolver()
Destructor.
Definition: problem-solver.hh:41
ProblemPtr_t problem() const
Get pointer to problem.
Definition: problem-solver.hh:131
const Problem & problem() const
static GradientBasedPtr_t create(const Problem &problem)
std::list< std::string > StringList_t
Definition: fwd.hh:132
boost::shared_ptr< Graph > GraphPtr_t
Definition: fwd.hh:35
std::vector< GraphComponentWkPtr_t > GraphComponents_t
Definition: fwd.hh:44
FCL_REAL width() const
core::ProblemSolver parent_t
Definition: problem-solver.hh:37
Definition: problem-solver.hh:33
virtual void robot(const core::DevicePtr_t &robot)
Definition: problem-solver.hh:50