Line |
Branch |
Exec |
Source |
1 |
|
|
// Copyright (c) 2015 CNRS |
2 |
|
|
// Authors: 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_DISTANCE_HH |
30 |
|
|
#define HPP_MANIPULATION_DISTANCE_HH |
31 |
|
|
|
32 |
|
|
#include <hpp/core/weighed-distance.hh> |
33 |
|
|
#include <hpp/manipulation/config.hh> |
34 |
|
|
#include <hpp/manipulation/fwd.hh> |
35 |
|
|
#include <hpp/manipulation/graph/fwd.hh> |
36 |
|
|
|
37 |
|
|
namespace hpp { |
38 |
|
|
namespace manipulation { |
39 |
|
|
/// \addtogroup steering_method |
40 |
|
|
/// \{ |
41 |
|
|
|
42 |
|
|
/// Class for distance between configurations |
43 |
|
|
class HPP_MANIPULATION_DLLAPI WeighedDistance : public core::WeighedDistance { |
44 |
|
|
public: |
45 |
|
|
static WeighedDistancePtr_t create(const DevicePtr_t& robot, |
46 |
|
|
const graph::GraphPtr_t& graph); |
47 |
|
|
|
48 |
|
|
static WeighedDistancePtr_t createCopy(const WeighedDistancePtr_t& distance); |
49 |
|
|
|
50 |
|
|
virtual core::DistancePtr_t clone() const; |
51 |
|
|
|
52 |
|
|
/// Set the graph of constraints |
53 |
|
✗ |
void constraintGraph(const graph::GraphPtr_t& graph) { graph_ = graph; } |
54 |
|
|
|
55 |
|
|
/// Get the graph of constraints |
56 |
|
|
graph::GraphPtr_t constraintGraph() const { return graph_; } |
57 |
|
|
|
58 |
|
|
protected: |
59 |
|
|
WeighedDistance(const DevicePtr_t& robot, const graph::GraphPtr_t graph); |
60 |
|
|
|
61 |
|
|
WeighedDistance(const WeighedDistance& distance); |
62 |
|
|
|
63 |
|
|
/// Derived class should implement this function |
64 |
|
|
virtual value_type impl_distance(ConfigurationIn_t q1, |
65 |
|
|
ConfigurationIn_t q2) const; |
66 |
|
|
virtual value_type impl_distance(core::NodePtr_t n1, |
67 |
|
|
core::NodePtr_t n2) const; |
68 |
|
|
|
69 |
|
|
void init(WeighedDistanceWkPtr_t self); |
70 |
|
|
|
71 |
|
|
private: |
72 |
|
|
graph::GraphPtr_t graph_; |
73 |
|
|
WeighedDistanceWkPtr_t weak_; |
74 |
|
|
|
75 |
|
✗ |
WeighedDistance() {} |
76 |
|
|
HPP_SERIALIZABLE(); |
77 |
|
|
}; // class Distance |
78 |
|
|
/// \} |
79 |
|
|
} // namespace manipulation |
80 |
|
|
} // namespace hpp |
81 |
|
|
#endif // HPP_MANIPULATION_DISTANCE_HH |
82 |
|
|
|