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 
31 #include <MemoryX/interface/components/LongtermMemoryInterface.h>
32 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
33 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
34 
35 namespace memoryx
36 {
37 
38 
40  {
41  public:
43 
44 
46  std::vector<armarx::ObjectInfo> const& objectInfos,
47  memoryx::GridFileManagerPtr const& gridFileManager,
48  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
49  std::string const& mongoDbName) const;
50 
51 
53  std::filesystem::path const& scenesDirectory,
54  memoryx::LongtermMemoryInterfacePrx const& longtermMemory,
55  memoryx::WorkingMemoryInterfacePrx const& workingMemory,
56  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
57  const std::unordered_set<std::string>& scenes) const;
58 
60  const std::string& snapshotName,
61  std::filesystem::path const& sceneJsonFile,
62  memoryx::LongtermMemoryInterfacePrx const& longtermMemory,
63  memoryx::WorkingMemoryInterfacePrx const& workingMemory,
64  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
65  memoryx::ObjectInstanceMemorySegmentBasePrx const& objectInstancesSegment) const;
66 
67 
69  const armarx::objects::SceneObject& object,
70  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
71  memoryx::ObjectInstanceMemorySegmentBasePrx const& objectInstancesSegment,
72  std::map<std::string, std::unordered_set<std::string>>& instancesPerClass) const;
73 
75  std::string const& className,
76  Eigen::Vector3f const& position,
77  Eigen::Quaternionf const& quat,
78  memoryx::PersistentObjectClassSegmentBasePrx const& objectClassesSegment,
79  memoryx::ObjectInstanceMemorySegmentBasePrx const& objectInstancesSegment,
80  std::map<std::string, std::unordered_set<std::string>>& instancesPerClass) const;
81 
82 
83  /// If true, don't actually change anything.
84  bool dryRun = false;
85  };
86 
87 
88 } // namespace memoryx
memoryx::ArmarXObjectsToMemory::dryRun
bool dryRun
If true, don't actually change anything.
Definition: ArmarXObjectsToMemory.h:84
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:169
GridFileManager.h
memoryx::ArmarXObjectsToMemory
Definition: ArmarXObjectsToMemory.h:39
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
armarx::objects::SceneObject
Definition: Scene.h:37
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:33
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:57
memoryx::ArmarXObjectsToMemory::ArmarXObjectsToMemory
ArmarXObjectsToMemory()
Definition: ArmarXObjectsToMemory.cpp:52
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:115