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 **/
26#include <RobotAPI/gui-plugins/SensorActorWidgetsPlugin/ui_TCPMover.h>
27
29
30// ArmarX includes
31#include <RobotAPI/interface/units/TCPControlUnit.h>
32#include <RobotAPI/interface/units/TCPMoverUnitInterface.h>
33
34/** VirtualRobot headers **/
35#include <VirtualRobot/VirtualRobot.h>
36
39
40// Qt includes
41#include <QDialog>
42
43#define KINEMATIC_UNIT_FILE_DEFAULT \
44 armarx::ArmarXDataPath::getHomePath() + std::string("Armar4/ARMAR_IV_simox.xml")
45#define KINEMATIC_UNIT_NAME_DEFAULT "RobotKinematicUnit"
46
47
48class QDialogButtonBox;
49
50namespace Ui
51{
52 class TCPMover;
53}
54
55namespace armarx
56{
57
58 /*class TCPMoverConfigDialog : public QDialog
59 {
60 Q_OBJECT
61
62 public:
63 TCPMoverConfigDialog(QWidget *parent = 0);
64
65 friend class TCPMover;
66 protected:
67 QGridLayout *layout;
68 //QLabel *label;
69 //QLineEdit *editTCPMoverUnitName;
70 IceProxyFinderBase* proxyFinder;
71 QDialogButtonBox *buttonBox;
72
73 void setupUI(QWidget *parent);
74 };*/
75
76
77 /**
78 * \page RobotAPI-GuiPlugins-TCPMover TCPMoverPlugin
79 * @brief The TCPMover widget allows direct control of a TCP.
80 *
81 * \image html TCPMoverGUI.png
82 */
84 {
85 Q_OBJECT
86
87 public:
88 TCPMover();
89 ~TCPMover() override;
90 //inherited from ArmarXMdiWidget
91 void loadSettings(QSettings* settings) override;
92 void saveSettings(QSettings* settings) override;
93
94 static QString
96 {
97 return "RobotControl.TCPMover";
98 }
99
100 static QIcon
102 {
103 return QIcon("://icons/games.ico");
104 }
105
106 static QIcon
108 {
109 return QIcon("://icons/games.ico");
110 }
111
112 QPointer<QDialog> getConfigDialog(QWidget* parent = 0) override;
113 void configured() override;
114
115 // inherited from Component
116 void onInitComponent() override;
117 void onConnectComponent() override;
118 void onExitComponent() override;
119
120
121 public slots:
122 void moveUp();
123 void moveDown();
124 void moveZUp();
125 void moveZDown();
126 void moveLeft();
127 void moveRight();
128 void increaseAlpha();
129 void decreaseAlpha();
130 void increaseBeta();
131 void decreaseBeta();
132 void increaseGamma();
133 void decreaseGamma();
134 void stopMoving();
135 void reset();
136 void robotControl(bool request);
137 void selectHand(int index);
138 signals:
139
140 protected:
141 void execMove();
142
143 void moveRelative(float x, float y, float z);
144 std::map<std::string, std::vector<float>> tcpData;
145 std::string selectedTCP;
146 std::string refFrame;
147 // float velocities[2][3];
148 // float orientation[2][3];
149 NameValueMap velocityMap;
151 VirtualRobot::RobotNodeSetPtr tcpNodeSet;
152 std::string tcpNodeSetName;
153 VirtualRobot::DifferentialIKPtr ik;
154 Ui::TCPMover ui;
155 std::string kinematicUnitName;
156 std::string kinematicUnitFile;
157 std::string tcpMoverUnitName;
159 TCPControlUnitInterfacePrx tcpMoverUnitPrx;
162 QPointer<TCPMoverConfigDialog> configDialog;
163 };
164} // namespace armarx
uint8_t index
std::string tcpNodeSetName
Definition TCPMover.h:152
void onInitComponent() override
Pure virtual hook for the subclass.
Definition TCPMover.cpp:113
std::string refFrame
Definition TCPMover.h:146
VirtualRobot::RobotPtr robot
Definition TCPMover.h:158
void selectHand(int index)
Definition TCPMover.cpp:312
std::string kinematicUnitName
Definition TCPMover.h:155
std::string kinematicUnitFile
Definition TCPMover.h:156
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition TCPMover.cpp:81
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
Definition TCPMover.cpp:88
std::map< std::string, std::vector< float > > tcpData
Definition TCPMover.h:144
void moveRelative(float x, float y, float z)
Definition TCPMover.cpp:357
VirtualRobot::RobotNodeSetPtr tcpNodeSet
Definition TCPMover.h:151
NameValueMap velocityMap
Definition TCPMover.h:149
QPointer< QDialog > getConfigDialog(QWidget *parent=0) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
Definition TCPMover.cpp:94
std::string tcpMoverUnitName
Definition TCPMover.h:157
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition TCPMover.cpp:133
std::string selectedTCP
Definition TCPMover.h:145
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
Definition TCPMover.cpp:105
static QIcon GetWidgetCategoryIcon()
Definition TCPMover.h:107
SharedRobotInterfacePrx robotPrx
Definition TCPMover.h:161
RobotStateComponentInterfacePrx robotStateComponentPrx
Definition TCPMover.h:160
static QString GetWidgetName()
Definition TCPMover.h:95
void onExitComponent() override
Hook for subclass.
Definition TCPMover.cpp:179
void robotControl(bool request)
Definition TCPMover.cpp:294
VirtualRobot::DifferentialIKPtr ik
Definition TCPMover.h:153
~TCPMover() override
Definition TCPMover.cpp:76
static QIcon GetWidgetIcon()
Definition TCPMover.h:101
TCPControlUnitInterfacePrx tcpMoverUnitPrx
Definition TCPMover.h:159
Ui::TCPMover ui
Definition TCPMover.h:154
QPointer< TCPMoverConfigDialog > configDialog
Definition TCPMover.h:162
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