hpp-manipulation 9.0.2
Classes for manipulation planning.
Loading...
Searching...
No Matches
problem-solver.hh
Go to the documentation of this file.
1// Copyright (c) 2014 CNRS
2// Author: Florent Lamiraux, Joseph Mirabel
3//
4
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions are
7// met:
8//
9// 1. Redistributions of source code must retain the above copyright
10// notice, this list of conditions and the following disclaimer.
11//
12// 2. Redistributions in binary form must reproduce the above copyright
13// notice, this list of conditions and the following disclaimer in the
14// documentation and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27// DAMAGE.
28
29#ifndef HPP_MANIPULATION_PROBLEM_SOLVER_HH
30#define HPP_MANIPULATION_PROBLEM_SOLVER_HH
31
32#include <hpp/core/container.hh>
35#include <map>
36
41
42namespace hpp {
43namespace manipulation {
45 public:
47 typedef std::vector<std::string> Names_t;
48
50 virtual ~ProblemSolver() {}
51
53
55
58 virtual void robot(const core::DevicePtr_t& robot) {
59 robot_ = HPP_DYNAMIC_PTR_CAST(Device, robot);
60 assert(robot_);
61 parent_t::robot(robot);
62 }
63
65 const DevicePtr_t& robot() const { return robot_; }
66
69
71 void constraintGraph(const std::string& graph);
72
75
79
86 void createPlacementConstraint(const std::string& name,
87 const Strings_t& surface1,
88 const Strings_t& surface2,
89 const value_type& margin = 1e-4);
90
98 void createPrePlacementConstraint(const std::string& name,
99 const Strings_t& surface1,
100 const Strings_t& surface2,
101 const value_type& width,
102 const value_type& margin = 1e-4);
103
112 void createGraspConstraint(const std::string& name,
113 const std::string& gripper,
114 const std::string& handle);
115
121 void createPreGraspConstraint(const std::string& name,
122 const std::string& gripper,
123 const std::string& handle);
124
125 virtual void pathValidationType(const std::string& type,
126 const value_type& tolerance);
127
129 virtual void resetProblem();
130
132 virtual void resetRoadmap();
133
135 ProblemPtr_t problem() const { return problem_; }
136
138
140
142
143 protected:
145
146 private:
149 graph::GraphComponents_t components_;
150
151 DevicePtr_t robot_;
153 ProblemPtr_t problem_;
154 graph::GraphPtr_t constraintGraph_;
155}; // class ProblemSolver
156} // namespace manipulation
157} // namespace hpp
158
159#endif // HPP_MANIPULATION_PROBLEM_SOLVER_HH
Definition device.hh:50
Definition problem-solver.hh:44
void createPreGraspConstraint(const std::string &name, const std::string &gripper, const std::string &handle)
void createPrePlacementConstraint(const std::string &name, const Strings_t &surface1, const Strings_t &surface2, const value_type &width, const value_type &margin=1e-4)
void constraintGraph(const std::string &graph)
Set the constraint graph.
virtual void initializeProblem(ProblemPtr_t problem)
virtual void resetRoadmap()
Create a new Roadmap.
virtual void resetProblem()
Create a new problem.
graph::GraphPtr_t constraintGraph() const
Get the constraint graph.
std::vector< std::string > Names_t
Definition problem-solver.hh:47
void createPlacementConstraint(const std::string &name, const Strings_t &surface1, const Strings_t &surface2, const value_type &margin=1e-4)
core::ProblemSolver parent_t
Definition problem-solver.hh:46
core::Container< graph::GraphPtr_t > graphs
Definition problem-solver.hh:139
virtual void robot(const core::DevicePtr_t &robot)
Definition problem-solver.hh:58
void initConstraintGraph()
Should be called before any call on the graph is made.
virtual ~ProblemSolver()
Destructor.
Definition problem-solver.hh:50
ConstraintsAndComplements_t constraintsAndComplements
Definition problem-solver.hh:141
virtual void pathValidationType(const std::string &type, const value_type &tolerance)
void setTargetState(const graph::StatePtr_t state)
ProblemPtr_t problem() const
Get pointer to problem.
Definition problem-solver.hh:135
static ProblemSolverPtr_t create()
const DevicePtr_t & robot() const
Get robot.
Definition problem-solver.hh:65
void createGraspConstraint(const std::string &name, const std::string &gripper, const std::string &handle)
#define HPP_MANIPULATION_DLLAPI
Definition config.hh:88
std::vector< ConstraintAndComplement_t > ConstraintsAndComplements_t
Definition constraint-set.hh:87
ProblemConstPtr_t problem() const
pinocchio::DevicePtr_t DevicePtr_t
shared_ptr< State > StatePtr_t
Definition fwd.hh:48
std::vector< GraphComponentWkPtr_t > GraphComponents_t
Definition fwd.hh:55
shared_ptr< Graph > GraphPtr_t
Definition fwd.hh:47
shared_ptr< Problem > ProblemPtr_t
Definition fwd.hh:65
core::value_type value_type
Definition fwd.hh:89
shared_ptr< Device > DevicePtr_t
Definition fwd.hh:40
std::vector< std::string > Strings_t
Definition fwd.hh:159
#define HPP_DYNAMIC_PTR_CAST(t, x)