Roadmap.h
Go to the documentation of this file.
1 // -*- mode: c++; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4; -*-
2 #ifndef __ROADMAP_H__
3 #define __ROADMAP_H__
4 
5 #include <vector>
6 #include <boost/shared_ptr.hpp>
7 #include "Configuration.h"
8 #include "RoadmapNode.h"
9 #include "exportdef.h"
10 
11 namespace PathEngine{
12  class PathPlanner;
13  class Roadmap;
14  typedef boost::shared_ptr<Roadmap> RoadmapPtr;
15 
20  public:
24  Roadmap(PathPlanner *planner) : planner_(planner), m_nEdges(0) {}
25 
31  ~Roadmap();
32 
37  void addNode(RoadmapNodePtr node) { nodes_.push_back(node); }
38 
44  void addEdge(RoadmapNodePtr from, RoadmapNodePtr to);
45 
52  bool removeEdge(RoadmapNodePtr from, RoadmapNodePtr to);
53 
60  void integrate(RoadmapPtr rdmp);
61 
66  unsigned int nNodes() const { return nodes_.size(); }
67 
68  unsigned int nEdges() const { return m_nEdges; }
69 
75  RoadmapNodePtr node(unsigned int index);
76 
83  void findNearestNode(const Configuration& cfg, RoadmapNodePtr &node, double &distance);
84 
89  RoadmapNodePtr lastAddedNode();
90 
96  int indexOfNode(RoadmapNodePtr node);
97 
104  std::vector<RoadmapNodePtr > DFS(RoadmapNodePtr startNode, RoadmapNodePtr goalNode);
105 
112  void tryConnection(RoadmapNodePtr from, RoadmapNodePtr to, bool tryReversed=true);
113 
117  void clear();
118  private:
122  std::vector<RoadmapNodePtr> nodes_;
124  unsigned int m_nEdges;
125  };
126 };
127 
128 #endif
unsigned int nNodes() const
ノード数を取得する
Definition: Roadmap.h:66
void clear(CorbaSequence &seq)
Roadmap(PathPlanner *planner)
コンストラクタ
Definition: Roadmap.h:24
unsigned int m_nEdges
Definition: Roadmap.h:124
PathPlanner * planner_
Definition: Roadmap.h:123
boost::shared_ptr< RoadmapNode > RoadmapNodePtr
Definition: RoadmapNode.h:11
unsigned int nEdges() const
Definition: Roadmap.h:68
list index
ロードマップ
Definition: Roadmap.h:19
std::vector< RoadmapNodePtr > nodes_
ノードのリスト
Definition: Roadmap.h:122
#define HRPPLANNER_API
Definition: exportdef.h:22
void addNode(RoadmapNodePtr node)
ノードを追加する
Definition: Roadmap.h:37
boost::shared_ptr< Roadmap > RoadmapPtr
Definition: Roadmap.h:13


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:05