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
57
58 protected:
60
61 // ImageProcessor interface
62 void onInitImageProcessor() override;
63 void onConnectImageProcessor() override;
64 void onDisconnectImageProcessor() override;
65 void onExitImageProcessor() override;
66
67 void process() override;
68
69
70 private:
72
73 visionx::ImageProviderInfo imageProviderInfo;
74 armarx::MetaInfoSizeBase::PointerType imageMetaInfo;
75
76 // Image buffer
77 std::mutex inputImageMutex;
78 std::vector<CByteImage> inputImages;
79 std::vector<CByteImage*> inputImageBuffer;
80
81
82 // ArMem
83
85
86 struct Properties
87 {
89
90 std::string imageProviderName = "ImageProvider";
91 std::string providerSegmentName = "(auto)";
92
93 bool commitCameraCalib = true;
94
95 bool clearProviderSegmentWhenExists = false;
96
97 float maxFrequencyOfCommit = 15;
98 };
99
100 Properties p;
101
102 bool commitedCameraCalib = false;
103
104 armarx::DateTime timeOfLastAcceptedImage = armarx::DateTime::Now();
105 };
106
107} // 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.
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.