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 
25 #include <MemoryX/interface/memorytypes/MemoryEntities.h>
26 #include <MemoryX/interface/memorytypes/MemorySegments.h>
27 
28 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
30 
32 
33 namespace memoryx
34 {
35 
36  /**
37  * @class GraphMemorySegment
38  *
39  * @brief The Graph Memory Segment contains directed graphs. The graph consists of nodes with poses and edges between them.
40  * The poses in the nodes and the edges are used for platform navigation. Additionally, thee nodes are used for symbolic planning.
41  * One segment can contain multiple graphs. They distinguished by their *scene*-name.
42  * See Slice API documentation for GraphMemorySegmentBase.
43  */
45  virtual public PersistentEntitySegment,
46  virtual public GraphMemorySegmentBase
47  {
48  public:
49  GraphMemorySegment(CollectionInterfacePrx entityCollection, Ice::CommunicatorPtr ic, bool useMongoIds = true);
50 
51  ~GraphMemorySegment() override;
52 
53  Ice::StringSeq getScenes(const Ice::Current& c = Ice::emptyCurrent) const override;
54 
55  memoryx::GraphNodeBaseList getNodesByScene(const std::string& sceneName, const Ice::Current& c = Ice::emptyCurrent) override;
56  memoryx::GraphNodeBasePtr getNodeById(const std::string& entityId, const Ice::Current& c = Ice::emptyCurrent) override;
57  memoryx::GraphNodeBasePtr getNodeByName(const std::string& entityName, const Ice::Current& c = Ice::emptyCurrent) override;
58  memoryx::GraphNodeBaseList getAllNodes(const Ice::Current& c = Ice::emptyCurrent) override;
59 
60  void clearScene(const std::string& sceneName, const Ice::Current& c = Ice::emptyCurrent) override;
61 
62  bool removeNode(const std::string&, const Ice::Current&) override;
63  bool removeEdge(const std::string& startNodeId, const std::string& endNodeId, const Ice::Current&) override;
64 
65  std::string addNode(const memoryx::GraphNodeBasePtr& node, const Ice::Current& c = Ice::emptyCurrent) override;
66  bool addEdge(const std::string& fromId, const std::string& toId, const Ice::Current& c = Ice::emptyCurrent) override;
67 
68  bool hasScene(const ::std::string& sceneName, const ::Ice::Current& c = Ice::emptyCurrent) override;
69  bool hasNodeWithName(const ::std::string& sceneName, const ::std::string& nodeName, const ::Ice::Current& = Ice::emptyCurrent) override;
70 
71  ::memoryx::GraphNodeBasePtr getNodeFromSceneByName(const ::std::string& sceneName, const ::std::string& nodeName, const ::Ice::Current& = Ice::emptyCurrent) override;
72  // virtual std::string getIdOfNearestNode(const ::std::string& sceneName, ::Ice::Float x, ::Ice::Float y, const ::Ice::Current& = Ice::emptyCurrent);
73 
74  ::memoryx::GraphNodeBaseList aStar(const ::std::string& idFrom, const ::std::string& idTo, const ::Ice::Current& = Ice::emptyCurrent) override;
75 
76  private:
77  memoryx::GraphNodeBasePtr getNodeById(const std::string& entityId, const Ice::Current& c = Ice::emptyCurrent) const;
78 
79 
80  };
81 
83 }
84 
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:43
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:44
memoryx::PersistentEntitySegment
The PersistentEntitySegment class is the base class for all memory segments containing memoryx::Entit...
Definition: PersistentEntitySegment.h:107
ImportExportComponent.h