Line |
Branch |
Exec |
Source |
1 |
|
|
// Copyright (c) 2014, LAAS-CNRS |
2 |
|
|
// Authors: Joseph Mirabel (joseph.mirabel@laas.fr) |
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_HH |
30 |
|
|
#define HPP_MANIPULATION_PROBLEM_HH |
31 |
|
|
|
32 |
|
|
#include <hpp/core/problem-solver.hh> // PathValidationBuilder_t |
33 |
|
|
#include <hpp/core/problem.hh> |
34 |
|
|
#include <hpp/manipulation/device.hh> |
35 |
|
|
#include <hpp/manipulation/fwd.hh> |
36 |
|
|
#include <hpp/manipulation/graph/fwd.hh> |
37 |
|
|
|
38 |
|
|
namespace hpp { |
39 |
|
|
namespace manipulation { |
40 |
|
|
/// \addtogroup path_planning |
41 |
|
|
/// \{ |
42 |
|
|
|
43 |
|
|
class HPP_MANIPULATION_DLLAPI Problem : public core::Problem { |
44 |
|
|
public: |
45 |
|
|
typedef core::Problem Parent; |
46 |
|
|
|
47 |
|
|
/// Constructor |
48 |
|
|
static ProblemPtr_t create(DevicePtr_t robot); |
49 |
|
|
|
50 |
|
|
/// Set the graph of constraints |
51 |
|
|
void constraintGraph(const graph::GraphPtr_t& graph); |
52 |
|
|
|
53 |
|
|
/// Get the graph of constraints |
54 |
|
✗ |
graph::GraphPtr_t constraintGraph() const { return graph_; } |
55 |
|
|
|
56 |
|
|
/// Check whether the problem is well formulated. |
57 |
|
|
virtual void checkProblem() const; |
58 |
|
|
|
59 |
|
|
/// Expose parent method. |
60 |
|
|
PathValidationPtr_t pathValidation() const; |
61 |
|
|
|
62 |
|
|
/// \param pathValidation if of type GraphPathValidation, sets |
63 |
|
|
/// its constraint graph to Problem::constraintGraph() |
64 |
|
|
void pathValidation(const PathValidationPtr_t& pathValidation); |
65 |
|
|
|
66 |
|
|
/// Get the steering method as a SteeringMethod |
67 |
|
|
SteeringMethodPtr_t manipulationSteeringMethod() const; |
68 |
|
|
|
69 |
|
|
/// Build a new path validation |
70 |
|
|
/// \note Current obstacles are added to the created object. |
71 |
|
|
/// \todo Keep a pointer to this value to update it when a new obstacle |
72 |
|
|
/// is added. |
73 |
|
|
PathValidationPtr_t pathValidationFactory() const; |
74 |
|
|
|
75 |
|
|
void setPathValidationFactory(const core::PathValidationBuilder_t& factory, |
76 |
|
|
const value_type& tol); |
77 |
|
|
|
78 |
|
|
protected: |
79 |
|
|
/// Constructor |
80 |
|
|
Problem(DevicePtr_t robot); |
81 |
|
|
|
82 |
|
|
void init(ProblemWkPtr_t wkPtr); |
83 |
|
|
|
84 |
|
|
private: |
85 |
|
|
ProblemWkPtr_t wkPtr_; |
86 |
|
|
|
87 |
|
|
/// The graph of constraints |
88 |
|
|
graph::GraphPtr_t graph_; |
89 |
|
|
|
90 |
|
|
core::PathValidationBuilder_t pvFactory_; |
91 |
|
|
value_type pvTol_; |
92 |
|
|
}; // class Problem |
93 |
|
|
/// \} |
94 |
|
|
} // namespace manipulation |
95 |
|
|
} // namespace hpp |
96 |
|
|
|
97 |
|
|
#endif // HPP_MANIPULATION_PROBLEM_HH |
98 |
|
|
|