LaserScannerPluginWidgetController.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 RobotAPI::gui-plugins::LaserScannerPluginWidgetController
17  * @author Fabian Paus ( fabian dot paus at kit dot edu )
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <mutex>
26 
28 
32 
33 #include <RobotAPI/gui-plugins/LaserScannerPlugin/ui_LaserScannerPluginWidget.h>
34 #include <RobotAPI/interface/units/LaserScannerUnit.h>
35 
36 namespace armarx
37 {
38  /**
39  \page RobotAPI-GuiPlugins-LaserScannerPlugin LaserScannerPlugin
40  \brief The LaserScannerPlugin allows visualizing the raw sensor data captured from multiple laser scanners.
41 
42  API Documentation \ref LaserScannerPluginWidgetController
43 
44  \see LaserScannerPluginGuiPlugin
45  */
46 
47  /**
48  * \class LaserScannerPluginWidgetController
49  * \brief LaserScannerPluginWidgetController brief one line description
50  *
51  * Detailed description
52  */
54  public ArmarXComponentWidgetControllerTemplate<LaserScannerPluginWidgetController>,
55  public armarx::LaserScannerUnitListener
56  {
57  Q_OBJECT
58 
59  public:
60  /**
61  * Controller Constructor
62  */
64 
65  /**
66  * Controller destructor
67  */
69 
70  /**
71  * @see ArmarXWidgetController::loadSettings()
72  */
73  void loadSettings(QSettings* settings) override;
74 
75  /**
76  * @see ArmarXWidgetController::saveSettings()
77  */
78  void saveSettings(QSettings* settings) override;
79 
80  /**
81  * Returns the Widget name displayed in the ArmarXGui to create an
82  * instance of this class.
83  */
84  static QString
86  {
87  return "RobotControl.LaserScannerGUI";
88  }
89 
90  /**
91  * \see armarx::Component::onInitComponent()
92  */
93  void onInitComponent() override;
94 
95  /**
96  * \see armarx::Component::onConnectComponent()
97  */
98  void onConnectComponent() override;
99 
100  QPointer<QDialog> getConfigDialog(QWidget* parent) override;
101 
102  void configured() override;
103 
104  void reportSensorValues(const std::string& device,
105  const std::string& name,
106  const LaserScan& scan,
107  const TimestampBasePtr& timestamp,
108  const Ice::Current& c) override;
109  public slots:
110  void onNewSensorValuesReported();
111  void onDeviceSelected(int index);
112 
113  signals:
114  void newSensorValuesReported();
115 
116  private:
117  /**
118  * Widget Form
119  */
120  Ui::LaserScannerPluginWidget widget;
121  QPointer<SimpleConfigDialog> dialog;
122 
123  std::string laserScannerUnitName;
124  LaserScannerUnitInterfacePrx laserScannerUnit;
125  LaserScannerInfoSeq laserScanners;
126 
127  std::mutex scanMutex;
128  std::unordered_map<std::string, LaserScan> scans;
129  std::unordered_map<std::string, std::deque<int>> numberOfRingsHistory;
130 
131 
132  std::unique_ptr<QGraphicsScene> scene;
133  };
134 } // namespace armarx
armarx::LaserScannerPluginWidgetController
LaserScannerPluginWidgetController brief one line description.
Definition: LaserScannerPluginWidgetController.h:53
index
uint8_t index
Definition: EtherCATFrame.h:59
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
SimpleConfigDialog.h
ArmarXGuiPlugin.h
ArmarXComponentWidgetController.h
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::LaserScannerPluginWidgetController::GetWidgetName
static QString GetWidgetName()
Returns the Widget name displayed in the ArmarXGui to create an instance of this class.
Definition: LaserScannerPluginWidgetController.h:85
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
ImportExportComponent.h