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 <RobotAPI/gui-plugins/LaserScannerPlugin/ui_LaserScannerPluginWidget.h>
26 #include <RobotAPI/interface/units/LaserScannerUnit.h>
27 
31 
33 
34 #include <mutex>
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  */
55  public ArmarXComponentWidgetControllerTemplate<LaserScannerPluginWidgetController>,
56  public armarx::LaserScannerUnitListener
57  {
58  Q_OBJECT
59 
60  public:
61  /**
62  * Controller Constructor
63  */
65 
66  /**
67  * Controller destructor
68  */
70 
71  /**
72  * @see ArmarXWidgetController::loadSettings()
73  */
74  void loadSettings(QSettings* settings) override;
75 
76  /**
77  * @see ArmarXWidgetController::saveSettings()
78  */
79  void saveSettings(QSettings* settings) override;
80 
81  /**
82  * Returns the Widget name displayed in the ArmarXGui to create an
83  * instance of this class.
84  */
85  static QString GetWidgetName()
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, const std::string& name,
105  const LaserScan& scan, const TimestampBasePtr& timestamp,
106  const Ice::Current& c) override;
107  public slots:
108  void onNewSensorValuesReported();
109  void onDeviceSelected(int index);
110 
111  signals:
112  void newSensorValuesReported();
113 
114  private:
115  /**
116  * Widget Form
117  */
118  Ui::LaserScannerPluginWidget widget;
119  QPointer<SimpleConfigDialog> dialog;
120 
121  std::string laserScannerUnitName;
122  LaserScannerUnitInterfacePrx laserScannerUnit;
123  LaserScannerInfoSeq laserScanners;
124 
125  std::mutex scanMutex;
126  std::unordered_map<std::string, LaserScan> scans;
127  std::unordered_map<std::string, std::deque<int>> numberOfRingsHistory;
128 
129 
130  std::unique_ptr<QGraphicsScene> scene;
131  };
132 }
133 
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:43
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:28
ImportExportComponent.h