hpp-core  4.11.0
Implement basic classes for canonical path planning for kinematic chains.
nearest-neighbor.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_NEAREST_NEIGHBOR_HH
20 # define HPP_CORE_NEAREST_NEIGHBOR_HH
21 
22 # include <hpp/core/fwd.hh>
23 # include <hpp/util/serialization-fwd.hh>
24 
25 namespace hpp {
26  namespace core {
29  {
30  public:
31  virtual void clear () = 0;
32  virtual void addNode (const NodePtr_t& node) = 0;
33 
43  virtual NodePtr_t search (const Configuration_t& configuration,
45  connectedComponent,
46  value_type& distance,bool reverse = false) = 0;
47 
48 
49  virtual NodePtr_t search (const NodePtr_t& node,
51  connectedComponent,
52  value_type& distance) = 0;
53 
56  virtual Nodes_t KnearestSearch (const Configuration_t& configuration,
58  connectedComponent,
59  const std::size_t K,
60  value_type& distance) = 0;
61 
64  virtual Nodes_t KnearestSearch (const NodePtr_t& node,
66  connectedComponent,
67  const std::size_t K,
68  value_type& distance) = 0;
69 
75  virtual Nodes_t KnearestSearch (const Configuration_t& configuration,
76  const RoadmapPtr_t& roadmap,
77  const std::size_t K,
78  value_type& distance) = 0;
79 
82  virtual NodeVector_t withinBall (const Configuration_t& configuration,
83  const ConnectedComponentPtr_t& cc,
84  value_type maxDistance) = 0;
85 
86  // merge two connected components in the whole tree
87  virtual void merge (ConnectedComponentPtr_t cc1,
88  ConnectedComponentPtr_t cc2) = 0;
89 
90  // Get distance function
91  virtual DistancePtr_t distance () const = 0;
92 
93  virtual ~NearestNeighbor () {};
94 
95  private:
96  HPP_SERIALIZABLE();
97  }; // class NearestNeighbor
98  } // namespace core
99 } // namespace hpp
100 
101 #endif // HPP_CORE_NEAREST_NEIGHBOR_HH
Definition: bi-rrt-planner.hh:24
virtual ~NearestNeighbor()
Definition: nearest-neighbor.hh:93
virtual void merge(ConnectedComponentPtr_t cc1, ConnectedComponentPtr_t cc2)=0
Optimization of the nearest neighbor search.
Definition: nearest-neighbor.hh:28
virtual Nodes_t KnearestSearch(const Configuration_t &configuration, const ConnectedComponentPtr_t &connectedComponent, const std::size_t K, value_type &distance)=0
shared_ptr< Distance > DistancePtr_t
Definition: fwd.hh:122
Definition: node.hh:35
shared_ptr< ConnectedComponent > ConnectedComponentPtr_t
Definition: fwd.hh:107
virtual void addNode(const NodePtr_t &node)=0
std::list< NodePtr_t > Nodes_t
Definition: fwd.hh:164
pinocchio::value_type value_type
Definition: fwd.hh:157
virtual DistancePtr_t distance() const =0
shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:182
std::vector< NodePtr_t > NodeVector_t
Definition: fwd.hh:165
virtual NodePtr_t search(const Configuration_t &configuration, const ConnectedComponentPtr_t &connectedComponent, value_type &distance, bool reverse=false)=0
search Return the closest node of the given configuration
virtual NodeVector_t withinBall(const Configuration_t &configuration, const ConnectedComponentPtr_t &cc, value_type maxDistance)=0
virtual void clear()=0
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:96