hpp-core  4.11.0
Implement basic classes for canonical path planning for kinematic chains.
distance.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2014 CNRS
3 // Authors: Florent Lamiraux
4 //
5 // This file is part of hpp-core
6 // hpp-core 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-core 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-core If not, see
17 // <http://www.gnu.org/licenses/>.
18 
19 #ifndef HPP_CORE_DISTANCE_HH
20 # define HPP_CORE_DISTANCE_HH
21 
22 # include <hpp/pinocchio/fwd.hh>
23 # include <hpp/core/fwd.hh>
24 # include <hpp/core/config.hh>
25 # include <hpp/core/node.hh>
26 
27 # include <hpp/util/serialization-fwd.hh>
28 
29 namespace hpp {
30  namespace core {
33 
36  public:
37  value_type operator () (ConfigurationIn_t q1,
38  ConfigurationIn_t q2) const
39  {
40  return impl_distance (q1, q2);
41  }
42 
43  value_type operator () (NodePtr_t n1, NodePtr_t n2) const
44  {
45  return impl_distance (n1, n2);
46  }
47 
49  ConfigurationIn_t q2) const
50  {
51  return impl_distance (q1, q2);
52  }
53 
55  {
56  return impl_distance (n1, n2);
57  }
58 
59  virtual DistancePtr_t clone () const = 0;
60 
61  virtual ~Distance () {};
62  protected:
63 
65  {
66  }
68  virtual value_type impl_distance (ConfigurationIn_t q1,
69  ConfigurationIn_t q2) const = 0;
71  {
72  return impl_distance (*n1->configuration(), *n2->configuration());
73  }
74 
75  HPP_SERIALIZABLE();
76  }; // class Distance
78  } // namespace core
79 } // namespace hpp
80 #endif // HPP_CORE_DISTANCE_HH
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
Definition: bi-rrt-planner.hh:24
Distance()
Definition: distance.hh:64
value_type compute(NodePtr_t n1, NodePtr_t n2) const
Definition: distance.hh:54
shared_ptr< Distance > DistancePtr_t
Definition: fwd.hh:122
virtual value_type impl_distance(NodePtr_t n1, NodePtr_t n2) const
Definition: distance.hh:70
Definition: node.hh:35
value_type compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
Definition: distance.hh:48
pinocchio::value_type value_type
Definition: fwd.hh:157
virtual ~Distance()
Definition: distance.hh:61
ConfigurationPtr_t configuration() const
Abstract class for distance between configurations.
Definition: distance.hh:35
#define HPP_CORE_DLLAPI
Definition: config.hh:64