ImageToArMem.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::SimpleEpisodicMemoryImageConnector
17 * @author Fabian Peller ( fabian dot peller-konrad 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#pragma once
23
24#include <mutex>
25#include <string>
26#include <vector>
27
29
30// IVT
31#include <Image/ByteImage.h>
32
33// Ice
34#include <Ice/Current.h>
35#include <IceUtil/Time.h>
36
37// ArmarX
38#include <ArmarXCore/interface/observers/ObserverInterface.h>
39
41
43#include <VisionX/interface/components/Calibration.h>
44#include <VisionX/interface/components/PointCloudAndImageAndCalibrationProviderInterface.h>
47#include <VisionX/libraries/armem/vision/images/core/aron/ImageDepth.aron.generated.h>
48#include <VisionX/libraries/armem/vision/images/core/aron/ImageRGB.aron.generated.h>
49
50namespace visionx
51{
53 {
54 public:
55 std::string getDefaultName() const override;
56 static std::string GetDefaultName();
57
58
59 protected:
61
62 // ImageProcessor interface
63 void onInitImageProcessor() override;
64 void onConnectImageProcessor() override;
65 void onDisconnectImageProcessor() override;
66 void onExitImageProcessor() override;
67
68 void process() override;
69
70
71 private:
73
74 visionx::ImageProviderInfo imageProviderInfo;
75 armarx::MetaInfoSizeBase::PointerType imageMetaInfo;
76
77 // Image buffer
78 std::mutex inputImageMutex;
79 std::vector<CByteImage> inputImages;
80 std::vector<CByteImage*> inputImageBuffer;
81
82
83 // ArMem
84
86
87 struct Properties
88 {
90
91 std::string imageProviderName = "ImageProvider";
92 std::string providerSegmentName = "(auto)";
93
94 bool commitCameraCalib = true;
95
96 bool clearProviderSegmentWhenExists = false;
97
98 float maxFrequencyOfCommit = 15;
99 };
100
101 Properties p;
102
103 bool commitedCameraCalib = false;
104
105 armarx::DateTime timeOfLastAcceptedImage = armarx::DateTime::Now();
106 };
107
108} // namespace visionx
static DateTime Now()
Definition DateTime.cpp:51
Represents a point in time.
Definition DateTime.h:25
The ImageProcessor class provides an interface for access to ImageProviders via Ice and shared memory...
void onConnectImageProcessor() override
Implement this method in the ImageProcessor in order execute parts when the component is fully initia...
void onExitImageProcessor() override
Exit the ImapeProcessor component.
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void process() override
Process the vision component.
void onInitImageProcessor() override
Setup the vision component.
static std::string GetDefaultName()
void onDisconnectImageProcessor() override
Implement this method in the ImageProcessor in order execute parts when the component looses network ...
std::string getDefaultName() const override
Retrieve default name of component.
Allows to convert multiple CByteImages to Aron images and memory commits.
plugins::PluginUser PluginUser
Definition PluginUser.h:47
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
ArmarX headers.