ArmarXObjectsToMemory.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::ArmarXObjects::ArmarXObjectsImporter
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2021
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <filesystem>
26 #include <unordered_set>
27 
29 
30 #include <MemoryX/interface/components/LongtermMemoryInterface.h>
31 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
32 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
34 
35 
36 namespace memoryx
37 {
38 
39 
41  {
42  public:
43 
45 
46 
48  std::vector<armarx::ObjectInfo> const& objectInfos,
49  memoryx::GridFileManagerPtr const& gridFileManager,
50  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
51  std::string const& mongoDbName) const;
52 
53 
55  std::filesystem::path const& scenesDirectory,
56  memoryx::LongtermMemoryInterfacePrx const& longtermMemory,
57  memoryx::WorkingMemoryInterfacePrx const& workingMemory,
58  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
59  const std::unordered_set<std::string>& scenes) const;
60 
61  bool
63  const std::string& snapshotName,
64  std::filesystem::path const& sceneJsonFile,
65  memoryx::LongtermMemoryInterfacePrx const& longtermMemory,
66  memoryx::WorkingMemoryInterfacePrx const& workingMemory,
67  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
68  memoryx::ObjectInstanceMemorySegmentBasePrx const& objectInstancesSegment
69  ) const;
70 
71 
72  bool
74  const armarx::objects::SceneObject& object,
75  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
76  memoryx::ObjectInstanceMemorySegmentBasePrx const& objectInstancesSegment,
77  std::map<std::string, std::unordered_set<std::string>>& instancesPerClass
78  ) const;
79 
80  bool
82  std::string const& className,
83  Eigen::Vector3f const& position,
84  Eigen::Quaternionf const& quat,
85  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
86  memoryx::ObjectInstanceMemorySegmentBasePrx const& objectInstancesSegment,
87  std::map<std::string, std::unordered_set<std::string>>& instancesPerClass
88  ) const;
89 
90 
91  /// If true, don't actually change anything.
92  bool dryRun = false;
93 
94  };
95 
96 
97 }
memoryx::ArmarXObjectsToMemory::dryRun
bool dryRun
If true, don't actually change anything.
Definition: ArmarXObjectsToMemory.h:92
memoryx::ArmarXObjectsToMemory::importSceneAsSnapshot
bool importSceneAsSnapshot(const std::string &snapshotName, std::filesystem::path const &sceneJsonFile, memoryx::LongtermMemoryInterfacePrx const &longtermMemory, memoryx::WorkingMemoryInterfacePrx const &workingMemory, memoryx::PersistentObjectClassSegmentBasePrx const &objectClassesSegment, memoryx::ObjectInstanceMemorySegmentBasePrx const &objectInstancesSegment) const
Definition: ArmarXObjectsToMemory.cpp:167
GridFileManager.h
memoryx::ArmarXObjectsToMemory
Definition: ArmarXObjectsToMemory.h:40
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
armarx::objects::SceneObject
Definition: Scene.h:38
memoryx::ArmarXObjectsToMemory::importObjectToWorkingMemory
bool importObjectToWorkingMemory(const armarx::objects::SceneObject &object, memoryx::PersistentObjectClassSegmentBasePrx const &objectClassesSegment, memoryx::ObjectInstanceMemorySegmentBasePrx const &objectInstancesSegment, std::map< std::string, std::unordered_set< std::string >> &instancesPerClass) const
forward_declarations.h
memoryx::GridFileManagerPtr
std::shared_ptr< GridFileManager > GridFileManagerPtr
Definition: AbstractEntityWrapper.h:32
armarx::Quaternion< float, 0 >
memoryx::ArmarXObjectsToMemory::importObjectsToPriorKnowledge
void importObjectsToPriorKnowledge(std::vector< armarx::ObjectInfo > const &objectInfos, memoryx::GridFileManagerPtr const &gridFileManager, memoryx::PersistentObjectClassSegmentBasePrx const &objectClassesSegment, std::string const &mongoDbName) const
Definition: ArmarXObjectsToMemory.cpp:59
memoryx::ArmarXObjectsToMemory::ArmarXObjectsToMemory
ArmarXObjectsToMemory()
Definition: ArmarXObjectsToMemory.cpp:54
memoryx::ArmarXObjectsToMemory::importScenesAsSnapshots
void importScenesAsSnapshots(std::filesystem::path const &scenesDirectory, memoryx::LongtermMemoryInterfacePrx const &longtermMemory, memoryx::WorkingMemoryInterfacePrx const &workingMemory, memoryx::PersistentObjectClassSegmentBasePrx const &objectClassesSegment, const std::unordered_set< std::string > &scenes) const
Definition: ArmarXObjectsToMemory.cpp:114