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 armarx
51{
52
53 /*class TCPMoverConfigDialog : public QDialog
54 {
55 Q_OBJECT
56
57 public:
58 TCPMoverConfigDialog(QWidget *parent = 0);
59
60 friend class TCPMover;
61 protected:
62 QGridLayout *layout;
63 //QLabel *label;
64 //QLineEdit *editTCPMoverUnitName;
65 IceProxyFinderBase* proxyFinder;
66 QDialogButtonBox *buttonBox;
67
68 void setupUI(QWidget *parent);
69 };*/
70
71
72 /**
73 * \page RobotAPI-GuiPlugins-TCPMover TCPMoverPlugin
74 * @brief The TCPMover widget allows direct control of a TCP.
75 *
76 * \image html TCPMoverGUI.png
77 */
79 {
80 Q_OBJECT
81
82 public:
83 TCPMover();
84 ~TCPMover() override;
85 //inherited from ArmarXMdiWidget
86 void loadSettings(QSettings* settings) override;
87 void saveSettings(QSettings* settings) override;
88
89 static QString
91 {
92 return "RobotControl.TCPMover";
93 }
94
95 static QIcon
97 {
98 return QIcon("://icons/games.ico");
99 }
100
101 static QIcon
103 {
104 return QIcon("://icons/games.ico");
105 }
106
107 QPointer<QDialog> getConfigDialog(QWidget* parent = 0) override;
108 void configured() override;
109
110 // inherited from Component
111 void onInitComponent() override;
112 void onConnectComponent() override;
113 void onExitComponent() override;
114
115
116 public slots:
117 void moveUp();
118 void moveDown();
119 void moveZUp();
120 void moveZDown();
121 void moveLeft();
122 void moveRight();
123 void increaseAlpha();
124 void decreaseAlpha();
125 void increaseBeta();
126 void decreaseBeta();
127 void increaseGamma();
128 void decreaseGamma();
129 void stopMoving();
130 void reset();
131 void robotControl(bool request);
132 void selectHand(int index);
133 signals:
134
135 protected:
136 void execMove();
137
138 void moveRelative(float x, float y, float z);
139 std::map<std::string, std::vector<float>> tcpData;
140 std::string selectedTCP;
141 std::string refFrame;
142 // float velocities[2][3];
143 // float orientation[2][3];
144 NameValueMap velocityMap;
146 VirtualRobot::RobotNodeSetPtr tcpNodeSet;
147 std::string tcpNodeSetName;
148 VirtualRobot::DifferentialIKPtr ik;
149 Ui::TCPMover ui;
150 std::string kinematicUnitName;
151 std::string kinematicUnitFile;
152 std::string tcpMoverUnitName;
154 TCPControlUnitInterfacePrx tcpMoverUnitPrx;
157 QPointer<TCPMoverConfigDialog> configDialog;
158 };
159} // namespace armarx
uint8_t index
std::string tcpNodeSetName
Definition TCPMover.h:147
void onInitComponent() override
Pure virtual hook for the subclass.
Definition TCPMover.cpp:113
std::string refFrame
Definition TCPMover.h:141
VirtualRobot::RobotPtr robot
Definition TCPMover.h:153
void selectHand(int index)
Definition TCPMover.cpp:312
std::string kinematicUnitName
Definition TCPMover.h:150
std::string kinematicUnitFile
Definition TCPMover.h:151
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:139
void moveRelative(float x, float y, float z)
Definition TCPMover.cpp:357
VirtualRobot::RobotNodeSetPtr tcpNodeSet
Definition TCPMover.h:146
NameValueMap velocityMap
Definition TCPMover.h:144
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:152
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition TCPMover.cpp:133
std::string selectedTCP
Definition TCPMover.h:140
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:102
SharedRobotInterfacePrx robotPrx
Definition TCPMover.h:156
RobotStateComponentInterfacePrx robotStateComponentPrx
Definition TCPMover.h:155
static QString GetWidgetName()
Definition TCPMover.h:90
void onExitComponent() override
Hook for subclass.
Definition TCPMover.cpp:179
void robotControl(bool request)
Definition TCPMover.cpp:294
VirtualRobot::DifferentialIKPtr ik
Definition TCPMover.h:148
~TCPMover() override
Definition TCPMover.cpp:76
static QIcon GetWidgetIcon()
Definition TCPMover.h:96
TCPControlUnitInterfacePrx tcpMoverUnitPrx
Definition TCPMover.h:154
Ui::TCPMover ui
Definition TCPMover.h:149
QPointer< TCPMoverConfigDialog > configDialog
Definition TCPMover.h:157
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