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 
28 #include "TCPMoverConfigDialog.h"
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 
48 class QDialogButtonBox;
49 
50 namespace 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];
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
armarx::TCPMover::increaseGamma
void increaseGamma()
Definition: TCPMover.cpp:262
armarx::TCPMover::GetWidgetIcon
static QIcon GetWidgetIcon()
Definition: TCPMover.h:96
armarx::TCPMover::robotPrx
SharedRobotInterfacePrx robotPrx
Definition: TCPMover.h:156
armarx::TCPMover::increaseBeta
void increaseBeta()
Definition: TCPMover.cpp:248
armarx::TCPMover::robotControl
void robotControl(bool request)
Definition: TCPMover.cpp:294
armarx::TCPMover::execMove
void execMove()
Definition: TCPMover.cpp:318
armarx::TCPMover::decreaseGamma
void decreaseGamma()
Definition: TCPMover.cpp:269
index
uint8_t index
Definition: EtherCATFrame.h:59
armarx::TCPMover::configured
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
Definition: TCPMover.cpp:105
armarx::TCPMover::increaseAlpha
void increaseAlpha()
Definition: TCPMover.cpp:234
armarx::TCPMover::GetWidgetName
static QString GetWidgetName()
Definition: TCPMover.h:90
armarx::TCPMover::stopMoving
void stopMoving()
Definition: TCPMover.cpp:276
armarx::TCPMover::ik
VirtualRobot::DifferentialIKPtr ik
Definition: TCPMover.h:148
armarx::TCPMover::TCPMover
TCPMover()
Definition: TCPMover.cpp:47
armarx::TCPMover::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: TCPMover.cpp:133
armarx::ArmarXComponentWidgetControllerTemplate
Definition: ArmarXComponentWidgetController.h:69
armarx::TCPMover::tcpMoverUnitName
std::string tcpMoverUnitName
Definition: TCPMover.h:152
armarx::TCPMover::getConfigDialog
QPointer< QDialog > getConfigDialog(QWidget *parent=0) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
Definition: TCPMover.cpp:94
armarx::TCPMover::moveZUp
void moveZUp()
Definition: TCPMover.cpp:203
armarx::TCPMover::decreaseAlpha
void decreaseAlpha()
Definition: TCPMover.cpp:241
armarx::TCPMover::moveRelative
void moveRelative(float x, float y, float z)
Definition: TCPMover.cpp:357
armarx::TCPMover
Definition: TCPMover.h:78
armarx::TCPMover::selectHand
void selectHand(int index)
Definition: TCPMover.cpp:312
armarx::TCPMover::tcpNodeSet
VirtualRobot::RobotNodeSetPtr tcpNodeSet
Definition: TCPMover.h:146
armarx::TCPMover::ui
Ui::TCPMover ui
Definition: TCPMover.h:149
ArmarXComponentWidgetController.h
armarx::TCPMover::tcpMoverUnitPrx
TCPControlUnitInterfacePrx tcpMoverUnitPrx
Definition: TCPMover.h:154
armarx::TCPMover::moveRight
void moveRight()
Definition: TCPMover.cpp:225
armarx::TCPMover::moveDown
void moveDown()
Definition: TCPMover.cpp:195
armarx::TCPMover::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: TCPMover.cpp:113
IceProxyFinder.h
armarx::TCPMover::velocityMap
NameValueMap velocityMap
Definition: TCPMover.h:144
armarx::TCPMover::moveUp
void moveUp()
Definition: TCPMover.cpp:187
armarx::TCPMover::robotStateComponentPrx
RobotStateComponentInterfacePrx robotStateComponentPrx
Definition: TCPMover.h:155
armarx::TCPMover::moveZDown
void moveZDown()
Definition: TCPMover.cpp:210
armarx::TCPMover::~TCPMover
~TCPMover() override
Definition: TCPMover.cpp:76
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:88
armarx::TCPMover::kinematicUnitName
std::string kinematicUnitName
Definition: TCPMover.h:150
armarx::TCPMover::reset
void reset()
Definition: TCPMover.cpp:284
armarx::TCPMover::selectedTCP
std::string selectedTCP
Definition: TCPMover.h:140
armarx::TCPMover::robot
VirtualRobot::RobotPtr robot
Definition: TCPMover.h:153
armarx::TCPMover::tcpNodeSetName
std::string tcpNodeSetName
Definition: TCPMover.h:147
armarx::TCPMover::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: TCPMover.cpp:179
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::TCPMover::tcpData
std::map< std::string, std::vector< float > > tcpData
Definition: TCPMover.h:139
armarx::TCPMover::moveLeft
void moveLeft()
Definition: TCPMover.cpp:217
armarx::TCPMover::kinematicUnitFile
std::string kinematicUnitFile
Definition: TCPMover.h:151
armarx::TCPMover::robotRequested
bool robotRequested
Definition: TCPMover.h:145
armarx::TCPMover::decreaseBeta
void decreaseBeta()
Definition: TCPMover.cpp:255
armarx::TCPMover::loadSettings
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition: TCPMover.cpp:81
armarx::TCPMover::saveSettings
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
Definition: TCPMover.cpp:88
armarx::TCPMover::configDialog
QPointer< TCPMoverConfigDialog > configDialog
Definition: TCPMover.h:157
TCPMoverConfigDialog.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::TCPMover::GetWidgetCategoryIcon
static QIcon GetWidgetCategoryIcon()
Definition: TCPMover.h:102
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19
armarx::TCPMover::refFrame
std::string refFrame
Definition: TCPMover.h:141