hpp-core
9.0.2
Implement basic classes for canonical path planning for kinematic chains.
Toggle main menu visibility
Loading...
Searching...
No Matches
nearest-neighbor.hh
Go to the documentation of this file.
1
//
2
// Copyright (c) 2014 CNRS
3
// Authors: Florent Lamiraux
4
//
5
6
// Redistribution and use in source and binary forms, with or without
7
// modification, are permitted provided that the following conditions are
8
// met:
9
//
10
// 1. Redistributions of source code must retain the above copyright
11
// notice, this list of conditions and the following disclaimer.
12
//
13
// 2. Redistributions in binary form must reproduce the above copyright
14
// notice, this list of conditions and the following disclaimer in the
15
// documentation and/or other materials provided with the distribution.
16
//
17
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28
// DAMAGE.
29
30
#ifndef HPP_CORE_NEAREST_NEIGHBOR_HH
31
#define HPP_CORE_NEAREST_NEIGHBOR_HH
32
33
#include <
hpp/core/fwd.hh
>
34
#include <
hpp/util/serialization-fwd.hh
>
35
36
namespace
hpp
{
37
namespace
core
{
39
class
NearestNeighbor
{
40
public
:
41
virtual
void
clear
() = 0;
42
virtual
void
addNode
(
const
NodePtr_t
& node) = 0;
43
53
virtual
NodePtr_t
search
(
ConfigurationIn_t
configuration,
54
const
ConnectedComponentPtr_t
& connectedComponent,
55
value_type
&
distance
,
bool
reverse =
false
) = 0;
56
57
virtual
NodePtr_t
search
(
const
NodePtr_t
& node,
58
const
ConnectedComponentPtr_t
& connectedComponent,
59
value_type
&
distance
) = 0;
60
63
virtual
Nodes_t
KnearestSearch
(
64
ConfigurationIn_t
configuration,
65
const
ConnectedComponentPtr_t
& connectedComponent,
const
std::size_t K,
66
value_type
&
distance
) = 0;
67
70
virtual
Nodes_t
KnearestSearch
(
71
const
NodePtr_t
& node,
const
ConnectedComponentPtr_t
& connectedComponent,
72
const
std::size_t K,
value_type
&
distance
) = 0;
73
79
virtual
Nodes_t
KnearestSearch
(
ConfigurationIn_t
configuration,
80
const
RoadmapPtr_t
& roadmap,
81
const
std::size_t K,
value_type
&
distance
) = 0;
82
85
virtual
NodeVector_t
withinBall
(
ConfigurationIn_t
configuration,
86
const
ConnectedComponentPtr_t
& cc,
87
value_type
maxDistance) = 0;
88
89
// merge two connected components in the whole tree
90
virtual
void
merge
(
ConnectedComponentPtr_t
cc1,
91
ConnectedComponentPtr_t
cc2) = 0;
92
93
// Get distance function
94
virtual
DistancePtr_t
distance
()
const
= 0;
95
96
virtual
~NearestNeighbor
() {};
97
98
private
:
99
HPP_SERIALIZABLE
();
100
};
// class NearestNeighbor
101
}
// namespace core
102
}
// namespace hpp
103
104
#endif
// HPP_CORE_NEAREST_NEIGHBOR_HH
hpp::core::NearestNeighbor
Optimization of the nearest neighbor search.
Definition
nearest-neighbor.hh:39
hpp::core::NearestNeighbor::search
virtual NodePtr_t search(ConfigurationIn_t configuration, const ConnectedComponentPtr_t &connectedComponent, value_type &distance, bool reverse=false)=0
search Return the closest node of the given configuration
hpp::core::NearestNeighbor::search
virtual NodePtr_t search(const NodePtr_t &node, const ConnectedComponentPtr_t &connectedComponent, value_type &distance)=0
hpp::core::NearestNeighbor::merge
virtual void merge(ConnectedComponentPtr_t cc1, ConnectedComponentPtr_t cc2)=0
hpp::core::NearestNeighbor::~NearestNeighbor
virtual ~NearestNeighbor()
Definition
nearest-neighbor.hh:96
hpp::core::NearestNeighbor::addNode
virtual void addNode(const NodePtr_t &node)=0
hpp::core::NearestNeighbor::KnearestSearch
virtual Nodes_t KnearestSearch(ConfigurationIn_t configuration, const RoadmapPtr_t &roadmap, const std::size_t K, value_type &distance)=0
hpp::core::NearestNeighbor::distance
virtual DistancePtr_t distance() const =0
hpp::core::NearestNeighbor::clear
virtual void clear()=0
hpp::core::NearestNeighbor::KnearestSearch
virtual Nodes_t KnearestSearch(ConfigurationIn_t configuration, const ConnectedComponentPtr_t &connectedComponent, const std::size_t K, value_type &distance)=0
hpp::core::NearestNeighbor::withinBall
virtual NodeVector_t withinBall(ConfigurationIn_t configuration, const ConnectedComponentPtr_t &cc, value_type maxDistance)=0
hpp::core::NearestNeighbor::KnearestSearch
virtual Nodes_t KnearestSearch(const NodePtr_t &node, const ConnectedComponentPtr_t &connectedComponent, const std::size_t K, value_type &distance)=0
fwd.hh
hpp
hpp::core
Definition
bi-rrt-planner.hh:36
hpp::core::value_type
pinocchio::value_type value_type
Definition
fwd.hh:174
hpp::core::DistancePtr_t
shared_ptr< Distance > DistancePtr_t
Definition
fwd.hh:141
hpp::core::NodeVector_t
std::vector< NodePtr_t > NodeVector_t
Definition
fwd.hh:182
hpp::core::RoadmapPtr_t
shared_ptr< Roadmap > RoadmapPtr_t
Definition
fwd.hh:199
hpp::core::ConfigurationIn_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition
fwd.hh:108
hpp::core::NodePtr_t
Node * NodePtr_t
Definition
fwd.hh:180
hpp::core::Nodes_t
std::list< NodePtr_t > Nodes_t
Definition
fwd.hh:181
hpp::core::ConnectedComponentPtr_t
shared_ptr< ConnectedComponent > ConnectedComponentPtr_t
Definition
fwd.hh:117
serialization-fwd.hh
HPP_SERIALIZABLE
#define HPP_SERIALIZABLE()
include
hpp
core
nearest-neighbor.hh
Generated by
1.17.0