hpp-manipulation 4.14.0
Classes for manipulation planning.
Loading...
Searching...
No Matches
roadmap.hh
Go to the documentation of this file.
1// Copyright (c) 2014, LAAS-CNRS
2// Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
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_ROADMAP_HH
30#define HPP_MANIPULATION_ROADMAP_HH
31
32#include <hpp/core/roadmap.hh>
35
39
40namespace hpp {
41namespace manipulation {
44
47class HPP_MANIPULATION_DLLAPI Roadmap : public core::Roadmap {
48 public:
49 typedef core::Roadmap Parent;
50
52 static RoadmapPtr_t create(const core::DistancePtr_t& distance,
53 const core::DevicePtr_t& robot);
54
58
61
63 void clear();
64
66 void push_node(const core::NodePtr_t& n);
67
71 const ConfigurationPtr_t& configuration,
72 const ConnectedComponentPtr_t& connectedComponent,
73 const graph::StatePtr_t& state, value_type& minDistance) const;
74
78
83 const LeafConnectedCompPtr_t& cc2);
84
90
93
100 return leafCCs_;
101 }
102
103 protected:
106
108 Roadmap(const core::DistancePtr_t& distance, const core::DevicePtr_t& robot);
109
111 core::NodePtr_t createNode(const ConfigurationPtr_t& config) const;
112
113 void init(const RoadmapPtr_t& shPtr) {
114 Parent::init(shPtr);
115 weak_ = shPtr;
116 }
117
118 virtual void impl_addEdge(const core::EdgePtr_t& edge);
119
120 private:
121 typedef graph::Histograms_t Histograms_t;
124 Histograms_t histograms_;
125 graph::GraphPtr_t graph_;
126 RoadmapWkPtr_t weak_;
127 LeafConnectedComps_t leafCCs_;
128
129 Roadmap() {}
130 HPP_SERIALIZABLE();
131};
133} // namespace manipulation
134} // namespace hpp
135
136#endif // HPP_MANIPULATION_ROADMAP_HH
std::set< RawPtr_t > LeafConnectedComps_t
Definition: leaf-connected-comp.hh:47
Definition: roadmap-node.hh:42
Definition: roadmap.hh:47
core::Roadmap Parent
Definition: roadmap.hh:49
Roadmap(const core::DistancePtr_t &distance, const core::DevicePtr_t &robot)
Constructor.
void constraintGraph(const graph::GraphPtr_t &graph)
Register the constraint graph to do statistics.
virtual void impl_addEdge(const core::EdgePtr_t &edge)
void connect(const LeafConnectedCompPtr_t &cc1, const LeafConnectedCompPtr_t &cc2)
void statInsert(const RoadmapNodePtr_t &n)
Register a new configuration.
const LeafConnectedComps_t & leafConnectedComponents() const
Definition: roadmap.hh:99
void merge(const LeafConnectedCompPtr_t &cc1, LeafConnectedComp::LeafConnectedComps_t &ccs)
core::NodePtr_t createNode(const ConfigurationPtr_t &config) const
Node factory.
RoadmapNodePtr_t nearestNodeInState(const ConfigurationPtr_t &configuration, const ConnectedComponentPtr_t &connectedComponent, const graph::StatePtr_t &state, value_type &minDistance) const
graph::StatePtr_t getState(RoadmapNodePtr_t node)
Get graph state corresponding to given roadmap node.
void insertHistogram(const graph::HistogramPtr_t hist)
graph::StatePtr_t getNode(RoadmapNodePtr_t node) HPP_MANIPULATION_DEPRECATED
void push_node(const core::NodePtr_t &n)
Catch event 'New node added'.
void init(const RoadmapPtr_t &shPtr)
Definition: roadmap.hh:113
static RoadmapPtr_t create(const core::DistancePtr_t &distance, const core::DevicePtr_t &robot)
Return a shared pointer to a new instance.
void clear()
Clear the histograms and call parent implementation.
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
#define HPP_MANIPULATION_DEPRECATED
Definition: deprecated.hh:37
shared_ptr< State > StatePtr_t
Definition: fwd.hh:48
std::list< HistogramPtr_t > Histograms_t
Definition: fwd.hh:73
shared_ptr< Histogram > HistogramPtr_t
Definition: fwd.hh:70
shared_ptr< Graph > GraphPtr_t
Definition: fwd.hh:47
core::ConfigurationPtr_t ConfigurationPtr_t
Definition: fwd.hh:51
shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:69
shared_ptr< LeafConnectedComp > LeafConnectedCompPtr_t
Definition: fwd.hh:76
shared_ptr< ConnectedComponent > ConnectedComponentPtr_t
Definition: fwd.hh:74
core::value_type value_type
Definition: fwd.hh:90
std::set< LeafConnectedCompPtr_t > LeafConnectedComps_t
Definition: fwd.hh:78
Definition: main.hh:1