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 std::string
101 getDefaultName() const override
102 {
103 return "ValveAttention";
104 }
105
106 protected:
107 /**
108 * @see PropertyUser::createPropertyDefinitions()
109 */
111
112 void process() override;
113
114 void onInitPointCloudAndImageProcessor() override;
117 void onExitPointCloudAndImageProcessor() override;
118
119 private:
120 void addSaliencyRecursive(const int currentNodeIndex,
121 std::vector<bool>& visitedNodes,
122 const float saliency,
123 const TSphereCoord objectSphereCoord,
124 const float maxDistanceOnArc);
125
126
127 std::mutex mutex;
128
129 RobotStateComponentInterfacePrx robotStateComponent;
130 ViewSelectionInterfacePrx viewSelection;
131
133
134
135 std::string headFrameName;
136 CIntensityGraph* saliencyEgosphereGraph;
137 CGraphPyramidLookupTable* graphLookupTable;
138
139 std::string providerName;
140 int numImages, numResultImages;
141 CByteImage** images;
142 CByteImage** result;
143 HoG* hog;
144 };
145} // 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.
void onExitPointCloudAndImageProcessor() override
Exit the ImapeProcessor component.
std::string getDefaultName() const override
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