AffordancePipelineGuiWidgetController.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::gui-plugins::AffordancePipelineGuiWidgetController
17  * @author Peter Kaiser ( peter dot kaiser 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 #include <VisionX/gui-plugins/AffordancePipelineGui/ui_AffordancePipelineGuiWidget.h>
26 
28 
31 
32 #include <RobotAPI/interface/core/RobotState.h>
33 
34 #include <VisionX/interface/core/PointCloudProviderInterface.h>
35 #include <VisionX/interface/components/PointCloudSegmenter.h>
36 #include <VisionX/interface/components/PointCloudFilter.h>
37 #include <VisionX/interface/components/PrimitiveMapper.h>
38 #include <VisionX/interface/components/AffordanceExtraction.h>
39 #include <VisionX/interface/components/AffordancePipelineVisualization.h>
40 
41 #include <QTimer>
42 #include <QToolBar>
43 
44 namespace armarx
45 {
46  class AffordancePipelineGuiConfigDialog;
47 
48  /**
49  \page VisionX-GuiPlugins-AffordancePipelineGui AffordancePipelineGui
50  \brief The AffordancePipelineGui provides access to a running affordance extraction pipeline.
51  It allows to start/stop the procession of point clouds as well as to specify certain segmentation parameters.
52 
53  API Documentation \ref AffordancePipelineGuiWidgetController
54 
55  \see AffordancePipelineGuiGuiPlugin
56  */
57 
58  /**
59  * \class AffordancePipelineGuiWidgetController
60  * \brief AffordancePipelineGuiWidgetController brief one line description
61  *
62  * Detailed description
63  */
66  public ArmarXComponentWidgetControllerTemplate<AffordancePipelineGuiWidgetController>
67  {
68  Q_OBJECT
69 
70  public:
71  /**
72  * Controller Constructor
73  */
75 
76  /**
77  * Controller destructor
78  */
80 
81  /**
82  * @see ArmarXWidgetController::loadSettings()
83  */
84  void loadSettings(QSettings* settings) override;
85 
86  /**
87  * @see ArmarXWidgetController::saveSettings()
88  */
89  void saveSettings(QSettings* settings) override;
90 
91  QPointer<QDialog> getConfigDialog(QWidget* parent = 0) override;
92 
93  void configured() override;
94 
95  /**
96  * Returns the Widget name displayed in the ArmarXGui to create an
97  * instance of this class.
98  */
99  static QString GetWidgetName()
100  {
101  return "VisionX.AffordancePipelineGui";
102  }
103 
104  QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent = 0) override;
105 
106  /**
107  * \see armarx::Component::onInitComponent()
108  */
109  void onInitComponent() override;
110 
111  /**
112  * \see armarx::Component::onConnectComponent()
113  */
114  void onConnectComponent() override;
115  void onDisconnectComponent() override;
116 
117  public slots:
118  void updatePipelineStatus();
119  void startPipeline();
120  void pausePipeline();
121  void stepPipeline();
122  void croppingSelected(int index);
123  void pointCloudSourceSelected(int index);
124  void segmentationSetupSelected(int index);
125  void visualizationOptionsChanged(bool prm = false);
126  void loadScene();
127  void saveScene();
128 
129  private:
130  QString formatTimestamp(long timestamp);
131 
132  private:
133  /**
134  * Widget Form
135  */
136  Ui::AffordancePipelineGuiWidget widget;
137  QPointer<AffordancePipelineGuiConfigDialog> configDialog;
138 
139  QToolBar* customToolbar;
140 
141  std::vector<std::string> pointCloudProviderNames;
142  std::vector<std::string> filteredPointCloudProviderNames;
143  std::vector<std::string> pointCloudProviderDisplayNames;
144 
145  std::vector<std::string> pipelineConfigFiles;
146 
147  std::string pointCloudSegmenterName;
148  std::string primitiveExtractorName;
149  std::string affordanceExtractionName;
150  std::string pipelineVisualizationName;
151  std::string robotStateComponentName;
152  std::string platform;
153 
154  std::vector<visionx::CapturingPointCloudProviderInterfacePrx> pointCloudProviders;
155  std::vector<armarx::PointCloudFilterInterfacePrx> filteredPointCloudProviders;
156  unsigned int currentPointCloudProvider;
157 
158  visionx::PointCloudSegmenterInterfacePrx pointCloudSegmenter;
159  visionx::PrimitiveMapperInterfacePrx primitiveExtractor;
160  AffordanceExtractionInterfacePrx affordanceExtraction;
161  AffordancePipelineVisualizationInterfacePrx pipelineVisualization;
162  RobotStateComponentInterfacePrx robotStateComponent;
163 
164  QTimer* updateTimer;
165  };
166 }
167 
armarx::AffordancePipelineGuiWidgetController
AffordancePipelineGuiWidgetController brief one line description.
Definition: AffordancePipelineGuiWidgetController.h:64
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::AffordancePipelineGuiWidgetController::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
Definition: AffordancePipelineGuiWidgetController.h:99
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
ArmarXGuiPlugin.h
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
ImportExportComponent.h