ArMarkerLocalizer.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package VisionX::Component
19 * @author David Schiebener (schiebener at kit dot edu)
20 * @date 2015
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25#pragma once
26
27// VisionX
29
31
33#include <VisionX/interface/components/ArMarkerLocalizerInterface.h>
34
35// ArUco
36#include <mutex>
37
38#include <aruco/aruco.h>
39
40
41// forward declarations
42class CByteImage;
43
44namespace visionx
45{
51
52 /**
53 * ArMarkerLocalizer uses CTexturedRecognition of IVTRecognition in order to recognize and localize objects.
54 * The object data is read from PriorKnowledge and CommonStorage via MemoryX.
55 * The object localization is invoked automatically by the working memory if the object has been requested there.
56 */
58 virtual public ArMarkerLocalizerInterface,
59 virtual public ImageProcessor,
62 {
63 public:
64 /// @see PropertyUser::createPropertyDefinitions()
66
67 /// @see Component::getDefaultName()
68 std::string getDefaultName() const override;
69
70
71 public:
72 // ArMarkerLocalizerInterface interface
73 visionx::ArMarkerLocalizationResultList LocalizeAllMarkersNow(const Ice::Current&) override;
74 visionx::ArMarkerLocalizationResultList
75 GetLatestLocalizationResult(const Ice::Current&) override;
76
77
78 protected:
79 void onInitImageProcessor() override;
80 void onConnectImageProcessor() override;
81
82 void
84 {
85 }
86
87 void
89 {
90 }
91
92 void process() override;
93
94
95 void createRemoteGuiTab();
96 void RemoteGui_update() override;
97
98
99 private:
100 IceUtil::Time startingTime;
101 aruco::CameraParameters arucoCameraParameters;
102 aruco::MarkerDetector markerDetector;
103 std::atomic<float> markerSize;
104 std::map<std::string, int> markerIDs;
105 std::map<std::string, float> markerSizes;
106
107 CByteImage** cameraImages;
108
109 std::string imageProviderName;
110 bool gotAnyImages = false;
111
112 visionx::ArMarkerLocalizationResultList lastLocalizationResult;
113 std::mutex resultMutex;
114
115 visionx::ArMarkerLocalizationResultList localizeAllMarkersInternal();
116
117
118 bool visuEnabled = false;
119
120 struct RemoteGuiTab : armarx::RemoteGui::Client::Tab
121 {
123 };
124
125 RemoteGuiTab tab;
126 };
127
128} // namespace visionx
Provides a ready-to-use ArViz client arviz as member variable.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
ArMarkerLocalizer uses CTexturedRecognition of IVTRecognition in order to recognize and localize obje...
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.
visionx::ArMarkerLocalizationResultList LocalizeAllMarkersNow(const Ice::Current &) override
visionx::ArMarkerLocalizationResultList GetLatestLocalizationResult(const Ice::Current &) override
void onDisconnectImageProcessor() override
Implement this method in the ImageProcessor in order execute parts when the component looses network ...
std::string getDefaultName() const override
ImageProcessorPropertyDefinitions(std::string prefix)
The ImageProcessor class provides an interface for access to ImageProviders via Ice and shared memory...
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
ArmarX headers.