hpp-manipulation 6.0.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 ConfigurationIn_t configuration,
72 const ConnectedComponentPtr_t& connectedComponent,
73 const graph::StatePtr_t& state, value_type& minDistance) const;
74
79 const LeafConnectedCompPtr_t& cc2);
80
86
89
96 return leafCCs_;
97 }
98
99 protected:
102
104 Roadmap(const core::DistancePtr_t& distance, const core::DevicePtr_t& robot);
105
107 core::NodePtr_t createNode(ConfigurationIn_t config) const;
108
109 void init(const RoadmapPtr_t& shPtr) {
110 Parent::init(shPtr);
111 weak_ = shPtr;
112 }
113
114 virtual void impl_addEdge(const core::EdgePtr_t& edge);
115
116 private:
117 typedef graph::Histograms_t Histograms_t;
120 Histograms_t histograms_;
121 graph::GraphPtr_t graph_;
122 RoadmapWkPtr_t weak_;
123 LeafConnectedComps_t leafCCs_;
124
125 Roadmap() {}
126 HPP_SERIALIZABLE();
127};
129} // namespace manipulation
130} // namespace hpp
131
132#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
RoadmapNodePtr_t nearestNodeInState(ConfigurationIn_t configuration, const ConnectedComponentPtr_t &connectedComponent, const graph::StatePtr_t &state, value_type &minDistance) const
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)
core::NodePtr_t createNode(ConfigurationIn_t config) const
Node factory.
void statInsert(const RoadmapNodePtr_t &n)
Register a new configuration.
const LeafConnectedComps_t & leafConnectedComponents() const
Definition roadmap.hh:95
void merge(const LeafConnectedCompPtr_t &cc1, LeafConnectedComp::LeafConnectedComps_t &ccs)
graph::StatePtr_t getState(RoadmapNodePtr_t node)
Get graph state corresponding to given roadmap node.
void insertHistogram(const graph::HistogramPtr_t hist)
void push_node(const core::NodePtr_t &n)
Catch event 'New node added'.
void init(const RoadmapPtr_t &shPtr)
Definition roadmap.hh:109
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:88
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
shared_ptr< Roadmap > RoadmapPtr_t
Definition fwd.hh:68
shared_ptr< LeafConnectedComp > LeafConnectedCompPtr_t
Definition fwd.hh:75
shared_ptr< ConnectedComponent > ConnectedComponentPtr_t
Definition fwd.hh:73
core::value_type value_type
Definition fwd.hh:89
std::set< LeafConnectedCompPtr_t > LeafConnectedComps_t
Definition fwd.hh:77
pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition fwd.hh:49
Definition main.hh:1