ArMemToImageProvider.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 VisionX::ArmarXObjects::ArMemToImageProvider
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 <mutex>
26 
28 #include <ArmarXCore/interface/observers/ObserverInterface.h>
29 
31 
35 
36 namespace visionx
37 {
38 
39  /**
40  * @defgroup Component-ArMemToImageProvider ArMemToImageProvider
41  * @ingroup VisionX-Components
42  * A description of the component ArMemToImageProvider.
43  *
44  * @class ArMemToImageProvider
45  * @ingroup Component-ArMemToImageProvider
46  * @brief Brief description of class ArMemToImageProvider.
47  *
48  * Detailed description of class ArMemToImageProvider.
49  */
51  virtual public armarx::Component,
53  {
54  public:
55  std::string getDefaultName() const override;
56 
57  protected:
59 
60  void onInitComponent() override;
61  void onConnectComponent() override;
62  void onDisconnectComponent() override;
63  void onExitComponent() override;
64 
65 
66  private:
67  void enableResultImages(size_t numberImages,
68  ImageDimension imageDimension,
69  ImageType imageType,
70  const std::string& name);
71  void fetchUpdates(const armarx::armem::MemoryID& entityID,
72  const std::vector<armarx::armem::MemoryID>& updatedSnapshotIDs);
73 
74 
75  private:
77  std::mutex armemToImageMutex;
78 
80  IceInternal::Handle<ResultImageProvider> resultImageProvider;
81 
82  struct Properties
83  {
85 
86  std::string providerSegmentName = "ProviderSegmentName";
87  std::string resultImagesName = "(auto)";
88  Eigen::Vector2i fallbackDims{640, 480};
89  };
90 
91  Properties p;
92  };
93 } // namespace visionx
visionx::ArMemToImageProvider
Brief description of class ArMemToImageProvider.
Definition: ArMemToImageProvider.h:50
visionx::ArMemToImageProvider::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: ArMemToImageProvider.cpp:125
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::ArMemToImageProvider::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: ArMemToImageProvider.cpp:89
ImagesProperties.h
IceInternal::Handle
Definition: forward_declarations.h:8
ArMemToImage.h
armarx::armem::MemoryID
A memory ID.
Definition: MemoryID.h:47
ImageProcessor.h
plugins.h
visionx::ArMemToImageProvider::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: ArMemToImageProvider.cpp:116
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
visionx::ArMemToImageProvider::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: ArMemToImageProvider.cpp:38
IceUtil::Handle< class PropertyDefinitionContainer >
visionx::armem_images::ImagesProperties
Definition: ImagesProperties.h:14
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
visionx::armem_images::ArMemToImage
Definition: ArMemToImage.h:18
visionx::ArMemToImageProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ArMemToImageProvider.cpp:44
armarx::armem::client::plugins::ListeningPluginUser
A memory name system client which listens to the memory updates topic (MemoryListenerInterface).
Definition: ListeningPluginUser.h:23
visionx::ArMemToImageProvider::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: ArMemToImageProvider.cpp:65