hpp-manipulation  4.13.0
Classes for manipulation planning.
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 
37 #include "hpp/manipulation/fwd.hh"
39 
40 namespace hpp {
41 namespace manipulation {
44 
47 class 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 
57  void insertHistogram(const graph::HistogramPtr_t hist);
58 
60  void constraintGraph(const graph::GraphPtr_t& graph);
61 
63  void clear();
64 
66  void push_node(const core::NodePtr_t& n);
67 
70  RoadmapNodePtr_t nearestNodeInState(
71  const ConfigurationPtr_t& configuration,
72  const ConnectedComponentPtr_t& connectedComponent,
73  const graph::StatePtr_t& state, value_type& minDistance) const;
74 
78 
82  void connect(const LeafConnectedCompPtr_t& cc1,
83  const LeafConnectedCompPtr_t& cc2);
84 
88  void merge(const LeafConnectedCompPtr_t& cc1,
90 
92  graph::StatePtr_t getState(RoadmapNodePtr_t node);
93 
100  return leafCCs_;
101  }
102 
103  protected:
105  void statInsert(const RoadmapNodePtr_t& n);
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:
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
void init(const RoadmapPtr_t &shPtr)
Definition: roadmap.hh:113
Definition: main.hh:1
shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:69
std::set< RawPtr_t > LeafConnectedComps_t
Definition: leaf-connected-comp.hh:47
shared_ptr< ConnectedComponent > ConnectedComponentPtr_t
Definition: fwd.hh:74
shared_ptr< Histogram > HistogramPtr_t
Definition: fwd.hh:69
core::value_type value_type
Definition: fwd.hh:90
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
shared_ptr< LeafConnectedComp > LeafConnectedCompPtr_t
Definition: fwd.hh:76
#define HPP_MANIPULATION_DEPRECATED
Definition: deprecated.hh:32
const LeafConnectedComps_t & leafConnectedComponents() const
Definition: roadmap.hh:99
std::list< HistogramPtr_t > Histograms_t
Definition: fwd.hh:73
Definition: roadmap.hh:47
shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:40
std::set< LeafConnectedCompPtr_t > LeafConnectedComps_t
Definition: fwd.hh:78
shared_ptr< Graph > GraphPtr_t
Definition: fwd.hh:47
shared_ptr< Edge > EdgePtr_t
Definition: fwd.hh:49
shared_ptr< State > StatePtr_t
Definition: fwd.hh:48
core::Roadmap Parent
Definition: roadmap.hh:49
Definition: roadmap-node.hh:42
core::ConfigurationPtr_t ConfigurationPtr_t
Definition: fwd.hh:51