Skip to content
Snippets Groups Projects
Commit a8e7a65c authored by Fabian Reister's avatar Fabian Reister
Browse files

Hand Unit Gui: reworked GUI + added reloading of preshapes

parent 4cdc8baa
No related branches found
No related tags found
1 merge request!487Feature/hand unit reload preshapes
Pipeline #21200 failed
...@@ -57,8 +57,12 @@ namespace armarx ...@@ -57,8 +57,12 @@ namespace armarx
setRightHandJointAnglesFlag(false) setRightHandJointAnglesFlag(false)
{ {
// init gui // init gui
ARMARX_INFO << "Setup UI";
ui.setupUi(getWidget()); ui.setupUi(getWidget());
ARMARX_INFO << "Done: Setup UI";
setLeftHandJointAngleUpdateTask = new PeriodicTask<HandUnitWidget>(this, &HandUnitWidget::setLeftHandJointAngles, 50); setLeftHandJointAngleUpdateTask = new PeriodicTask<HandUnitWidget>(this, &HandUnitWidget::setLeftHandJointAngles, 50);
setRightHandJointAngleUpdateTask = new PeriodicTask<HandUnitWidget>(this, &HandUnitWidget::setRightHandJointAngles, 50); setRightHandJointAngleUpdateTask = new PeriodicTask<HandUnitWidget>(this, &HandUnitWidget::setRightHandJointAngles, 50);
updateInfoTimer = new QTimer(this); updateInfoTimer = new QTimer(this);
...@@ -185,6 +189,29 @@ namespace armarx ...@@ -185,6 +189,29 @@ namespace armarx
setRightHandPreshape(ui.comboRightHandPreshapes->currentText().toUtf8().data()); setRightHandPreshape(ui.comboRightHandPreshapes->currentText().toUtf8().data());
} }
void HandUnitWidget::reloadPreshapes()
{
ARMARX_INFO << "Reloading preshapes in robot unit ...";
// left hand unit
{
if(leftHandUnitProxy)
{
ARMARX_INFO << "Left hand unit: reloading preshapes.";
leftHandUnitProxy->reloadPreshapes();
}
}
// right hand unit
{
if(rightHandUnitProxy)
{
ARMARX_INFO << "Right hand unit: reloading preshapes.";
rightHandUnitProxy->reloadPreshapes();
}
}
}
void HandUnitWidget::setLeftHandJointAngles() void HandUnitWidget::setLeftHandJointAngles()
{ {
// ARMARX_INFO << "setLeftHandJointAngles"; // ARMARX_INFO << "setLeftHandJointAngles";
...@@ -425,6 +452,8 @@ namespace armarx ...@@ -425,6 +452,8 @@ namespace armarx
void HandUnitWidget::initGUIJointFrames() void HandUnitWidget::initGUIJointFrames()
{ {
ARMARX_INFO << "initGUIJointFrames";
NameValueMap currentLeftHandJointValues = leftHandUnitProxy->getCurrentJointValues(); NameValueMap currentLeftHandJointValues = leftHandUnitProxy->getCurrentJointValues();
// ARMARX_INFO << VAROUT(leftHandUnitProxy->getCurrentJointValues()); // ARMARX_INFO << VAROUT(leftHandUnitProxy->getCurrentJointValues());
int frameLeftHandRowIdx = 0; int frameLeftHandRowIdx = 0;
...@@ -488,6 +517,11 @@ namespace armarx ...@@ -488,6 +517,11 @@ namespace armarx
} }
ui.comboRightHandJoints->setCurrentIndex(-1); ui.comboRightHandJoints->setCurrentIndex(-1);
// reloading of preshapes
connect(ui.reloadPreshapesButton, SIGNAL(clicked()), this, SLOT(reloadPreshapes()), Qt::UniqueConnection);
} }
......
...@@ -129,6 +129,8 @@ namespace armarx ...@@ -129,6 +129,8 @@ namespace armarx
void selectLeftHandJoint(int i); void selectLeftHandJoint(int i);
void selectRightHandJoint(int i); void selectRightHandJoint(int i);
void reloadPreshapes();
private: private:
void setLeftHandPreshape(std::string preshape); void setLeftHandPreshape(std::string preshape);
void setRightHandPreshape(std::string preshape); void setRightHandPreshape(std::string preshape);
...@@ -170,4 +172,3 @@ namespace armarx ...@@ -170,4 +172,3 @@ namespace armarx
}; };
using HandUnitGuiPluginPtr = std::shared_ptr<HandUnitWidget>; using HandUnitGuiPluginPtr = std::shared_ptr<HandUnitWidget>;
} }
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>637</width> <width>987</width>
<height>396</height> <height>802</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -19,401 +19,293 @@ ...@@ -19,401 +19,293 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<widget class="Line" name="lineLeftHand"> <layout class="QGridLayout" name="gridLayout">
<property name="geometry"> <item row="3" column="4">
<rect> <widget class="Line" name="lineLeftHand">
<x>146</x> <property name="orientation">
<y>35</y> <enum>Qt::Vertical</enum>
<width>16</width> </property>
<height>25</height> </widget>
</rect> </item>
</property> <item row="3" column="13">
<property name="orientation"> <widget class="Line" name="lineRightHand">
<enum>Qt::Vertical</enum> <property name="orientation">
</property> <enum>Qt::Vertical</enum>
</widget> </property>
<widget class="QFrame" name="frameLeftHand"> </widget>
<property name="geometry"> </item>
<rect> <item row="2" column="8" rowspan="5">
<x>9</x> <widget class="Line" name="line">
<y>156</y> <property name="orientation">
<width>301</width> <enum>Qt::Vertical</enum>
<height>231</height> </property>
</rect> </widget>
</property> </item>
<property name="frameShape"> <item row="0" column="0">
<enum>QFrame::StyledPanel</enum> <layout class="QVBoxLayout" name="verticalLayout">
</property> <item>
<property name="frameShadow"> <layout class="QHBoxLayout" name="baseContainer">
<enum>QFrame::Raised</enum> <item>
</property> <layout class="QVBoxLayout" name="left">
<layout class="QGridLayout" name="gridLayout_2"> <item>
<item row="0" column="0"> <widget class="QLabel" name="labelInfoLeftHand">
<widget class="QTableWidget" name="tableWidgetLeftHand"/> <property name="maximumSize">
</item> <size>
</layout> <width>16777215</width>
</widget> <height>20</height>
<widget class="QComboBox" name="comboLeftHandPreshapes"> </size>
<property name="geometry"> </property>
<rect> <property name="font">
<x>9</x> <font>
<y>35</y> <weight>75</weight>
<width>60</width> <bold>true</bold>
<height>25</height> </font>
</rect> </property>
</property> <property name="text">
</widget> <string>&lt;Info Here&gt;</string>
<widget class="QPushButton" name="buttonPreshapeLeftHand"> </property>
<property name="geometry"> </widget>
<rect> </item>
<x>71</x> <item>
<y>35</y> <layout class="QHBoxLayout" name="horizontalLayout_2">
<width>80</width> <item>
<height>25</height> <widget class="QComboBox" name="comboLeftHandPreshapes"/>
</rect> </item>
</property> <item>
<property name="maximumSize"> <widget class="QPushButton" name="buttonOpenLeftHand">
<size> <property name="text">
<width>100</width> <string>Open</string>
<height>16777215</height> </property>
</size> </widget>
</property> </item>
<property name="text"> <item>
<string>Preshape</string> <widget class="QPushButton" name="buttonPreshapeLeftHand">
</property> <property name="maximumSize">
</widget> <size>
<widget class="QPushButton" name="buttonOpenLeftHand"> <width>100</width>
<property name="geometry"> <height>16777215</height>
<rect> </size>
<x>157</x> </property>
<y>35</y> <property name="text">
<width>50</width> <string>Preshape</string>
<height>25</height> </property>
</rect> </widget>
</property> </item>
<property name="text"> <item>
<string>Open</string> <widget class="QPushButton" name="buttonCloseLeftHand">
</property> <property name="text">
</widget> <string>Close</string>
<widget class="QLabel" name="labelInfoLeftHand"> </property>
<property name="geometry"> </widget>
<rect> </item>
<x>9</x> <item>
<y>9</y> <widget class="QPushButton" name="buttonRelaxLeftHand">
<width>85</width> <property name="text">
<height>17</height> <string>Relax</string>
</rect> </property>
</property> </widget>
<property name="maximumSize"> </item>
<size> </layout>
<width>16777215</width> </item>
<height>20</height> <item>
</size> <layout class="QHBoxLayout" name="horizontalLayout_3">
</property> <item>
<property name="font"> <widget class="QLabel" name="labelSelectLeftHandJoint">
<font> <property name="text">
<weight>75</weight> <string>Select Joint</string>
<bold>true</bold> </property>
</font> </widget>
</property> </item>
<property name="text"> <item>
<string>&lt;Info Here&gt;</string> <widget class="QComboBox" name="comboLeftHandJoints"/>
</property> </item>
</widget> </layout>
<widget class="Line" name="line"> </item>
<property name="geometry"> <item>
<rect> <layout class="QHBoxLayout" name="horizontalLayout_5">
<x>310</x> <item>
<y>0</y> <widget class="QLCDNumber" name="lcdNumberLeftHandJointValue">
<width>20</width> <property name="enabled">
<height>401</height> <bool>true</bool>
</rect> </property>
</property> <property name="maximumSize">
<property name="orientation"> <size>
<enum>Qt::Vertical</enum> <width>80</width>
</property> <height>100</height>
</widget> </size>
<widget class="QPushButton" name="buttonCloseLeftHand"> </property>
<property name="geometry"> <property name="toolTip">
<rect> <string/>
<x>209</x> </property>
<y>35</y> <property name="smallDecimalPoint">
<width>50</width> <bool>false</bool>
<height>25</height> </property>
</rect> </widget>
</property> </item>
<property name="text"> <item>
<string>Close</string> <widget class="QSlider" name="horizontalSliderLeftHandJointPos">
</property> <property name="maximum">
</widget> <number>100</number>
<widget class="QPushButton" name="buttonRelaxLeftHand"> </property>
<property name="geometry"> <property name="orientation">
<rect> <enum>Qt::Horizontal</enum>
<x>261</x> </property>
<y>35</y> </widget>
<width>50</width> </item>
<height>25</height> </layout>
</rect> </item>
</property> <item>
<property name="text"> <widget class="QTableWidget" name="tableWidgetLeftHand"/>
<string>Relax</string> </item>
</property> </layout>
</widget> </item>
<widget class="QComboBox" name="comboRightHandPreshapes"> <item>
<property name="geometry"> <layout class="QVBoxLayout" name="right">
<rect> <item>
<x>330</x> <widget class="QLabel" name="labelInfoRightHand">
<y>35</y> <property name="maximumSize">
<width>60</width> <size>
<height>25</height> <width>16777215</width>
</rect> <height>20</height>
</property> </size>
</widget> </property>
<widget class="QPushButton" name="buttonOpenRightHand"> <property name="font">
<property name="geometry"> <font>
<rect> <weight>75</weight>
<x>478</x> <bold>true</bold>
<y>35</y> </font>
<width>50</width> </property>
<height>25</height> <property name="text">
</rect> <string>&lt;Info Here&gt;</string>
</property> </property>
<property name="text"> </widget>
<string>Open</string> </item>
</property> <item>
</widget> <layout class="QHBoxLayout" name="horizontalLayout_4">
<widget class="QPushButton" name="buttonPreshapeRightHand"> <item>
<property name="geometry"> <widget class="QComboBox" name="comboRightHandPreshapes"/>
<rect> </item>
<x>392</x> <item>
<y>35</y> <widget class="QPushButton" name="buttonOpenRightHand">
<width>80</width> <property name="text">
<height>25</height> <string>Open</string>
</rect> </property>
</property> </widget>
<property name="maximumSize"> </item>
<size> <item>
<width>100</width> <widget class="QPushButton" name="buttonPreshapeRightHand">
<height>16777215</height> <property name="maximumSize">
</size> <size>
</property> <width>100</width>
<property name="text"> <height>16777215</height>
<string>Preshape</string> </size>
</property> </property>
</widget> <property name="text">
<widget class="QPushButton" name="buttonCloseRightHand"> <string>Preshape</string>
<property name="geometry"> </property>
<rect> </widget>
<x>530</x> </item>
<y>35</y> <item>
<width>50</width> <widget class="QPushButton" name="buttonCloseRightHand">
<height>25</height> <property name="text">
</rect> <string>Close</string>
</property> </property>
<property name="text"> </widget>
<string>Close</string> </item>
</property> <item>
</widget> <widget class="QPushButton" name="buttonRelaxRightHand">
<widget class="QPushButton" name="buttonRelaxRightHand"> <property name="text">
<property name="geometry"> <string>Relax</string>
<rect> </property>
<x>582</x> </widget>
<y>35</y> </item>
<width>50</width> </layout>
<height>25</height> </item>
</rect> <item>
</property> <layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="text"> <item>
<string>Relax</string> <widget class="QLabel" name="labelSelectRightHandJoint">
</property> <property name="text">
</widget> <string>Select Joint</string>
<widget class="QLabel" name="labelInfoRightHand"> </property>
<property name="geometry"> </widget>
<rect> </item>
<x>330</x> <item>
<y>9</y> <widget class="QComboBox" name="comboRightHandJoints"/>
<width>85</width> </item>
<height>17</height> </layout>
</rect> </item>
</property> <item>
<property name="maximumSize"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<size> <item>
<width>16777215</width> <widget class="QLCDNumber" name="lcdNumberRightHandJointValue">
<height>20</height> <property name="enabled">
</size> <bool>true</bool>
</property> </property>
<property name="font"> <property name="maximumSize">
<font> <size>
<weight>75</weight> <width>80</width>
<bold>true</bold> <height>100</height>
</font> </size>
</property> </property>
<property name="text"> <property name="toolTip">
<string>&lt;Info Here&gt;</string> <string/>
</property> </property>
</widget> <property name="smallDecimalPoint">
<widget class="Line" name="lineRightHand"> <bool>false</bool>
<property name="geometry"> </property>
<rect> </widget>
<x>467</x> </item>
<y>35</y> <item>
<width>16</width> <widget class="QSlider" name="horizontalSliderRightHandJointPos">
<height>25</height> <property name="maximum">
</rect> <number>100</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="labelSelectLeftHandJoint"> </item>
<property name="geometry"> </layout>
<rect> </item>
<x>10</x> <item>
<y>80</y> <widget class="QTableWidget" name="tableWidgetRightHand"/>
<width>81</width> </item>
<height>17</height> </layout>
</rect> </item>
</property> </layout>
<property name="text"> </item>
<string>Select Joint</string> <item>
</property> <spacer name="horizontalSpacer">
</widget> <property name="orientation">
<widget class="QComboBox" name="comboLeftHandJoints"> <enum>Qt::Horizontal</enum>
<property name="geometry"> </property>
<rect> <property name="sizeHint" stdset="0">
<x>100</x> <size>
<y>75</y> <width>40</width>
<width>150</width> <height>20</height>
<height>25</height> </size>
</rect> </property>
</property> </spacer>
</widget> </item>
<widget class="QLCDNumber" name="lcdNumberLeftHandJointValue"> <item>
<property name="enabled"> <layout class="QVBoxLayout" name="general">
<bool>true</bool> <item>
</property> <layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="geometry"> <item>
<rect> <widget class="QPushButton" name="reloadPreshapesButton">
<x>10</x> <property name="text">
<y>117</y> <string>Reload preshapes</string>
<width>64</width> </property>
<height>26</height> </widget>
</rect> </item>
</property> </layout>
<property name="maximumSize"> </item>
<size> </layout>
<width>80</width> </item>
<height>100</height> </layout>
</size> </item>
</property> </layout>
<property name="toolTip">
<string/>
</property>
<property name="smallDecimalPoint">
<bool>false</bool>
</property>
</widget>
<widget class="QSlider" name="horizontalSliderLeftHandJointPos">
<property name="geometry">
<rect>
<x>90</x>
<y>120</y>
<width>221</width>
<height>16</height>
</rect>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
<widget class="QLCDNumber" name="lcdNumberRightHandJointValue">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>330</x>
<y>117</y>
<width>64</width>
<height>26</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>100</height>
</size>
</property>
<property name="toolTip">
<string/>
</property>
<property name="smallDecimalPoint">
<bool>false</bool>
</property>
</widget>
<widget class="QLabel" name="labelSelectRightHandJoint">
<property name="geometry">
<rect>
<x>330</x>
<y>80</y>
<width>81</width>
<height>17</height>
</rect>
</property>
<property name="text">
<string>Select Joint</string>
</property>
</widget>
<widget class="QFrame" name="frameRightHand">
<property name="geometry">
<rect>
<x>329</x>
<y>156</y>
<width>301</width>
<height>231</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidgetRightHand"/>
</item>
</layout>
</widget>
<widget class="QComboBox" name="comboRightHandJoints">
<property name="geometry">
<rect>
<x>420</x>
<y>75</y>
<width>150</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QSlider" name="horizontalSliderRightHandJointPos">
<property name="geometry">
<rect>
<x>410</x>
<y>120</y>
<width>221</width>
<height>16</height>
</rect>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment