hpp-manipulation  4.11.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 // This file is part of hpp-manipulation.
5 // hpp-manipulation is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-manipulation is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-manipulation. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HPP_MANIPULATION_ROADMAP_HH
18 # define HPP_MANIPULATION_ROADMAP_HH
19 
20 # include <hpp/core/roadmap.hh>
21 
23 # include "hpp/manipulation/fwd.hh"
27 
28 namespace hpp {
29  namespace manipulation {
32 
35  class HPP_MANIPULATION_DLLAPI Roadmap : public core::Roadmap
36  {
37  public:
38  typedef core::Roadmap Parent;
39 
41  static RoadmapPtr_t create (const core::DistancePtr_t& distance, const core::DevicePtr_t& robot);
42 
45  void insertHistogram (const graph::HistogramPtr_t hist);
46 
48  void constraintGraph (const graph::GraphPtr_t& graph);
49 
51  void clear ();
52 
54  void push_node (const core::NodePtr_t& n);
55 
58  RoadmapNodePtr_t nearestNodeInState (const ConfigurationPtr_t& configuration,
59  const ConnectedComponentPtr_t& connectedComponent,
60  const graph::StatePtr_t& state,
61  value_type& minDistance) const;
62 
66 
70  void connect (const LeafConnectedCompPtr_t& cc1,
71  const LeafConnectedCompPtr_t& cc2);
72 
76  void merge (const LeafConnectedCompPtr_t& cc1,
78 
80  graph::StatePtr_t getState(RoadmapNodePtr_t node);
81 
88  {
89  return leafCCs_;
90  }
91 
92  protected:
94  void statInsert (const RoadmapNodePtr_t& n);
95 
97  Roadmap (const core::DistancePtr_t& distance, const core::DevicePtr_t& robot);
98 
100  core::NodePtr_t createNode (const ConfigurationPtr_t& config) const;
101 
102  void init (const RoadmapPtr_t& shPtr)
103  {
104  Parent::init (shPtr);
105  weak_ = shPtr;
106  }
107 
108  virtual void impl_addEdge (const core::EdgePtr_t& edge);
109 
110  private:
114  Histograms_t histograms_;
115  graph::GraphPtr_t graph_;
116  RoadmapWkPtr_t weak_;
117  LeafConnectedComps_t leafCCs_;
118 
119  Roadmap() {}
120  HPP_SERIALIZABLE();
121  };
123  } // namespace manipulation
124 } // namespace hpp
125 
126 #endif // HPP_MANIPULATION_ROADMAP_HH
void init(const RoadmapPtr_t &shPtr)
Definition: roadmap.hh:102
Definition: main.hh:1
shared_ptr< Roadmap > RoadmapPtr_t
Definition: fwd.hh:58
std::set< RawPtr_t > LeafConnectedComps_t
Definition: leaf-connected-comp.hh:38
shared_ptr< ConnectedComponent > ConnectedComponentPtr_t
Definition: fwd.hh:63
shared_ptr< Histogram > HistogramPtr_t
Definition: fwd.hh:58
core::value_type value_type
Definition: fwd.hh:82
#define HPP_MANIPULATION_DLLAPI
Definition: config.hh:64
shared_ptr< LeafConnectedComp > LeafConnectedCompPtr_t
Definition: fwd.hh:65
std::list< HistogramPtr_t > Histograms_t
Definition: fwd.hh:62
#define HPP_MANIPULATION_DEPRECATED
Definition: deprecated.hh:32
const LeafConnectedComps_t & leafConnectedComponents() const
Definition: roadmap.hh:87
shared_ptr< Graph > GraphPtr_t
Definition: fwd.hh:35
Definition: roadmap.hh:35
shared_ptr< State > StatePtr_t
Definition: fwd.hh:36
shared_ptr< Device > DevicePtr_t
Definition: fwd.hh:29
std::set< LeafConnectedCompPtr_t > LeafConnectedComps_t
Definition: fwd.hh:68
shared_ptr< Edge > EdgePtr_t
Definition: fwd.hh:37
core::Roadmap Parent
Definition: roadmap.hh:38
Definition: roadmap-node.hh:32
core::ConfigurationPtr_t ConfigurationPtr_t
Definition: fwd.hh:40