TCPMover.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 ArmarX::
17* @author Mirko Waechter ( mirko.waechter at kit dot edu)
18* @date 2012
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25/** ArmarX headers **/
27
28// ArmarX includes
29#include <RobotAPI/interface/units/TCPControlUnit.h>
30#include <RobotAPI/interface/units/TCPMoverUnitInterface.h>
31
32/** VirtualRobot headers **/
33#include <VirtualRobot/VirtualRobot.h>
34
37
38// C++ includes
39#include <memory>
40
41// Qt includes
42#include <QDialog>
43
44#define KINEMATIC_UNIT_FILE_DEFAULT \
45 armarx::ArmarXDataPath::getHomePath() + std::string("Armar4/ARMAR_IV_simox.xml")
46#define KINEMATIC_UNIT_NAME_DEFAULT "RobotKinematicUnit"
47
48
49class QDialogButtonBox;
50
51// ui_TCPMover.h is included by TCPMover.cpp, not here: moc textually inlines every
52// #include it can resolve, so parsing the uic-generated header alongside this one made
53// moc emit this class as Ui::armarx::TCPMover.
54namespace Ui
55{
56 class TCPMover;
57}
58
59namespace armarx
60{
61
62 /*class TCPMoverConfigDialog : public QDialog
63 {
64 Q_OBJECT
65
66 public:
67 TCPMoverConfigDialog(QWidget *parent = 0);
68
69 friend class TCPMover;
70 protected:
71 QGridLayout *layout;
72 //QLabel *label;
73 //QLineEdit *editTCPMoverUnitName;
74 IceProxyFinderBase* proxyFinder;
75 QDialogButtonBox *buttonBox;
76
77 void setupUI(QWidget *parent);
78 };*/
79
80
81 /**
82 * \page RobotAPI-GuiPlugins-TCPMover TCPMoverPlugin
83 * @brief The TCPMover widget allows direct control of a TCP.
84 *
85 * \image html TCPMoverGUI.png
86 */
88 {
89 Q_OBJECT
90
91 public:
92 TCPMover();
93 ~TCPMover() override;
94 //inherited from ArmarXMdiWidget
95 void loadSettings(QSettings* settings) override;
96 void saveSettings(QSettings* settings) override;
97
98 static QString
100 {
101 return "RobotControl.TCPMover";
102 }
103
104 static QIcon
106 {
107 return QIcon("://icons/games.ico");
108 }
109
110 static QIcon
112 {
113 return QIcon("://icons/games.ico");
114 }
115
116 QPointer<QDialog> getConfigDialog(QWidget* parent = 0) override;
117 void configured() override;
118
119 // inherited from Component
120 void onInitComponent() override;
121 void onConnectComponent() override;
122 void onExitComponent() override;
123
124
125 public slots:
126 void moveUp();
127 void moveDown();
128 void moveZUp();
129 void moveZDown();
130 void moveLeft();
131 void moveRight();
132 void increaseAlpha();
133 void decreaseAlpha();
134 void increaseBeta();
135 void decreaseBeta();
136 void increaseGamma();
137 void decreaseGamma();
138 void stopMoving();
139 void reset();
140 void robotControl(bool request);
141 void selectHand(int index);
142 signals:
143
144 protected:
145 void execMove();
146
147 void moveRelative(float x, float y, float z);
148 std::map<std::string, std::vector<float>> tcpData;
149 std::string selectedTCP;
150 std::string refFrame;
151 // float velocities[2][3];
152 // float orientation[2][3];
153 NameValueMap velocityMap;
155 VirtualRobot::RobotNodeSetPtr tcpNodeSet;
156 std::string tcpNodeSetName;
157 VirtualRobot::DifferentialIKPtr ik;
158 std::unique_ptr<Ui::TCPMover> ui;
159 std::string kinematicUnitName;
160 std::string kinematicUnitFile;
161 std::string tcpMoverUnitName;
163 TCPControlUnitInterfacePrx tcpMoverUnitPrx;
166 QPointer<TCPMoverConfigDialog> configDialog;
167 };
168} // namespace armarx
uint8_t index
std::string tcpNodeSetName
Definition TCPMover.h:156
void onInitComponent() override
Pure virtual hook for the subclass.
Definition TCPMover.cpp:115
std::string refFrame
Definition TCPMover.h:150
VirtualRobot::RobotPtr robot
Definition TCPMover.h:162
void selectHand(int index)
Definition TCPMover.cpp:314
std::string kinematicUnitName
Definition TCPMover.h:159
std::string kinematicUnitFile
Definition TCPMover.h:160
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition TCPMover.cpp:83
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
Definition TCPMover.cpp:90
std::map< std::string, std::vector< float > > tcpData
Definition TCPMover.h:148
void moveRelative(float x, float y, float z)
Definition TCPMover.cpp:359
VirtualRobot::RobotNodeSetPtr tcpNodeSet
Definition TCPMover.h:155
NameValueMap velocityMap
Definition TCPMover.h:153
QPointer< QDialog > getConfigDialog(QWidget *parent=0) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
Definition TCPMover.cpp:96
std::unique_ptr< Ui::TCPMover > ui
Definition TCPMover.h:158
std::string tcpMoverUnitName
Definition TCPMover.h:161
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition TCPMover.cpp:135
std::string selectedTCP
Definition TCPMover.h:149
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
Definition TCPMover.cpp:107
static QIcon GetWidgetCategoryIcon()
Definition TCPMover.h:111
SharedRobotInterfacePrx robotPrx
Definition TCPMover.h:165
RobotStateComponentInterfacePrx robotStateComponentPrx
Definition TCPMover.h:164
static QString GetWidgetName()
Definition TCPMover.h:99
void onExitComponent() override
Hook for subclass.
Definition TCPMover.cpp:181
void robotControl(bool request)
Definition TCPMover.cpp:296
VirtualRobot::DifferentialIKPtr ik
Definition TCPMover.h:157
~TCPMover() override
Definition TCPMover.cpp:78
static QIcon GetWidgetIcon()
Definition TCPMover.h:105
TCPControlUnitInterfacePrx tcpMoverUnitPrx
Definition TCPMover.h:163
QPointer< TCPMoverConfigDialog > configDialog
Definition TCPMover.h:166
ArmarX Headers.
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::SharedRobotInterface > SharedRobotInterfacePrx
Definition FramedPose.h:59
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx