GraphMemorySegment.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package MemoryX::Core
17 * @author Raphael Grimm <raphael dot grimm at kit dot edu>
18 * @date 2014
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
26 
28 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
29 #include <MemoryX/interface/memorytypes/MemoryEntities.h>
30 #include <MemoryX/interface/memorytypes/MemorySegments.h>
31 
32 namespace memoryx
33 {
34 
35  /**
36  * @class GraphMemorySegment
37  *
38  * @brief The Graph Memory Segment contains directed graphs. The graph consists of nodes with poses and edges between them.
39  * The poses in the nodes and the edges are used for platform navigation. Additionally, thee nodes are used for symbolic planning.
40  * One segment can contain multiple graphs. They distinguished by their *scene*-name.
41  * See Slice API documentation for GraphMemorySegmentBase.
42  */
44  virtual public PersistentEntitySegment,
45  virtual public GraphMemorySegmentBase
46  {
47  public:
48  GraphMemorySegment(CollectionInterfacePrx entityCollection,
50  bool useMongoIds = true);
51 
52  ~GraphMemorySegment() override;
53 
54  Ice::StringSeq getScenes(const Ice::Current& c = Ice::emptyCurrent) const override;
55 
56  memoryx::GraphNodeBaseList
57  getNodesByScene(const std::string& sceneName,
58  const Ice::Current& c = Ice::emptyCurrent) override;
59  memoryx::GraphNodeBasePtr getNodeById(const std::string& entityId,
60  const Ice::Current& c = Ice::emptyCurrent) override;
61  memoryx::GraphNodeBasePtr getNodeByName(const std::string& entityName,
62  const Ice::Current& c = Ice::emptyCurrent) override;
63  memoryx::GraphNodeBaseList getAllNodes(const Ice::Current& c = Ice::emptyCurrent) override;
64 
65  void clearScene(const std::string& sceneName,
66  const Ice::Current& c = Ice::emptyCurrent) override;
67 
68  bool removeNode(const std::string&, const Ice::Current&) override;
69  bool removeEdge(const std::string& startNodeId,
70  const std::string& endNodeId,
71  const Ice::Current&) override;
72 
73  std::string addNode(const memoryx::GraphNodeBasePtr& node,
74  const Ice::Current& c = Ice::emptyCurrent) override;
75  bool addEdge(const std::string& fromId,
76  const std::string& toId,
77  const Ice::Current& c = Ice::emptyCurrent) override;
78 
79  bool hasScene(const ::std::string& sceneName,
80  const ::Ice::Current& c = Ice::emptyCurrent) override;
81  bool hasNodeWithName(const ::std::string& sceneName,
82  const ::std::string& nodeName,
83  const ::Ice::Current& = Ice::emptyCurrent) override;
84 
85  ::memoryx::GraphNodeBasePtr
86  getNodeFromSceneByName(const ::std::string& sceneName,
87  const ::std::string& nodeName,
88  const ::Ice::Current& = Ice::emptyCurrent) override;
89  // virtual std::string getIdOfNearestNode(const ::std::string& sceneName, ::Ice::Float x, ::Ice::Float y, const ::Ice::Current& = Ice::emptyCurrent);
90 
91  ::memoryx::GraphNodeBaseList aStar(const ::std::string& idFrom,
92  const ::std::string& idTo,
93  const ::Ice::Current& = Ice::emptyCurrent) override;
94 
95  private:
96  memoryx::GraphNodeBasePtr getNodeById(const std::string& entityId,
97  const Ice::Current& c = Ice::emptyCurrent) const;
98  };
99 
101 } // namespace memoryx
cyberglove_with_calib_22dof.ic
ic
Definition: cyberglove_with_calib_22dof.py:22
PersistentEntitySegment.h
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
IceInternal::Handle<::Ice::Communicator >
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
memoryx::GraphMemorySegment
The Graph Memory Segment contains directed graphs. The graph consists of nodes with poses and edges b...
Definition: GraphMemorySegment.h:43
memoryx::PersistentEntitySegment
The PersistentEntitySegment class is the base class for all memory segments containing memoryx::Entit...
Definition: PersistentEntitySegment.h:105
ImportExportComponent.h