VisionMemory.cpp
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 VisionX::ArmarXObjects::ArMemVisionMemory
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2020
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "VisionMemory.h"
24 
26 #include <RobotAPI/libraries/armem_vision/aron/OccupancyGrid.aron.generated.h>
27 
28 #include <VisionX/libraries/armem/vision/images/core/aron/ImageDepth.aron.generated.h>
29 #include <VisionX/libraries/armem/vision/images/core/aron/ImageRGB.aron.generated.h>
30 
31 namespace armarx::armem::server
32 {
33 
36  {
39  defs->optional(properties.imageRGBMaxHistorySize, "imageRGBMaxHistorySize");
40  defs->optional(properties.imageDepthMaxHistorySize, "imageDepthMaxHistorySize");
41  defs->optional(properties.occupancyGridMaxHistorySize, "occupancyGridMaxHistorySize");
42  defs->optional(properties.pointCloudMaxHistorySize, "pointCloudMaxHistorySize");
43 
44  pointCloudXYZCoreSegment.defineProperties(defs, "pcxyz.");
45  pointCloudXYZLCoreSegment.defineProperties(defs, "pcxyzl.");
46  pointCloudXYZRGBACoreSegment.defineProperties(defs, "pcxyzrgba.");
47  pointCloudXYZRGBLCoreSegment.defineProperties(defs, "pcxyzrgbl.");
48 
49  return defs;
50  }
51 
53  pointCloudXYZCoreSegment(iceAdapter(), properties.pointCloudMaxHistorySize),
54  pointCloudXYZLCoreSegment(iceAdapter(), properties.pointCloudMaxHistorySize),
55  pointCloudXYZRGBACoreSegment(iceAdapter(), properties.pointCloudMaxHistorySize),
56  pointCloudXYZRGBLCoreSegment(iceAdapter(), properties.pointCloudMaxHistorySize),
57 
58  monocularCameraCalibrationCoreSegment(iceAdapter(), -1),
59  stereoCameraCalibrationCoreSegment(iceAdapter(), -1)
60  {
61  setMemoryName("Vision");
62  }
63 
64  std::string
66  {
67  return "VisionMemory";
68  }
69 
70  void
72  {
73  // Initialize default segments
74  {
76  "ImageRGB", visionx::armem_images::arondto::ImageRGB::ToAronType());
77  cs.setMaxHistorySize(properties.imageRGBMaxHistorySize);
78  }
79 
80  {
82  "ImageDepth", visionx::armem_images::arondto::ImageDepth::ToAronType());
83  cs.setMaxHistorySize(properties.imageDepthMaxHistorySize);
84  }
85 
86  {
88  "OccupancyGrid", armem::vision::arondto::OccupancyGrid::ToAronType());
89  cs.setMaxHistorySize(properties.occupancyGridMaxHistorySize);
90  }
91 
92  {
93  pointCloudXYZCoreSegment.init();
94  pointCloudXYZLCoreSegment.init();
95  pointCloudXYZRGBACoreSegment.init();
96  pointCloudXYZRGBLCoreSegment.init();
97  }
98 
99  {
100  monocularCameraCalibrationCoreSegment.init();
101  stereoCameraCalibrationCoreSegment.init();
102  }
103  }
104 
105  void
107  {
108  }
109 
110  void
112  {
113  }
114 
115  void
117  {
118  }
119 
120 } // namespace armarx::armem::server
VisionMemory.h
armarx::armem::server::VisionMemory::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: VisionMemory.cpp:116
armarx::armem::server::wm::detail::MaxHistorySizeParent::setMaxHistorySize
void setMaxHistorySize(long maxSize)
Sets the maximum history size of entities in this container.
Definition: MaxHistorySize.h:46
armarx::armem::server::VisionMemory::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: VisionMemory.cpp:106
armarx::armem::server::VisionMemory::VisionMemory
VisionMemory()
Definition: VisionMemory.cpp:52
armarx::armem::server::VisionMemory::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: VisionMemory.cpp:71
armarx::armem::server::plugins::ReadWritePluginUser::setMemoryName
void setMemoryName(const std::string &memoryName)
Definition: ReadWritePluginUser.cpp:25
armarx::armem::server::VisionMemory::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: VisionMemory.cpp:65
armarx::armem::server::VisionMemory::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: VisionMemory.cpp:35
armarx::armem::server::plugins::ReadWritePluginUser::workingMemory
server::wm::Memory & workingMemory()
Definition: ReadWritePluginUser.cpp:106
memory_definitions.h
armarx::armem::server::VisionMemory::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: VisionMemory.cpp:111
armarx::armem::server::segment::SpecializedCoreSegment::init
virtual void init() override
Definition: SpecializedCoreSegment.cpp:49
armarx::armem::base::MemoryBase::addCoreSegment
CoreSegmentT & addCoreSegment(const std::string &name, aron::type::ObjectPtr coreSegmentType=nullptr, const std::vector< PredictionEngine > &predictionEngines={})
Add an empty core segment with the given name, type and prediction engines.
Definition: MemoryBase.h:259
armarx::armem::server
Definition: GraspMemory.cpp:19
armarx::armem::server::wm::CoreSegment
base::CoreSegmentBase
Definition: memory_definitions.h:86
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::armem::server::segment::SpecializedCoreSegment::defineProperties
virtual void defineProperties(armarx::PropertyDefinitionsPtr defs, const std::string &prefix="") override
Definition: SpecializedCoreSegment.cpp:33