hpp-core  4.9.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 namespace hpp {
28  namespace core {
31 
33  class HPP_CORE_DLLAPI Distance {
34  public:
35  value_type operator () (ConfigurationIn_t q1,
36  ConfigurationIn_t q2) const
37  {
38  return impl_distance (q1, q2);
39  }
40 
41  value_type operator () (NodePtr_t n1, NodePtr_t n2) const
42  {
43  return impl_distance (n1, n2);
44  }
45 
47  ConfigurationIn_t q2) const
48  {
49  return impl_distance (q1, q2);
50  }
51 
53  {
54  return impl_distance (n1, n2);
55  }
56 
57  virtual DistancePtr_t clone () const = 0;
58 
59  virtual ~Distance () {};
60  protected:
61 
63  {
64  }
66  virtual value_type impl_distance (ConfigurationIn_t q1,
67  ConfigurationIn_t q2) const = 0;
69  {
70  return impl_distance (*n1->configuration(), *n2->configuration());
71  }
72  }; // class Distance
74  } // namespace core
75 } // namespace hpp
76 #endif // HPP_CORE_DISTANCE_HH
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: fwd.hh:97
Distance()
Definition: distance.hh:62
value_type compute(NodePtr_t n1, NodePtr_t n2) const
Definition: distance.hh:52
virtual value_type impl_distance(NodePtr_t n1, NodePtr_t n2) const
Definition: distance.hh:68
Definition: node.hh:34
value_type compute(ConfigurationIn_t q1, ConfigurationIn_t q2) const
Definition: distance.hh:46
pinocchio::value_type value_type
Definition: fwd.hh:157
virtual ~Distance()
Definition: distance.hh:59
ConfigurationPtr_t configuration() const
boost::shared_ptr< Distance > DistancePtr_t
Definition: fwd.hh:122
Abstract class for distance between configurations.
Definition: distance.hh:33