ValveAttention.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::ValveAttention
17 * @author Markus Grotz ( markus dot grotz at kit dot edu )
18 * @date 2016
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25
26#include <mutex>
27
28#include <opencv2/opencv.hpp>
29
31
35#include <RobotAPI/interface/components/ViewSelectionInterface.h>
36#include <RobotAPI/interface/core/RobotState.h>
38
43
44#include "choughcirclesdemo.h"
45#include "hog.h"
46#include <Image/IplImageAdaptor.h>
47
48namespace armarx
49{
50 /**
51 * @class ValveAttentionPropertyDefinitions
52 * @brief
53 */
55 {
56 public:
59 {
60 //defineRequiredProperty<std::string>("PropertyName", "Description");
61 //defineOptionalProperty<std::string>("PropertyName", "DefaultValue", "Description");
63 "RobotStateComponentName",
64 "RobotStateComponent",
65 "Name of the robot state component that should be used");
67 "ViewSelectionName",
68 "ViewSelection",
69 "Name of the ViewSelection component that should be used");
71 "HeadFrameName",
72 "Head Base",
73 "Name of the frame of the head base in the robot model");
75 "providerName", "ImageProvider", "Name of the image provider that should be used");
76
78 "/common/homes/students/zhu/home/",
79 "Path to the training data set");
80 }
81 };
82
83 /**
84 * @defgroup Component-ValveAttention ValveAttention
85 * @ingroup VisionX-Components
86 * A description of the component ValveAttention.
87 *
88 * @class ValveAttention
89 * @ingroup Component-ValveAttention
90 * @brief Brief description of class ValveAttention.
91 *
92 * Detailed description of class ValveAttention.
93 */
95 {
96 public:
97 /**
98 * @see armarx::ManagedIceObject::getDefaultName()
99 */
100 static std::string
102 {
103 return "ValveAttention";
104 }
105
106 std::string
107 getDefaultName() const override
108 {
109 return GetDefaultName();
110 }
111
112 protected:
113 /**
114 * @see PropertyUser::createPropertyDefinitions()
115 */
117
118 void process() override;
119
120 void onInitPointCloudAndImageProcessor() override;
123 void onExitPointCloudAndImageProcessor() override;
124
125 private:
126 void addSaliencyRecursive(const int currentNodeIndex,
127 std::vector<bool>& visitedNodes,
128 const float saliency,
129 const TSphereCoord objectSphereCoord,
130 const float maxDistanceOnArc);
131
132
133 std::mutex mutex;
134
135 RobotStateComponentInterfacePrx robotStateComponent;
136 ViewSelectionInterfacePrx viewSelection;
137
139
140
141 std::string headFrameName;
142 CIntensityGraph* saliencyEgosphereGraph;
143 CGraphPyramidLookupTable* graphLookupTable;
144
145 std::string providerName;
146 int numImages, numResultImages;
147 CByteImage** images;
148 CByteImage** result;
149 HoG* hog;
150 };
151} // namespace armarx
Definition hog.h:48
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
ValveAttentionPropertyDefinitions(std::string prefix)
Brief description of class ValveAttention.
void onDisconnectPointCloudAndImageProcessor() override
Implement this method in the PointCloudAndImageProcessor in order to execute parts when the component...
void onConnectPointCloudAndImageProcessor() override
Implement this method in your PointCloudAndImageProcessor in order execute parts when the component i...
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void process() override
Process the vision component.
void onInitPointCloudAndImageProcessor() override
Setup the vision component.
static std::string GetDefaultName()
void onExitPointCloudAndImageProcessor() override
Exit the ImapeProcessor component.
std::string getDefaultName() const override
Retrieve default name of component.
The PointCloudAndImageProcessor class provides an interface for access to PointCloudProviders and Ima...
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx