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 
27 #include "hog.h"
28 #include "choughcirclesdemo.h"
30 
31 
32 #include <RobotAPI/interface/core/RobotState.h>
33 #include <RobotAPI/interface/components/ViewSelectionInterface.h>
34 
36 
40 
41 
44 
47 
48 
49 #include <opencv2/opencv.hpp>
50 
51 #include <Image/IplImageAdaptor.h>
52 
53 #include <mutex>
54 
55 namespace armarx
56 {
57  /**
58  * @class ValveAttentionPropertyDefinitions
59  * @brief
60  */
63  {
64  public:
67  {
68  //defineRequiredProperty<std::string>("PropertyName", "Description");
69  //defineOptionalProperty<std::string>("PropertyName", "DefaultValue", "Description");
70  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the robot state component that should be used");
71  defineOptionalProperty<std::string>("ViewSelectionName", "ViewSelection", "Name of the ViewSelection component that should be used");
72  defineOptionalProperty<std::string>("HeadFrameName", "Head Base", "Name of the frame of the head base in the robot model");
73  defineOptionalProperty<std::string>("providerName", "ImageProvider", "Name of the image provider that should be used");
74 
75  defineOptionalProperty<std::string>("TrainingData", "/common/homes/students/zhu/home/", "Path to the training data set");
76  }
77  };
78 
79  /**
80  * @defgroup Component-ValveAttention ValveAttention
81  * @ingroup VisionX-Components
82  * A description of the component ValveAttention.
83  *
84  * @class ValveAttention
85  * @ingroup Component-ValveAttention
86  * @brief Brief description of class ValveAttention.
87  *
88  * Detailed description of class ValveAttention.
89  */
92  {
93  public:
94  /**
95  * @see armarx::ManagedIceObject::getDefaultName()
96  */
97  std::string getDefaultName() const override
98  {
99  return "ValveAttention";
100  }
101 
102  protected:
103 
104 
105  /**
106  * @see PropertyUser::createPropertyDefinitions()
107  */
109 
110  void process() override;
111 
112  void onInitPointCloudAndImageProcessor() override;
113  void onConnectPointCloudAndImageProcessor() override;
115  void onExitPointCloudAndImageProcessor() override;
116 
117  private:
118 
119  void addSaliencyRecursive(const int currentNodeIndex, std::vector<bool>& visitedNodes, const float saliency, const TSphereCoord objectSphereCoord, const float maxDistanceOnArc);
120 
121 
122  std::mutex mutex;
123 
124  RobotStateComponentInterfacePrx robotStateComponent;
125  ViewSelectionInterfacePrx viewSelection;
126 
128 
129 
130  std::string headFrameName;
131  CIntensityGraph* saliencyEgosphereGraph;
132  CGraphPyramidLookupTable* graphLookupTable;
133 
134  std::string providerName;
135  int numImages, numResultImages;
136  CByteImage** images;
137  CByteImage** result;
138  HoG* hog;
139  };
140 }
141 
PointCloudAndImageProcessor.h
armarx::ValveAttention::onConnectPointCloudAndImageProcessor
void onConnectPointCloudAndImageProcessor() override
Implement this method in your PointCloudAndImageProcessor in order execute parts when the component i...
Definition: ValveAttention.cpp:81
HoG
Definition: hog.h:48
armarx::ValveAttention
Brief description of class ValveAttention.
Definition: ValveAttention.h:90
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
GraphPyramidLookupTable.h
IntensityGraph.h
CGraphPyramidLookupTable
Definition: GraphPyramidLookupTable.h:22
CIntensityGraph
Definition: IntensityGraph.h:51
ImageProcessor.h
FramedPose.h
armarx::ValveAttention::getDefaultName
std::string getDefaultName() const override
Definition: ValveAttention.h:97
MathTools.h
armarx::ValveAttention::onInitPointCloudAndImageProcessor
void onInitPointCloudAndImageProcessor() override
Setup the vision component.
Definition: ValveAttention.cpp:48
armarx::ValveAttention::onDisconnectPointCloudAndImageProcessor
void onDisconnectPointCloudAndImageProcessor() override
Implement this method in the PointCloudAndImageProcessor in order to execute parts when the component...
Definition: ValveAttention.cpp:114
Component.h
armarx::ValveAttentionPropertyDefinitions::ValveAttentionPropertyDefinitions
ValveAttentionPropertyDefinitions(std::string prefix)
Definition: ValveAttention.h:65
armarx::ValveAttention::process
void process() override
Process the vision component.
Definition: ValveAttention.cpp:138
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
hog.h
ImageUtil.h
TypeMapping.h
choughcirclesdemo.h
armarx::ValveAttention::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ValveAttention.cpp:40
TSphereCoord
Definition: Structs.h:22
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::ValveAttentionPropertyDefinitions
Definition: ValveAttention.h:61
armarx::ValveAttention::onExitPointCloudAndImageProcessor
void onExitPointCloudAndImageProcessor() override
Exit the ImapeProcessor component.
Definition: ValveAttention.cpp:119
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
visionx::PointCloudAndImageProcessor
The PointCloudAndImageProcessor class provides an interface for access to PointCloudProviders and Ima...
Definition: PointCloudAndImageProcessor.h:97