From 6599d90ed25f7fa670f8b5603cf282b24e8c6d57 Mon Sep 17 00:00:00 2001 From: Nikolaus Vahrenkamp <vahrenkamp@kit.edu> Date: Thu, 18 Feb 2016 17:11:48 +0100 Subject: [PATCH] removing deprecated sources --- .../KinematicUnitConfigDialog.h | 3 - .../KinematicUnitGuiPlugin.h | 3 - .../Backup/RobotViewerConfigDialog.cpp | 89 --- .../Backup/RobotViewerConfigDialog.h | 74 --- .../Backup/RobotViewerConfigDialog.ui | 63 -- .../Backup/RobotViewerGuiPlugin.cpp | 489 -------------- .../Backup/RobotViewerGuiPlugin.h | 179 ------ .../Backup/RobotViewerGuiPlugin.ui | 90 --- .../CMakeLists.txt | 56 -- .../RobotIKConfigDialog.cpp | 99 --- .../RobotIKConfigDialog.h | 70 -- .../RobotIKConfigDialog.ui | 63 -- .../RobotIKGuiPlugin.cpp | 606 ------------------ .../RobotIKGuiPlugin.h | 145 ----- .../RobotIKGuiPlugin.ui | 318 --------- .../RobotViewer.cpp | 329 ---------- .../RobotViewer.h | 25 - .../RobotViewerWidget.cpp | 33 - .../RobotViewerWidget.h | 45 -- 19 files changed, 2779 deletions(-) delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.cpp delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.h delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.ui delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.cpp delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.h delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.ui delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/CMakeLists.txt delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.cpp delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.h delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.ui delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.cpp delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.h delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.ui delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewer.cpp delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewer.h delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewerWidget.cpp delete mode 100644 source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewerWidget.h diff --git a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitConfigDialog.h b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitConfigDialog.h index f1366c34e..9e0ab1ea9 100644 --- a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitConfigDialog.h +++ b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitConfigDialog.h @@ -68,10 +68,7 @@ namespace armarx private: IceProxyFinderBase* proxyFinder; - //IceProxyFinderBase* proxyFinderRobotState; - //IceProxyFinderBase* topicFinder; Ui::KinematicUnitConfigDialog* ui; - //QFileDialog* fileDialog; std::string uuid; friend class KinematicUnitWidgetController; }; diff --git a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.h b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.h index 656ba4d10..b96569876 100644 --- a/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.h +++ b/source/RobotAPI/gui-plugins/KinematicUnitPlugin/KinematicUnitGuiPlugin.h @@ -224,9 +224,6 @@ namespace armarx KinematicUnitInterfacePrx kinematicUnitInterfacePrx;// send commands to kinematic unit KinematicUnitListenerPrx kinematicUnitListenerPrx; // receive reports from kinematic unit - - //RobotStateComponentInterfacePrx robotStateComponentPrx; - bool verbose; std::string kinematicUnitFile; diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.cpp b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.cpp deleted file mode 100644 index 1b467821f..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* -* This file is part of ArmarX. -* -* ArmarX is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* ArmarX is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* @package ArmarX:: -* @author Mirko Waechter ( mirko.waechter at kit dot edu) -* @date 2012 -* @copyright http://www.gnu.org/licenses/gpl-2.0.txt -* GNU General Public License -*/ - -#include "RobotViewerConfigDialog.h" -#include "ui_RobotViewerConfigDialog.h" - -#include <QTimer> -#include <QPushButton> -#include <QMessageBox> - - -#include <IceUtil/UUID.h> - -#include <Gui/ArmarXGuiLib/utility/IceProxyFinder.h> - -#include <RobotAPI/interface/core/RobotState.h> - -using namespace armarx; - -RobotViewerConfigDialog::RobotViewerConfigDialog(QWidget* parent) : - QDialog(parent), - ui(new Ui::RobotViewerConfigDialog), - uuid(IceUtil::generateUUID()) -{ - ui->setupUi(this); - - connect(this->ui->buttonBox, SIGNAL(accepted()), this, SLOT(verifyConfig())); - ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); - proxyFinder = new IceProxyFinder<RobotStateComponentInterfacePrx>(this); - proxyFinder->setSearchMask("RobotState*"); - ui->gridLayout->addWidget(proxyFinder, 2, 1, 1, 2); -} - -RobotViewerConfigDialog::~RobotViewerConfigDialog() -{ - delete ui; -} - -void RobotViewerConfigDialog::onInitComponent() -{ - proxyFinder->setIceManager(getIceManager()); -} - -void RobotViewerConfigDialog::onConnectComponent() -{ - -} - -void RobotViewerConfigDialog::onExitComponent() -{ - QObject::disconnect(); - -} - - - -void RobotViewerConfigDialog::verifyConfig() -{ - if (proxyFinder->getSelectedProxyName().trimmed().length() == 0) - { - QMessageBox::critical(this, "Invalid Configuration", "The proxy name must not be empty"); - } - else - { - this->accept(); - } -} - - - diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.h b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.h deleted file mode 100644 index 9c8237d10..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -* This file is part of ArmarX. -* -* ArmarX is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* ArmarX is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* @package ArmarX:: -* @author Nikolaus Vahrenkamp -* @date 2015 -* @copyright http://www.gnu.org/licenses/gpl-2.0.txt -* GNU General Public License -*/ - -#ifndef RobotViewerCONFIGDIALOG_H -#define RobotViewerCONFIGDIALOG_H - -#include <QDialog> -#include <QFileDialog> - -#include <ArmarXCore/core/services/tasks/RunningTask.h> -#include <ArmarXCore/core/IceManager.h> -#include <ArmarXCore/core/ManagedIceObject.h> -#include <Gui/ArmarXGuiLib/utility/IceProxyFinder.h> - -namespace Ui -{ - class RobotViewerConfigDialog; -} - -namespace armarx -{ - class RobotViewerConfigDialog : - public QDialog, - virtual public ManagedIceObject - { - Q_OBJECT - - public: - explicit RobotViewerConfigDialog(QWidget* parent = 0); - ~RobotViewerConfigDialog(); - - // inherited from ManagedIceObject - std::string getDefaultName() const - { - return "RobotViewerConfigDialog" + uuid; - } - void onInitComponent(); - void onConnectComponent(); - void onExitComponent(); - - void updateRobotViewerList(); - signals: - - public slots: - void verifyConfig(); - private: - - IceProxyFinderBase* proxyFinder; - Ui::RobotViewerConfigDialog* ui; - std::string uuid; - friend class RobotViewerWidgetController; - }; -} - -#endif diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.ui b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.ui deleted file mode 100644 index d5716a334..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerConfigDialog.ui +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>RobotViewerConfigDialog</class> - <widget class="QDialog" name="RobotViewerConfigDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>527</width> - <height>96</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>Dialog</string> - </property> - <property name="toolTip"> - <string/> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="0"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - <item row="0" column="0"> - <layout class="QGridLayout" name="gridLayout"/> - </item> - </layout> - </widget> - <tabstops> - <tabstop>buttonBox</tabstop> - </tabstops> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>rejected()</signal> - <receiver>RobotViewerConfigDialog</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>316</x> - <y>260</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.cpp b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.cpp deleted file mode 100644 index 77a3673d5..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.cpp +++ /dev/null @@ -1,489 +0,0 @@ -#include "RobotViewerGuiPlugin.h" -#include "RobotViewerConfigDialog.h" - -#include <RobotAPI/gui-plugins/RobotViewerPlugin/ui_RobotViewerConfigDialog.h> - -#include <ArmarXCore/core/system/ArmarXDataPath.h> -#include <ArmarXCore/core/ArmarXObjectScheduler.h> -#include <ArmarXCore/core/ArmarXManager.h> -#include <ArmarXCore/core/system/cmake/CMakePackageFinder.h> -#include <ArmarXCore/core/application/Application.h> - -#include <VirtualRobot/XML/RobotIO.h> - -// Qt headers -#include <Qt> -#include <QtGlobal> - -#include <QPushButton> - -#include <QCheckBox> - - -#include <Inventor/SoDB.h> -#include <Inventor/Qt/SoQt.h> -// System -#include <stdio.h> -#include <string> -#include <string.h> -#include <stdlib.h> -#include <iostream> -#include <cmath> - -#include <boost/filesystem.hpp> - -#define TIMER_MS 33 -#define ROBOTSTATE_NAME_DEFAULT "RobotStateComponent" - -using namespace armarx; -using namespace VirtualRobot; -using namespace std; - - -RobotViewerGuiPlugin::RobotViewerGuiPlugin() -{ - addWidget<RobotViewerWidgetController>(); -} - - -RobotViewerWidgetController::RobotViewerWidgetController() -{ - robotStateComponentName = ""; - rootVisu = NULL; - robotVisu = NULL; - debugLayerVisu = NULL; - - timerSensor = NULL; - - // init gui - ui.setupUi(getWidget()); - getWidget()->setEnabled(false); -} - - -void RobotViewerWidgetController::onInitComponent() -{ - bool createDebugDrawer = true; - verbose = true; - - usingProxy(robotStateComponentName); - usingProxy(robotIKName); - usingProxy(kinematicUnitComponentName); - - - rootVisu = new SoSeparator(); - rootVisu->ref(); - - robotVisu = new SoSeparator; - robotVisu->ref(); - rootVisu->addChild(robotVisu); - - // create the debugdrawer component - if (createDebugDrawer) - { - std::string debugDrawerComponentName = "RobotViewerGUIDebugDrawer_" + getName(); - ARMARX_INFO << "Creating component " << debugDrawerComponentName; - debugDrawer = Component::create<DebugDrawerComponent>(properties, debugDrawerComponentName); - - if (mutex3D) - { - debugDrawer->setMutex(mutex3D); - } - else - { - ARMARX_ERROR << " No 3d mutex available..."; - } - - ArmarXManagerPtr m = getArmarXManager(); - m->addObject(debugDrawer); - - - { - boost::recursive_mutex::scoped_lock lock(*mutex3D); - debugLayerVisu = new SoSeparator(); - debugLayerVisu->ref(); - debugLayerVisu->addChild(debugDrawer->getVisualization()); - rootVisu->addChild(debugLayerVisu); - } - } - - showRoot(true); -} - -void RobotViewerWidgetController::onConnectComponent() -{ - robotStateComponentPrx = getProxy<RobotStateComponentInterfacePrx>(robotStateComponentName); - kinematicUnitInterfacePrx = getProxy<KinematicUnitInterfacePrx>(kinematicUnitComponentName); - robotIKPrx = getProxy<RobotIKInterfacePrx>(robotIKName); - - - if (robotVisu) - { - robotVisu->removeAllChildren(); - } - - robot.reset(); - - std::string rfile; - StringList includePaths; - - // get robot filename - try - { - - StringList packages = robotStateComponentPrx->getArmarXPackages(); - packages.push_back(Application::GetProjectName()); - ARMARX_VERBOSE << "ArmarX packages " << packages; - - for (const std::string& projectName : packages) - { - if (projectName.empty()) - { - continue; - } - - CMakePackageFinder project(projectName); - StringList projectIncludePaths; - auto pathsString = project.getDataDir(); - boost::split(projectIncludePaths, - pathsString, - boost::is_any_of(";,"), - boost::token_compress_on); - includePaths.insert(includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end()); - - } - - rfile = robotStateComponentPrx->getRobotFilename(); - ARMARX_VERBOSE << "Relative robot file " << rfile; - ArmarXDataPath::getAbsolutePath(rfile, rfile, includePaths); - ARMARX_VERBOSE << "Absolute robot file " << rfile; - } - catch (...) - { - ARMARX_ERROR << "Unable to retrieve robot filename"; - } - - try - { - ARMARX_INFO << "Loading robot from file " << rfile; - robot = loadRobotFile(rfile); - } - catch (...) - { - ARMARX_ERROR << "Failed to init robot"; - } - - if (!robot) - { - getObjectScheduler()->terminate(); - - if (getWidget()->parentWidget()) - { - getWidget()->parentWidget()->close(); - } - - std::cout << "returning" << std::endl; - return; - } - - { - boost::recursive_mutex::scoped_lock lock(*mutex3D); - - CoinVisualizationPtr robotViewerVisualization = robot->getVisualization<CoinVisualization>(); - - if (robotViewerVisualization) - { - robotVisu->addChild(robotViewerVisualization->getCoinVisualization()); - } - else - { - ARMARX_WARNING << "no robot visu available..."; - } - } - - // start update timer - SoSensorManager* sensor_mgr = SoDB::getSensorManager(); - timerSensor = new SoTimerSensor(timerCB, this); - timerSensor->setInterval(SbTime(TIMER_MS / 1000.0f)); - sensor_mgr->insertTimerSensor(timerSensor); - - connectSlots(); - enableMainWidgetAsync(true); -} - -void RobotViewerWidgetController::onDisconnectComponent() -{ - - ARMARX_INFO << "Disconnecting component"; - - // stop update timer - if (timerSensor) - { - SoSensorManager* sensor_mgr = SoDB::getSensorManager(); - sensor_mgr->removeTimerSensor(timerSensor); - } - - ARMARX_INFO << "Disconnecting component: timer stopped"; - - robotStateComponentPrx = NULL; - { - boost::recursive_mutex::scoped_lock lock(*mutex3D); - - if (robotVisu) - { - ARMARX_INFO << "Disconnecting component: removing visu"; - robotVisu->removeAllChildren(); - } - - robot.reset(); - } - ARMARX_INFO << "Disconnecting component: finished"; -} - - -void RobotViewerWidgetController::onExitComponent() -{ - enableMainWidgetAsync(false); - - { - boost::recursive_mutex::scoped_lock lock(*mutex3D); - - if (debugLayerVisu) - { - debugLayerVisu->removeAllChildren(); - debugLayerVisu->unref(); - debugLayerVisu = NULL; - } - - if (robotVisu) - { - robotVisu->removeAllChildren(); - robotVisu->unref(); - robotVisu = NULL; - } - - if (rootVisu) - { - rootVisu->removeAllChildren(); - rootVisu->unref(); - rootVisu = NULL; - } - } - - /* - if (debugDrawer && debugDrawer->getObjectScheduler()) - { - ARMARX_INFO << "Removing DebugDrawer component..."; - debugDrawer->getObjectScheduler()->terminate(); - ARMARX_INFO << "Removing DebugDrawer component...done"; - } - */ -} - -QPointer<QDialog> RobotViewerWidgetController::getConfigDialog(QWidget* parent) -{ - if (!dialog) - { - dialog = new RobotViewerConfigDialog(parent); - dialog->setName(dialog->getDefaultName()); - - } - - return qobject_cast<RobotViewerConfigDialog*>(dialog); -} - - - -void RobotViewerWidgetController::configured() -{ - ARMARX_VERBOSE << "RobotViewerWidget::configured()"; - robotStateComponentName = dialog->proxyFinder->getSelectedProxyName().trimmed().toStdString(); - - //TODO: Config dialog erweitern - - robotIKName = "RobotIK"; - kinematicUnitComponentName = "Armar3KinematicUnit"; -} - - -void RobotViewerWidgetController::loadSettings(QSettings* settings) -{ - robotStateComponentName = settings->value("RobotStateComponent", QString::fromStdString(ROBOTSTATE_NAME_DEFAULT)).toString().toStdString(); -} - -void RobotViewerWidgetController::saveSettings(QSettings* settings) -{ - settings->setValue("RobotStateComponent", QString::fromStdString(robotStateComponentName)); -} - - -void RobotViewerWidgetController::showVisuLayers(bool show) -{ - if (debugDrawer) - { - if (show) - { - debugDrawer->enableAllLayers(); - } - else - { - debugDrawer->disableAllLayers(); - } - } -} - -void RobotViewerWidgetController::showRoot(bool show) -{ - if (!debugDrawer) - { - return; - } - - std::string poseName("root"); - - if (show) - { - Eigen::Matrix4f gp = Eigen::Matrix4f::Identity(); - PosePtr gpP(new Pose(gp)); - debugDrawer->setPoseDebugLayerVisu(poseName, gpP); - } - else - { - debugDrawer->removePoseDebugLayerVisu(poseName); - } -} - -void RobotViewerWidgetController::showRobot(bool show) -{ - if (!robotVisu) - { - return; - } - - boost::recursive_mutex::scoped_lock lock(*mutex3D); - - if (show && rootVisu->findChild(robotVisu) < 0) - { - rootVisu->addChild(robotVisu); - } - else if (!show && rootVisu->findChild(robotVisu) >= 0) - { - rootVisu->removeChild(robotVisu); - } -} -SoNode* RobotViewerWidgetController::getScene() -{ - return rootVisu; -} - -void RobotViewerWidgetController::timerCB(void* data, SoSensor* sensor) -{ - RobotViewerWidgetController* controller = static_cast<RobotViewerWidgetController*>(data); - - if (!controller) - { - return; - } - - controller->updateRobotVisu(); -} - - -void RobotViewerWidgetController::connectSlots() -{ - connect(this, SIGNAL(robotStatusUpdated()), this, SLOT(updateRobotVisu())); - connect(ui.cbDebugLayer, SIGNAL(toggled(bool)), this, SLOT(showVisuLayers(bool)), Qt::QueuedConnection); - connect(ui.cbRoot, SIGNAL(toggled(bool)), this, SLOT(showRoot(bool)), Qt::QueuedConnection); - connect(ui.cbRobot, SIGNAL(toggled(bool)), this, SLOT(showRobot(bool)), Qt::QueuedConnection); -} - - - -VirtualRobot::RobotPtr RobotViewerWidgetController::loadRobotFile(std::string fileName) -{ - VirtualRobot::RobotPtr robot; - - if (!ArmarXDataPath::getAbsolutePath(fileName, fileName)) - { - ARMARX_INFO << "Could not find Robot XML file with name " << fileName; - } - - robot = RobotIO::loadRobot(fileName); - - if (!robot) - { - ARMARX_INFO << "Could not find Robot XML file with name " << fileName; - } - - return robot; -} - - - -void RobotViewerWidgetController::updateRobotVisu() -{ - boost::recursive_mutex::scoped_lock lock(*mutex3D); - - if (!robotStateComponentPrx || !robot) - { - return; - } - - try - { - RemoteRobot::synchronizeLocalClone(robot, robotStateComponentPrx); - } - catch (...) - { - ARMARX_INFO << deactivateSpam(5) << "Robot synchronization failed"; - return; - } - - Eigen::Matrix4f gp = robot->getGlobalPose(); - QString roboInfo("Robot Pose (global): pos: "); - roboInfo += QString::number(gp(0, 3), 'f', 2); - roboInfo += QString(", "); - roboInfo += QString::number(gp(1, 3), 'f', 2); - roboInfo += QString(", "); - roboInfo += QString::number(gp(2, 3), 'f', 2); - roboInfo += QString(", rot:"); - Eigen::Vector3f rpy; - VirtualRobot::MathTools::eigen4f2rpy(gp, rpy); - roboInfo += QString::number(rpy(0), 'f', 2); - roboInfo += QString(", "); - roboInfo += QString::number(rpy(1), 'f', 2); - roboInfo += QString(", "); - roboInfo += QString::number(rpy(2), 'f', 2); - ui.leRobotInfo->setText(roboInfo); -} - -void RobotViewerWidgetController::solveIK() -{ - //auto robotNodeSets = robot->getRobotNodeSets(); - - ::Ice::AsyncResultPtr asyncResult = robotIKPrx->begin_computeIKGlobalPose("LeftArm", new Pose(), eAll); - - while (!asyncResult->isCompleted()) - { - qApp->processEvents(); - } - - auto targetJointAngles = robotIKPrx->end_computeIKGlobalPose(asyncResult); - - kinematicUnitInterfacePrx->setJointAngles(targetJointAngles); - //kinematicUnitInterfacePrx->switchControlMode(); -} - -void RobotViewerWidgetController::setMutex3D(boost::shared_ptr<boost::recursive_mutex> mutex3D) -{ - //ARMARX_IMPORTANT << "set mutex3d :" << mutex3D.get(); - this->mutex3D = mutex3D; - - if (debugDrawer) - { - debugDrawer->setMutex(mutex3D); - } -} - - -Q_EXPORT_PLUGIN2(armarx_gui_RobotViewerGuiPlugin, RobotViewerGuiPlugin) diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.h b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.h deleted file mode 100644 index dc38933e6..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.h +++ /dev/null @@ -1,179 +0,0 @@ -/* -* This file is part of ArmarX. -* -* ArmarX is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* ArmarX is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* @package ArmarX::Component::RobotViewerGuiPlugin -* @author Nikolaus Vahrenkamp -* @copyright 2015 KIT -* @license http://www.gnu.org/licenses/gpl-2.0.txt -* GNU General Public License - -*/ - -#ifndef ARMARX_COMPONENT_ROBOTVIEWER_GUI_H -#define ARMARX_COMPONENT_ROBOTVIEWER_GUI_H - -/* ArmarX headers */ -#include <RobotAPI/gui-plugins/RobotViewerPlugin/ui_RobotViewerGuiPlugin.h> -#include <RobotAPI/components/DebugDrawer/DebugDrawerComponent.h> -#include <RobotAPI/libraries/core/remoterobot/RemoteRobot.h> -#include <RobotAPI/interface/core/RobotIK.h> - -#include <Gui/ArmarXGuiLib/ArmarXGuiPlugin.h> -#include <Gui/ArmarXGuiLib/ArmarXComponentWidgetController.h> - -#include <ArmarXCore/core/Component.h> - -/* Qt headers */ -#include <QtGui/QMainWindow> - - -#include <VirtualRobot/Robot.h> -#include <VirtualRobot/Nodes/RobotNode.h> -#include <VirtualRobot/RobotNodeSet.h> -#include <VirtualRobot/Visualization/VisualizationFactory.h> -#include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h> -#include <RobotAPI/interface/core/RobotState.h> - -#include <boost/shared_ptr.hpp> - -#include <Inventor/sensors/SoTimerSensor.h> - -namespace armarx -{ - typedef boost::shared_ptr<VirtualRobot::CoinVisualization> CoinVisualizationPtr; - - class RobotViewerConfigDialog; - - /** - \class RobotViewerGuiPlugin - \brief This plugin provides a generic widget showing a 3D model of the robot. The robot is articulated and moved according to the corresponding RemoteRobot. - Further, DebugDrawer methods are available. - \see RobotViewerWidget - */ - class RobotViewerGuiPlugin : - public ArmarXGuiPlugin - { - public: - RobotViewerGuiPlugin(); - - QString getPluginName() - { - return "RobotViewerGuiPlugin"; - } - }; - - /** - \class RobotViewerWidget - \brief This widget shows a 3D model of the robot. The robot is articulated and moved according to the corresponding RemoteRobot. - Further, DebugDrawer methods are available. - \image html RobotViewerGUI.png - When you add the widget to the Gui, you need to specify the following parameters: - - Parameter Name | Example Value | Required? | Description - :---------------- | :-------------: | :-------------- |:-------------------- - Proxy | RobotStateComponent | Yes | The name of the robot state component. - - \ingroup RobotAPI-ArmarXGuiPlugins ArmarXGuiPlugins - \see RobotViewerGuiPlugin - */ - class RobotViewerWidgetController : - public ArmarXComponentWidgetController - { - Q_OBJECT - public: - - RobotViewerWidgetController(); - virtual ~RobotViewerWidgetController() {} - - // inherited from Component - virtual void onInitComponent(); - virtual void onConnectComponent(); - virtual void onDisconnectComponent(); - virtual void onExitComponent(); - - // inherited of ArmarXWidget - virtual QString getWidgetName() const - { - return "RobotControl.RobotIK"; - } - QPointer<QDialog> getConfigDialog(QWidget* parent = 0); - virtual void loadSettings(QSettings* settings); - virtual void saveSettings(QSettings* settings); - void configured(); - - SoNode* getScene(); - - // overwrite setMutex, so that we can inform the debugdrawer - virtual void setMutex3D(boost::shared_ptr<boost::recursive_mutex> mutex3D); - - signals: - - void robotStatusUpdated(); - - public slots: - - void updateRobotVisu(); - void solveIK(); - - - - protected: - void connectSlots(); - - - Ui::RobotViewerGuiPlugin ui; - - bool verbose; - - - RobotStateComponentInterfacePrx robotStateComponentPrx; - KinematicUnitInterfacePrx kinematicUnitInterfacePrx; - RobotIKInterfacePrx robotIKPrx; - - VirtualRobot::RobotPtr robot; - - SoSeparator* robotVisu; - SoSeparator* rootVisu; - - std::string robotStateComponentName; - std::string kinematicUnitComponentName; - std::string robotIKName; - - SoTimerSensor* timerSensor; - - SoSeparator* debugLayerVisu; - armarx::DebugDrawerComponentPtr debugDrawer; - - static void timerCB(void* data, SoSensor* sensor); - protected slots: - void showVisuLayers(bool show); - void showRoot(bool show); - void showRobot(bool show); - private: - - // init stuff - VirtualRobot::RobotPtr loadRobotFile(std::string fileName); - - CoinVisualizationPtr getCoinVisualization(VirtualRobot::RobotPtr robot); - - - QPointer<QWidget> __widget; - QPointer<RobotViewerConfigDialog> dialog; - - }; - typedef boost::shared_ptr<RobotViewerWidgetController> RobotViewerGuiPluginPtr; -} - -#endif diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.ui b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.ui deleted file mode 100644 index 2a8526ac8..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/Backup/RobotViewerGuiPlugin.ui +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>RobotViewerGuiPlugin</class> - <widget class="QWidget" name="RobotViewerGuiPlugin"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>912</width> - <height>100</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>100</height> - </size> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="1"> - <widget class="QCheckBox" name="cbDebugLayer"> - <property name="text"> - <string>show debug layer</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLineEdit" name="leRobotInfo"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="0"> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetMaximumSize</enum> - </property> - <item> - <widget class="QLabel" name="labelRobotViewerName"> - <property name="font"> - <font> - <family>AlArabiya</family> - <pointsize>14</pointsize> - </font> - </property> - <property name="text"> - <string>RobotViewer</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="1" column="1"> - <widget class="QCheckBox" name="cbRoot"> - <property name="text"> - <string>show root</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QCheckBox" name="cbRobot"> - <property name="text"> - <string>show robot</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections/> -</ui> diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/CMakeLists.txt b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/CMakeLists.txt deleted file mode 100644 index bc97728d1..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -armarx_set_target("RobotIKGuiPlugin") - -find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL QUIET) - -find_package(Eigen3 QUIET) - -# VirtualRobot (adds dependencies to Coin3D and SoQt) -find_package(Simox ${ArmarX_Simox_VERSION} QUIET) -#find_package(ArmarXGui QUIET) - -armarx_build_if(ArmarXGui_FOUND "ArmarXGui not available") - -armarx_build_if(QT_FOUND "Qt not available") -armarx_build_if(QT_QTOPENGL_FOUND "QtOpenGL not available") -armarx_build_if(Eigen3_FOUND "Eigen3 not available") -armarx_build_if(Simox_FOUND "VirtualRobot not available") - -include(${QT_USE_FILE}) - -include_directories(${Eigen3_INCLUDE_DIR}) -include_directories(${Simox_INCLUDE_DIRS}) - - -set(SOURCES - RobotIKGuiPlugin.cpp - RobotIKConfigDialog.cpp - RobotViewer.cpp - RobotViewerWidget.cpp -) -set(HEADERS - RobotIKGuiPlugin.h - RobotIKConfigDialog.h - RobotViewer.h - RobotViewerWidget.h -) - -set(GUI_MOC_HDRS - RobotIKGuiPlugin.h - RobotIKConfigDialog.h - RobotViewer.h - RobotViewerWidget.h -) - -set(GUI_UIS - RobotIKGuiPlugin.ui - RobotIKConfigDialog.ui -) - -set(COMPONENT_LIBS RobotAPIUnits DebugDrawer ${Simox_LIBRARIES}) - - - - -if (ArmarXGui_FOUND) - armarx_gui_library(RobotIKGuiPlugin "${SOURCES}" "${GUI_MOC_HDRS}" "${GUI_UIS}" "" "${COMPONENT_LIBS}" ) -endif() diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.cpp b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.cpp deleted file mode 100644 index 54b438f34..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/* -* This file is part of ArmarX. -* -* ArmarX is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* ArmarX is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* @package ArmarX:: -* @author Philipp Schmidt -* @date 2015 -* @copyright http://www.gnu.org/licenses/gpl-2.0.txt -* GNU General Public License -*/ - -//Configuration dialog -#include "RobotIKConfigDialog.h" -#include "ui_RobotIKConfigDialog.h" - -//RobotAPI includes for different Components -#include <RobotAPI/interface/core/RobotIK.h> -#include <RobotAPI/interface/core/RobotState.h> - -//Qt includes -#include <QPushButton> -#include <QMessageBox> - -//Ice includes -#include <IceUtil/UUID.h> - -armarx::RobotIKConfigDialog::RobotIKConfigDialog(QWidget* parent) : - QDialog(parent), - ui(new Ui::RobotIKConfigDialog), - uuid(IceUtil::generateUUID()) -{ - ui->setupUi(this); - - //Connect OK Button to the event checking the input parameters - connect(this->ui->buttonBox, SIGNAL(accepted()), this, SLOT(verifyConfiguration())); - - //Set OK button as default for convenience - ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); - - //Initialize proxyFinders for every component - robotStateComponentProxyFinder = new IceProxyFinder<RobotStateComponentInterfacePrx>(this); - robotStateComponentProxyFinder->setSearchMask("RobotState*"); - ui->gridLayout->addWidget(robotStateComponentProxyFinder, 1, 1); - - kinematicUnitComponentProxyFinder = new IceProxyFinder<KinematicUnitInterfacePrx>(this); - kinematicUnitComponentProxyFinder->setSearchMask("Armar3Kinematic*"); - ui->gridLayout->addWidget(kinematicUnitComponentProxyFinder, 2, 1); - - robotIKComponentProxyFinder = new IceProxyFinder<RobotIKInterfacePrx>(this); - robotIKComponentProxyFinder->setSearchMask("RobotIK*"); - ui->gridLayout->addWidget(robotIKComponentProxyFinder, 3, 1); -} - -armarx::RobotIKConfigDialog::~RobotIKConfigDialog() -{ - delete ui; -} - -void armarx::RobotIKConfigDialog::onInitComponent() -{ - robotStateComponentProxyFinder->setIceManager(this->getIceManager()); - kinematicUnitComponentProxyFinder->setIceManager(this->getIceManager()); - robotIKComponentProxyFinder->setIceManager(this->getIceManager()); -} - -void armarx::RobotIKConfigDialog::onConnectComponent() -{ - -} - -void armarx::RobotIKConfigDialog::onExitComponent() -{ - QObject::disconnect(); -} - -void armarx::RobotIKConfigDialog::verifyConfiguration() -{ - if (robotStateComponentProxyFinder->getSelectedProxyName().trimmed().length() == 0 - || kinematicUnitComponentProxyFinder->getSelectedProxyName().trimmed().length() == 0 - || robotIKComponentProxyFinder->getSelectedProxyName().trimmed().length() == 0) - { - QMessageBox::critical(this, "Invalid Configuration", "The proxy name must not be empty"); - } - else - { - this->accept(); - } -} diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.h b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.h deleted file mode 100644 index 3d34f2f6c..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -* This file is part of ArmarX. -* -* ArmarX is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* ArmarX is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* @package ArmarX:: -* @author Philipp Schmidt -* @date 2015 -* @copyright http://www.gnu.org/licenses/gpl-2.0.txt -* GNU General Public License -*/ - -#ifndef RobotIKCONFIGDIALOG_H -#define RobotIKCONFIGDIALOG_H - -//ArmarX includes -#include <ArmarXGui/libraries/ArmarXGuiBase/widgets/IceProxyFinder.h> - -//Qt includes -#include <QDialog> - -namespace Ui -{ - class RobotIKConfigDialog; -} - -namespace armarx -{ - class RobotIKConfigDialog : public QDialog, virtual public ManagedIceObject - { - Q_OBJECT - friend class RobotIKWidgetController; - - public: - explicit RobotIKConfigDialog(QWidget* parent = 0); - ~RobotIKConfigDialog(); - - // inherited from ManagedIceObject - std::string getDefaultName() const - { - return "RobotIKConfigDialog" + uuid; - } - void onInitComponent(); - void onConnectComponent(); - void onExitComponent(); - - public slots: - void verifyConfiguration(); - - private: - IceProxyFinderBase* robotStateComponentProxyFinder; - IceProxyFinderBase* kinematicUnitComponentProxyFinder; - IceProxyFinderBase* robotIKComponentProxyFinder; - - Ui::RobotIKConfigDialog* ui; - std::string uuid; - }; -} - -#endif diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.ui b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.ui deleted file mode 100644 index 280951dbb..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKConfigDialog.ui +++ /dev/null @@ -1,63 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>RobotIKConfigDialog</class> - <widget class="QDialog" name="RobotIKConfigDialog"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>527</width> - <height>96</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>RobotIKConfigDialog</string> - </property> - <property name="toolTip"> - <string/> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="0"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - <item row="0" column="0"> - <layout class="QGridLayout" name="gridLayout"/> - </item> - </layout> - </widget> - <tabstops> - <tabstop>buttonBox</tabstop> - </tabstops> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>rejected()</signal> - <receiver>RobotIKConfigDialog</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>316</x> - <y>260</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - </connections> -</ui> diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.cpp b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.cpp deleted file mode 100644 index 3e2badc6d..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.cpp +++ /dev/null @@ -1,606 +0,0 @@ -/* -* This file is part of ArmarX. -* -* ArmarX is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* ArmarX is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* @package ArmarX:: -* @author Philipp Schmidt -* @date 2015 -* @license http://www.gnu.org/licenses/gpl-2.0.txt -* GNU General Public License - -*/ - -#include "RobotIKGuiPlugin.h" -#include "RobotViewer.h" - -/* ArmarX includes */ -#include <ArmarXCore/core/system/ArmarXDataPath.h> -#include <ArmarXCore/core/ArmarXObjectScheduler.h> -#include <ArmarXCore/core/system/cmake/CMakePackageFinder.h> -#include <ArmarXCore/core/application/Application.h> - -/* Virtual Robot includes */ -#include <VirtualRobot/XML/RobotIO.h> -#include <VirtualRobot/Visualization/CoinVisualization/CoinVisualizationFactory.h> - -/* Coin includes */ -#include <Inventor/actions/SoGetMatrixAction.h> -#include <Inventor/actions/SoSearchAction.h> -#include <Inventor/SbViewportRegion.h> - -#define ROBOT_UPDATE_TIMER_MS 33 -#define TEXTFIELD_UPDATE_TIMER_MS 200 - -armarx::RobotIKGuiPlugin::RobotIKGuiPlugin() -{ - addWidget<RobotIKWidgetController>(); -} - -armarx::RobotIKWidgetController::RobotIKWidgetController() : startUpCameraPositioningFlag(true) -{ - //Initialize Gui - ui.setupUi(getWidget()); - getWidget()->setEnabled(false); - - //Alignment for ui - this->ui.verticalLayout->setAlignment(Qt::AlignTop); - - //Label color can not be set in designer, so we do it here - this->ui.reachableLabel->setStyleSheet("QLabel { color : red; }"); - - //Component names - robotStateComponentName = ""; - robotIKComponentName = ""; - kinematicUnitComponentName = ""; - - manipSeparator = NULL; - currentSeparator = NULL; - tcpManip = NULL; - tcpManipTransform = NULL; - tcpManipColor = NULL; - tcpManipSphere = NULL; - tcpCurrentTransform = NULL; - tcpCurrentColor = NULL; - tcpCurrentSphere = NULL; - robotUpdateSensor = NULL; - textFieldUpdateSensor = NULL; -} - -void armarx::RobotIKWidgetController::onInitComponent() -{ - //Prepare proxies - usingProxy(robotStateComponentName); - usingProxy(robotIKComponentName); - usingProxy(kinematicUnitComponentName); -} - -void armarx::RobotIKWidgetController::onConnectComponent() -{ - //Get all proxies - robotStateComponentPrx = getProxy<RobotStateComponentInterfacePrx>(robotStateComponentName); - kinematicUnitInterfacePrx = getProxy<KinematicUnitInterfacePrx>(kinematicUnitComponentName); - robotIKPrx = getProxy<RobotIKInterfacePrx>(robotIKComponentName); - - //Load robot - robot = loadRobot(getIncludePaths()); - - if (!robot) - { - getObjectScheduler()->terminate(); - - if (getWidget()->parentWidget()) - { - getWidget()->parentWidget()->close(); - } - - ARMARX_ERROR << "RobotIKPlugin: Unable to load robot file! Terminating." << std::endl; - return; - } - - //Get visualization for our robot and add it to scene graph - CoinVisualizationPtr robotViewerVisualization = robot->getVisualization<VirtualRobot::CoinVisualization>(); - this->ui.robotViewer->getRobotViewer()->getRootNode()->addChild(robotViewerVisualization->getCoinVisualization()); - - //Make a timer update robo pose every time tick - SoSensorManager* sensor_mgr = SoDB::getSensorManager(); - robotUpdateSensor = new SoTimerSensor(robotUpdateTimerCB, this); - robotUpdateSensor->setInterval(SbTime(ROBOT_UPDATE_TIMER_MS / 1000.0f)); - sensor_mgr->insertTimerSensor(robotUpdateSensor); - - //And a timer to update the labels - textFieldUpdateSensor = new SoTimerSensor(textFieldUpdateTimerCB, this); - textFieldUpdateSensor->setInterval(SbTime(TEXTFIELD_UPDATE_TIMER_MS / 1000.0f)); - sensor_mgr->insertTimerSensor(textFieldUpdateSensor); - - //Get all kinematic chain descriptions and add them to the combo box - auto robotNodeSets = robot->getRobotNodeSets(); - - for (VirtualRobot::RobotNodeSetPtr s : robotNodeSets) - { - this->ui.comboBox->addItem(QString::fromStdString(s->getName())); - } - - //Make sure comboBox is enabled so you can select a kinematic chain - this->ui.comboBox->setEnabled(true); - - //Get all caertesian selections and add them - this->ui.cartesianselection->addItem(QString::fromStdString("Orientation and Position")); - this->ui.cartesianselection->addItem(QString::fromStdString("Position")); - this->ui.cartesianselection->addItem(QString::fromStdString("Orientation")); - this->ui.cartesianselection->addItem(QString::fromStdString("X position")); - this->ui.cartesianselection->addItem(QString::fromStdString("Y position")); - this->ui.cartesianselection->addItem(QString::fromStdString("Z position")); - - //Make sure it is enabled - this->ui.cartesianselection->setEnabled(true); - this->ui.cartesianselection->setCurrentIndex(0); - - connectSlots(); - enableMainWidgetAsync(true); -} - -void armarx::RobotIKWidgetController::onDisconnectComponent() -{ - //Stop timers - SoSensorManager* sensor_mgr = SoDB::getSensorManager(); - sensor_mgr->removeTimerSensor(textFieldUpdateSensor); - sensor_mgr->removeTimerSensor(robotUpdateSensor); - - //Remove all options in comboBox - this->ui.comboBox->clear(); - - //Disable ui controls - this->ui.comboBox->setEnabled(false); - this->ui.moveTCP->setEnabled(false); - this->ui.reachableLabel->setEnabled(false); - this->ui.reachableLabel->setText(QString::fromStdString("No kinematic chain selected")); - this->ui.reachableLabel->setStyleSheet("QLabel { color : red; }"); - this->ui.errorValue->setEnabled(false); - this->ui.errorValue->setText(QString::fromStdString("Calculated error: 0")); - this->ui.errorValue->setEnabled(false); - this->ui.pushButton->setEnabled(false); - this->ui.currentPose->setEnabled(false); - this->ui.currentPoseMatrix->setEnabled(false); - this->ui.desiredPose->setEnabled(false); - this->ui.desiredPoseMatrix->setEnabled(false); - this->ui.resetManip->setEnabled(false); - - //Remove all visualization - this->ui.robotViewer->getRobotViewer()->getRootNode()->removeAllChildren(); - - //Reset visualization pointers - manipSeparator = NULL; - currentSeparator = NULL; - tcpManip = NULL; - tcpManipTransform = NULL; - tcpManipColor = NULL; - tcpManipSphere = NULL; - tcpCurrentTransform = NULL; - tcpCurrentColor = NULL; - tcpCurrentSphere = NULL; - robotUpdateSensor = NULL; - textFieldUpdateSensor = NULL; - - //Delete proxies - robotStateComponentPrx = NULL; - kinematicUnitInterfacePrx = NULL; - robotIKPrx = NULL; -} - -void armarx::RobotIKWidgetController::onExitComponent() -{ - enableMainWidgetAsync(false); -} - -QPointer<QDialog> armarx::RobotIKWidgetController::getConfigDialog(QWidget* parent) -{ - if (!dialog) - { - dialog = new RobotIKConfigDialog(parent); - } - - return qobject_cast<RobotIKConfigDialog*>(dialog); -} - -void armarx::RobotIKWidgetController::loadSettings(QSettings* settings) -{ - -} - -void armarx::RobotIKWidgetController::saveSettings(QSettings* settings) -{ - -} - -void armarx::RobotIKWidgetController::configured() -{ - robotStateComponentName = dialog->robotStateComponentProxyFinder->getSelectedProxyName().trimmed().toStdString(); - robotIKComponentName = dialog->robotIKComponentProxyFinder->getSelectedProxyName().trimmed().toStdString(); - kinematicUnitComponentName = dialog->kinematicUnitComponentProxyFinder->getSelectedProxyName().trimmed().toStdString(); -} - -void armarx::RobotIKWidgetController::solveIK() -{ - auto targetJointAngles = getIKSolution(); - - if (targetJointAngles.isReachable) - { - //Switch all control modes to ePositionControl - std::vector<VirtualRobot::RobotNodePtr> rn = robot->getRobotNodeSet(this->ui.comboBox->currentText().toStdString())->getAllRobotNodes(); - NameControlModeMap jointModes; - NameValueMap jointAngles; - - for (unsigned int i = 0; i < rn.size(); i++) - { - jointModes[rn[i]->getName()] = ePositionControl; - jointAngles[rn[i]->getName()] = 0.0f; - } - - kinematicUnitInterfacePrx->switchControlMode(jointModes); - kinematicUnitInterfacePrx->setJointAngles(targetJointAngles.jointAngles); - } -} - -void armarx::RobotIKWidgetController::kinematicChainChanged(const QString& arg1) -{ - //An item has been selected, so we can allow the user to use the ui now - //The manipulator will be set to the position of the current tcp, so this pose - //has to be reachable! - this->ui.moveTCP->setEnabled(true); - this->ui.reachableLabel->setEnabled(true); - this->ui.reachableLabel->setText(QString::fromStdString("Pose reachable!")); - this->ui.reachableLabel->setStyleSheet("QLabel { color : green; }"); - this->ui.errorValue->setText(QString::fromStdString("Calculated error: 0")); - this->ui.errorValue->setEnabled(true); - this->ui.pushButton->setEnabled(true); - this->ui.currentPose->setEnabled(true); - this->ui.currentPoseMatrix->setEnabled(true); - this->ui.desiredPose->setEnabled(true); - this->ui.desiredPoseMatrix->setEnabled(true); - this->ui.resetManip->setEnabled(true); - - //Remove all current tcp and desired tcp pose visualization if present - if (currentSeparator) - { - this->ui.robotViewer->getRobotViewer()->getRootNode()->removeChild(currentSeparator); - } - - if (manipSeparator) - { - this->ui.robotViewer->getRobotViewer()->getRootNode()->removeChild(manipSeparator); - } - - //Create new Visualization - manipSeparator = new SoSeparator; - currentSeparator = new SoSeparator; - - tcpCurrentColor = new SoMaterial; - tcpCurrentColor->transparency = 0.6f; - tcpCurrentSphere = new SoSphere; - tcpCurrentSphere->radius = 0.06f; - tcpManipColor = new SoMaterial; - tcpManipColor->ambientColor.setValue(0, 1, 0); - tcpManipColor->transparency = 0.3f; - tcpManipSphere = new SoSphere; - tcpManipSphere->radius = 0.06f; - tcpManip = new SoTransformerManip; - - //We need this null separator to remove the scale knobs - //This won't lead to memory leak, because this guy - //will be deleted when the separator itself gets removed - //from the scene graph - SoSeparator* nullSep = new SoSeparator; - - //Make all scale knobs disappear - tcpManip->getDragger()->setPart("scale1", nullSep); - tcpManip->getDragger()->setPart("scale2", nullSep); - tcpManip->getDragger()->setPart("scale3", nullSep); - tcpManip->getDragger()->setPart("scale4", nullSep); - tcpManip->getDragger()->setPart("scale5", nullSep); - tcpManip->getDragger()->setPart("scale6", nullSep); - tcpManip->getDragger()->setPart("scale7", nullSep); - tcpManip->getDragger()->setPart("scale8", nullSep); - - tcpManip->getDragger()->addFinishCallback(manipFinishCallback, this); - tcpCurrentTransform = new SoTransform; - tcpManipTransform = new SoTransform; - - manipSeparator->addChild(tcpManipTransform); - manipSeparator->addChild(tcpManip); - manipSeparator->addChild(tcpManipColor); - manipSeparator->addChild(tcpManipSphere); - - currentSeparator->addChild(tcpCurrentTransform); - currentSeparator->addChild(tcpCurrentColor); - currentSeparator->addChild(tcpCurrentSphere); - - this->ui.robotViewer->getRobotViewer()->getRootNode()->insertChild(currentSeparator, 0); - this->ui.robotViewer->getRobotViewer()->getRootNode()->insertChild(manipSeparator, 0); - - //Get TCP pose - Eigen::Matrix4f mat = robot->getRobotNodeSet(arg1.toStdString())->getTCP()->getGlobalPose(); - mat(0, 3) /= 1000; - mat(1, 3) /= 1000; - mat(2, 3) /= 1000; - - //Apply to current and desired visualizer - tcpCurrentTransform->setMatrix(VirtualRobot::CoinVisualizationFactory::getSbMatrix(mat)); - tcpManipTransform->setMatrix(VirtualRobot::CoinVisualizationFactory::getSbMatrix(mat)); - - /*tcpManip->translation.setValue(mat(0, 3) / 1000, mat(1, 3) / 1000, mat(2, 3) / 1000); - tcpManip->rotation.setValue(SbRotation(VirtualRobot::CoinVisualizationFactory::getSbMatrix(mat)));*/ -} - -void armarx::RobotIKWidgetController::caertesianSelectionChanged(const QString& arg1) -{ - //If there is a manip in the scene we pretend it just moved to update color etc. - if (tcpManip) - { - manipFinishCallback(this, NULL); - } -} - -void armarx::RobotIKWidgetController::resetManip() -{ - //Triggers reset of manipulator in kinematicChainChanged - kinematicChainChanged(this->ui.comboBox->currentText()); -} - -void armarx::RobotIKWidgetController::connectSlots() -{ - connect(ui.resetManip, SIGNAL(clicked()), this, SLOT(resetManip()), Qt::QueuedConnection); - connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(solveIK()), Qt::QueuedConnection); - connect(ui.comboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(kinematicChainChanged(QString)), Qt::UniqueConnection); - connect(ui.cartesianselection, SIGNAL(currentIndexChanged(QString)), this, SLOT(caertesianSelectionChanged(QString)), Qt::UniqueConnection); -} - -armarx::StringList armarx::RobotIKWidgetController::getIncludePaths() -{ - StringList includePaths; - - try - { - StringList packages = robotStateComponentPrx->getArmarXPackages(); - packages.push_back(Application::GetProjectName()); - - for (const std::string& projectName : packages) - { - if (projectName.empty()) - { - continue; - } - - CMakePackageFinder project(projectName); - StringList projectIncludePaths; - auto pathsString = project.getDataDir(); - boost::split(projectIncludePaths, - pathsString, - boost::is_any_of(";,"), - boost::token_compress_on); - includePaths.insert(includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end()); - } - } - catch (...) - { - ARMARX_ERROR << "Unable to retrieve robot filename." << std::endl; - } - - return includePaths; -} - -VirtualRobot::RobotPtr armarx::RobotIKWidgetController::loadRobot(StringList includePaths) -{ - try - { - std::string rfile = robotStateComponentPrx->getRobotFilename(); - ArmarXDataPath::getAbsolutePath(rfile, rfile, includePaths); - return VirtualRobot::RobotIO::loadRobot(rfile); - } - catch (...) - { - ARMARX_ERROR << "Unable to load robot from file" << std::endl; - return VirtualRobot::RobotPtr(); - } -} - -void armarx::RobotIKWidgetController::manipFinishCallback(void* data, SoDragger* dragger) -{ - RobotIKWidgetController* controller = static_cast<RobotIKWidgetController*>(data); - - auto targetJointAngles = controller->getIKSolution(); - - if (targetJointAngles.isReachable) - { - //Green - controller->tcpManipColor->ambientColor.setValue(0, 1, 0); - controller->ui.reachableLabel->setText(QString::fromStdString("Pose reachable!")); - controller->ui.reachableLabel->setStyleSheet("QLabel { color : green; }"); - } - else - { - //Red - controller->tcpManipColor->ambientColor.setValue(1, 0, 0); - controller->ui.reachableLabel->setText(QString::fromStdString("Pose unreachable!")); - controller->ui.reachableLabel->setStyleSheet("QLabel { color : red; }"); - } - - //Display calculated error - controller->ui.errorValue->setText(QString::fromStdString("Calculated error: " + boost::lexical_cast<std::string>(targetJointAngles.error))); -} - -void armarx::RobotIKWidgetController::robotUpdateTimerCB(void* data, SoSensor* sensor) -{ - RobotIKWidgetController* controller = static_cast<RobotIKWidgetController*>(data); - - if (!controller || !controller->robotStateComponentPrx || !controller->robot) - { - return; - } - - try - { - armarx::RemoteRobot::synchronizeLocalClone(controller->robot, controller->robotStateComponentPrx); - - if (controller->currentSeparator) - { - Eigen::Matrix4f tcpMatrix = controller->robot->getRobotNodeSet(controller->ui.comboBox->currentText().toStdString())->getTCP()->getGlobalPose(); - //Apply tcp position to indicator - tcpMatrix(0, 3) /= 1000; - tcpMatrix(1, 3) /= 1000; - tcpMatrix(2, 3) /= 1000; - controller->tcpCurrentTransform->setMatrix(VirtualRobot::CoinVisualizationFactory::getSbMatrix(tcpMatrix)); - } - - if (controller->startUpCameraPositioningFlag) - { - controller->ui.robotViewer->getRobotViewer()->cameraViewAll(); - controller->startUpCameraPositioningFlag = false; - } - } - catch (...) {}; -} - -void armarx::RobotIKWidgetController::textFieldUpdateTimerCB(void* data, SoSensor* sensor) -{ - RobotIKWidgetController* controller = static_cast<RobotIKWidgetController*>(data); - - if (!controller) - { - return; - } - - if (controller->currentSeparator) - { - Eigen::Matrix4f tcpMatrix = controller->robot->getRobotNodeSet(controller->ui.comboBox->currentText().toStdString())->getTCP()->getGlobalPose(); - - //Set text label to tcp matrix - std::stringstream buffer; - buffer << tcpMatrix; - std::string matrixText = buffer.str(); - controller->ui.currentPoseMatrix->setText(QString::fromStdString(matrixText)); - - //Set text label for desired tcp pose - //Therefore calculate current manipulator pose - SoGetMatrixAction* action = new SoGetMatrixAction(SbViewportRegion()); - SoSearchAction sa; - sa.setNode(controller->tcpManipSphere); - sa.setSearchingAll(TRUE); // Search all nodes - SoBaseKit::setSearchingChildren(TRUE); // Even inside nodekits - sa.apply(controller->ui.robotViewer->getRobotViewer()->getRootNode()); - - action->apply(sa.getPath()); - - SbMatrix matrix = action->getMatrix(); - - Eigen::Matrix4f mat = Eigen::Matrix4f::Identity(); - mat(0, 0) = matrix[0][0]; - mat(0, 1) = matrix[1][0]; - mat(0, 2) = matrix[2][0]; - mat(0, 3) = matrix[3][0] * 1000; - - mat(1, 0) = matrix[0][1]; - mat(1, 1) = matrix[1][1]; - mat(1, 2) = matrix[2][1]; - mat(1, 3) = matrix[3][1] * 1000; - - mat(2, 0) = matrix[0][2]; - mat(2, 1) = matrix[1][2]; - mat(2, 2) = matrix[2][2]; - mat(2, 3) = matrix[3][2] * 1000; - - mat(3, 0) = matrix[0][3]; - mat(3, 1) = matrix[1][3]; - mat(3, 2) = matrix[2][3]; - mat(3, 3) = matrix[3][3]; - - //Set text label to manip matrix - std::stringstream buffer2; - buffer2 << mat; - std::string matrixText2 = buffer2.str(); - controller->ui.desiredPoseMatrix->setText(QString::fromStdString(matrixText2)); - - delete(action); - } -} - -armarx::ExtendedIKResult armarx::RobotIKWidgetController::getIKSolution() -{ - SoGetMatrixAction* action = new SoGetMatrixAction(SbViewportRegion()); - SoSearchAction sa; - sa.setNode(tcpManipSphere); - sa.setSearchingAll(TRUE); // Search all nodes - SoBaseKit::setSearchingChildren(TRUE); // Even inside nodekits - sa.apply(this->ui.robotViewer->getRobotViewer()->getRootNode()); - - action->apply(sa.getPath()); - - SbMatrix matrix = action->getMatrix(); - - Eigen::Matrix4f mat = Eigen::Matrix4f::Identity(); - mat(0, 0) = matrix[0][0]; - mat(0, 1) = matrix[1][0]; - mat(0, 2) = matrix[2][0]; - mat(0, 3) = matrix[3][0] * 1000; - - mat(1, 0) = matrix[0][1]; - mat(1, 1) = matrix[1][1]; - mat(1, 2) = matrix[2][1]; - mat(1, 3) = matrix[3][1] * 1000; - - mat(2, 0) = matrix[0][2]; - mat(2, 1) = matrix[1][2]; - mat(2, 2) = matrix[2][2]; - mat(2, 3) = matrix[3][2] * 1000; - - mat(3, 0) = matrix[0][3]; - mat(3, 1) = matrix[1][3]; - mat(3, 2) = matrix[2][3]; - mat(3, 3) = matrix[3][3]; - - // mat = robot->getRootNode()->toLocalCoordinateSystem(mat); - return (robotIKPrx->computeExtendedIKGlobalPose(this->ui.comboBox->currentText().toStdString(), new armarx::Pose(mat), - convertOption(this->ui.cartesianselection->currentText().toStdString()))); -} - -armarx::CartesianSelection armarx::RobotIKWidgetController::convertOption(std::string option) -{ - if (option == "Orientation and Position") - { - return eAll; - } - else if (option == "Position") - { - return ePosition; - } - else if (option == "Orientation") - { - return eOrientation; - } - else if (option == "X position") - { - return eX; - } - else if (option == "Y position") - { - return eY; - } - else if (option == "Z position") - { - return eZ; - } - - return eAll; -} - -Q_EXPORT_PLUGIN2(armarx_gui_RobotIKGuiPlugin, armarx::RobotIKGuiPlugin) diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.h b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.h deleted file mode 100644 index 3dd135614..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.h +++ /dev/null @@ -1,145 +0,0 @@ -/* -* This file is part of ArmarX. -* -* ArmarX is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 as -* published by the Free Software Foundation. -* -* ArmarX is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see <http://www.gnu.org/licenses/>. -* -* @package ArmarX:: -* @author Philipp Schmidt -* @date 2015 -* @license http://www.gnu.org/licenses/gpl-2.0.txt -* GNU General Public License - -*/ - -#ifndef RobotIKGUIPLUGIN_H -#define RobotIKGUIPLUGIN_H - -//Gui -#include "RobotIKConfigDialog.h" -#include "ui_RobotIKGuiPlugin.h" - -//ArmarX includes -#include <ArmarXGui/libraries/ArmarXGuiBase/ArmarXGuiPlugin.h> -#include <ArmarXGui/libraries/ArmarXGuiBase/ArmarXComponentWidgetController.h> -#include <RobotAPI/interface/core/RobotIK.h> -#include <RobotAPI/interface/core/RobotState.h> -#include <RobotAPI/libraries/core/remoterobot/RemoteRobot.h> - -//Qt includes -#include <QObject> - -//VirtualRobot includes -#include <VirtualRobot/Robot.h> -#include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h> - -//Inventor includes -#include <Inventor/sensors/SoTimerSensor.h> -#include <Inventor/manips/SoTransformerManip.h> -#include <Inventor/nodes/SoSphere.h> -#include <Inventor/nodes/SoMaterial.h> - -namespace armarx -{ - class RobotIKConfigDialog; - - class RobotIKGuiPlugin : public ArmarXGuiPlugin - { - public: - RobotIKGuiPlugin(); - - QString getPluginName() - { - return "RobotIKGuiPlugin"; - } - }; - - class RobotIKWidgetController : public ArmarXComponentWidgetController - { - Q_OBJECT - - public: - RobotIKWidgetController(); - virtual ~RobotIKWidgetController() {} - - // inherited from Component - virtual void onInitComponent(); - virtual void onConnectComponent(); - virtual void onDisconnectComponent(); - virtual void onExitComponent(); - - // inherited of ArmarXWidget - virtual QString getWidgetName() const - { - return "RobotControl.RobotIK"; - } - QPointer<QDialog> getConfigDialog(QWidget* parent = 0); - virtual void loadSettings(QSettings* settings); - virtual void saveSettings(QSettings* settings); - void configured(); - - public slots: - void solveIK(); - void kinematicChainChanged(const QString& arg1); - void caertesianSelectionChanged(const QString& arg1); - void resetManip(); - - protected: - RobotStateComponentInterfacePrx robotStateComponentPrx; - KinematicUnitInterfacePrx kinematicUnitInterfacePrx; - RobotIKInterfacePrx robotIKPrx; - - Ui::RobotIKGuiPlugin ui; - - private: - void connectSlots(); - std::string robotStateComponentName; - std::string kinematicUnitComponentName; - std::string robotIKComponentName; - - QPointer<RobotIKConfigDialog> dialog; - - VirtualRobot::RobotPtr robot; - StringList getIncludePaths(); - VirtualRobot::RobotPtr loadRobot(StringList includePaths); - - SoSeparator* manipSeparator; - SoSeparator* currentSeparator; - - SoTransformerManip* tcpManip; - static void manipFinishCallback(void* data, SoDragger* manip); - SoTransform* tcpManipTransform; - SoMaterial* tcpManipColor; - SoSphere* tcpManipSphere; - - SoTransform* tcpCurrentTransform; - SoMaterial* tcpCurrentColor; - SoSphere* tcpCurrentSphere; - - SoTimerSensor* robotUpdateSensor; - static void robotUpdateTimerCB(void* data, SoSensor* sensor); - - SoTimerSensor* textFieldUpdateSensor; - static void textFieldUpdateTimerCB(void* data, SoSensor* sensor); - - ExtendedIKResult getIKSolution(); - - CartesianSelection convertOption(std::string option); - - bool startUpCameraPositioningFlag; - - }; - typedef boost::shared_ptr<RobotIKWidgetController> RobotIKGuiPluginPtr; - typedef boost::shared_ptr<VirtualRobot::CoinVisualization> CoinVisualizationPtr; -} - -#endif diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.ui b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.ui deleted file mode 100644 index 4e41df70c..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotIKGuiPlugin.ui +++ /dev/null @@ -1,318 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>RobotIKGuiPlugin</class> - <widget class="QWidget" name="RobotIKGuiPlugin"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>1143</width> - <height>663</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>100</height> - </size> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="armarx::RobotViewerWidget" name="robotViewer" native="true"/> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetMinimumSize</enum> - </property> - <item> - <widget class="QLabel" name="choseKinematic"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Choose kinematic chain to use:</string> - </property> - <property name="scaledContents"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="comboBox"/> - </item> - <item> - <widget class="QLabel" name="caertesianselectionlabel"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Select what to take into account when solving IK:</string> - </property> - <property name="scaledContents"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="cartesianselection"> - <property name="enabled"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="reachableLabel"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>15</pointsize> - </font> - </property> - <property name="text"> - <string>No kinematic chain selected</string> - </property> - <property name="textFormat"> - <enum>Qt::AutoText</enum> - </property> - <property name="scaledContents"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="errorValue"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>15</pointsize> - </font> - </property> - <property name="text"> - <string>Calculated error: 0</string> - </property> - <property name="textFormat"> - <enum>Qt::AutoText</enum> - </property> - <property name="scaledContents"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="moveTCP"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Move TCP to pose of manipulator in the 3D Viewer:</string> - </property> - <property name="scaledContents"> - <bool>false</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="pushButton"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Move TCP</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="resetManip"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="text"> - <string>Reset manipulator to current TCP pose</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="currentPose"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>13</pointsize> - </font> - </property> - <property name="text"> - <string>Current pose of TCP:</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="currentPoseMatrix"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>No kinematic chain selected</string> - </property> - </widget> - </item> - <item> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QLabel" name="desiredPose"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>13</pointsize> - </font> - </property> - <property name="text"> - <string>Desired pose of TCP:</string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="desiredPoseMatrix"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Maximum" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>No kinematic chain selected</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> - <customwidgets> - <customwidget> - <class>armarx::RobotViewerWidget</class> - <extends>QWidget</extends> - <header>RobotAPI/gui-plugins/RobotIKPlugin/RobotViewerWidget.h</header> - <container>1</container> - </customwidget> - </customwidgets> - <resources/> - <connections/> - <slots> - <slot>focusCameraChanged()</slot> - </slots> -</ui> diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewer.cpp b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewer.cpp deleted file mode 100644 index 51827017e..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewer.cpp +++ /dev/null @@ -1,329 +0,0 @@ -#include "RobotViewer.h" - -#include <Inventor/nodes/SoSeparator.h> -#include <Inventor/nodes/SoPickStyle.h> -#include <Inventor/nodes/SoMaterial.h> -#include <Inventor/nodes/SoDrawStyle.h> -#include <Inventor/nodes/SoVertexProperty.h> -#include <Inventor/nodes/SoLineSet.h> - -#include <Inventor/events/SoMouseButtonEvent.h> -#include <Inventor/events/SoLocation2Event.h> - -armarx::RobotViewer::RobotViewer(QWidget* widget) : SoQtExaminerViewer(widget), sceneRootNode(new SoSeparator), contentRootNode(new SoSeparator), camera(new SoPerspectiveCamera) -{ - this->setBackgroundColor(SbColor(150 / 255.0f, 150 / 255.0f, 150 / 255.0f)); - this->setAccumulationBuffer(true); - this->setHeadlight(true); - this->setViewing(false); - this->setDecoration(false); -#ifdef WIN32 -#ifndef _DEBUG - this->setAntialiasing(true, 4); -#endif -#endif - this->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND); - this->setFeedbackVisibility(true); - - //Create scene root node - sceneRootNode->ref(); - this->setSceneGraph(sceneRootNode); - - //Add camera to scene - sceneRootNode->addChild(camera); - this->setCamera(camera); - - //Give camera standard position - camera->position.setValue(SbVec3f(10, -10, 5)); - camera->pointAt(SbVec3f(0, 0, 0), SbVec3f(0, 0, 1)); - - //Add gridfloor root and make it unpickable - SoSeparator* gridFloorRoot = new SoSeparator(); - SoPickStyle* unpickable = new SoPickStyle(); - unpickable->style = SoPickStyle::UNPICKABLE; - SoPickStyle* pickable = new SoPickStyle(); - pickable->style = SoPickStyle::SHAPE; - - sceneRootNode->addChild(unpickable); - sceneRootNode->addChild(gridFloorRoot); - sceneRootNode->addChild(pickable); - - /*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - Here we draw our grid floor. To change the way the grid floor is drawn change the following constants. - GRIDSIZE: How many lines to display for each direction of each axis. - E. g.: 2 would lead to 2 lines in negative and positive direction respectively, plus indicator for axis. - 5 lines in sum. - GRIDUNIT: Factor for coin units, e.g. 2 means between 2 lines there is space for 2 coin units. - GRIDSUBSIZE: How many subunits to display between the larger lines. So 5 would lead to 3 lines between 2 large lines for 5 - subunits. - GRIDPATTERN: Pattern for sublines. Bitpattern, where 1 is line and 0 is no line. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ - const int GRIDSIZE = 3; - const int GRIDUNIT = 15; - const int GRIDSUBSIZE = 10; - const short GRIDPATTERN = 0xCCCC; - - //Red material for X axis - SoMaterial* red = new SoMaterial; - red->diffuseColor = SbColor(1, 0, 0); - //Green material for Y axis - SoMaterial* green = new SoMaterial; - green->diffuseColor = SbColor(0, 1, 0); - //Blue material for Z axis - SoMaterial* blue = new SoMaterial; - blue->diffuseColor = SbColor(0, 0, 1); - - //Small lines - SoDrawStyle* thinStyle = new SoDrawStyle; - thinStyle->lineWidth = 1; - thinStyle->linePattern = GRIDPATTERN; - //Larger lines - SoDrawStyle* largeStyle = new SoDrawStyle; - largeStyle->lineWidth = 2; - - //Our set of vertices for the grid lines - SoVertexProperty* vertices = new SoVertexProperty; - SoVertexProperty* subVertices = new SoVertexProperty; - SoVertexProperty* xVertices = new SoVertexProperty; - SoVertexProperty* yVertices = new SoVertexProperty; - SoVertexProperty* zVertices = new SoVertexProperty; - - //Definition of which vertex belongs to which line and should be connected - SoLineSet* lines = new SoLineSet; - SoLineSet* subLines = new SoLineSet; - SoLineSet* xLines = new SoLineSet; - SoLineSet* yLines = new SoLineSet; - SoLineSet* zLines = new SoLineSet; - - //Add 2 vertices for X axis - xVertices->vertex.set1Value(0, GRIDSIZE * GRIDUNIT, 0, 0); - xVertices->vertex.set1Value(1, -(GRIDSIZE * GRIDUNIT), 0, 0); - //Connect them to a line by adding '2' to numVertices at the correct position - xLines->numVertices.set1Value(0, 2); - - //Y axis - yVertices->vertex.set1Value(0, 0, GRIDSIZE * GRIDUNIT, 0); - yVertices->vertex.set1Value(1, 0, -(GRIDSIZE * GRIDUNIT), 0); - yLines->numVertices.set1Value(0, 2); - - //Z axis - zVertices->vertex.set1Value(0, 0, 0, GRIDSIZE * GRIDUNIT); - zVertices->vertex.set1Value(1, 0, 0, -(GRIDSIZE * GRIDUNIT)); - zLines->numVertices.set1Value(0, 2); - - //Counters to keep track of vertex index - int verticescounter = 0; - int subverticescounter = 0; - - //Draw all lines parallel to the X and Y axis and all sublines, excepted axis itself - for (int i = -(GRIDSIZE * GRIDUNIT); i < GRIDUNIT * (GRIDSIZE + 1); i += GRIDUNIT) - { - if (i != 0) - { - vertices->vertex.set1Value(verticescounter++, GRIDSIZE * GRIDUNIT, i, 0); - vertices->vertex.set1Value(verticescounter++, -(GRIDSIZE * GRIDUNIT), i, 0); - lines->numVertices.set1Value((verticescounter - 1) / 2, 2); - - vertices->vertex.set1Value(verticescounter++, i, GRIDSIZE * GRIDUNIT, 0); - vertices->vertex.set1Value(verticescounter++, i, -(GRIDSIZE * GRIDUNIT), 0); - lines->numVertices.set1Value((verticescounter - 1) / 2, 2); - } - - //If this is not the last line to draw, draw sublines - if (i < GRIDUNIT * GRIDSIZE) - { - float delta = (float)GRIDUNIT / (float)GRIDSUBSIZE; - - for (int n = 1; n < GRIDSUBSIZE; n++) - { - subVertices->vertex.set1Value(subverticescounter++, GRIDSIZE * GRIDUNIT, (float)i + (float)n * delta, 0); - subVertices->vertex.set1Value(subverticescounter++, -(GRIDSIZE * GRIDUNIT), (float)i + (float)n * delta, 0); - subLines->numVertices.set1Value((subverticescounter - 1) / 2, 2); - - subVertices->vertex.set1Value(subverticescounter++, (float)i + (float)n * delta, GRIDSIZE * GRIDUNIT, 0); - subVertices->vertex.set1Value(subverticescounter++, (float)i + (float)n * delta, -(GRIDSIZE * GRIDUNIT), 0); - subLines->numVertices.set1Value((subverticescounter - 1) / 2, 2); - } - } - } - - - lines->vertexProperty.setValue(vertices); - subLines->vertexProperty.setValue(subVertices); - xLines->vertexProperty.setValue(xVertices); - yLines->vertexProperty.setValue(yVertices); - zLines->vertexProperty.setValue(zVertices); - - gridFloorRoot->addChild(thinStyle); - gridFloorRoot->addChild(subLines); - gridFloorRoot->addChild(largeStyle); - gridFloorRoot->addChild(lines); - gridFloorRoot->addChild(red); - gridFloorRoot->addChild(xLines); - gridFloorRoot->addChild(green); - gridFloorRoot->addChild(yLines); - gridFloorRoot->addChild(blue); - gridFloorRoot->addChild(zLines); - - /////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //Gridfloor done - - //Create content root node - sceneRootNode->addChild(contentRootNode); -} - -armarx::RobotViewer::~RobotViewer() -{ - sceneRootNode->unref(); -} - -SoSeparator* armarx::RobotViewer::getRootNode() -{ - return this->contentRootNode; -} - -void armarx::RobotViewer::cameraViewAll() -{ - camera->viewAll(this->contentRootNode, SbViewportRegion()); -} - -//Override the default navigation behaviour of the SoQtExaminerViewer -SbBool armarx::RobotViewer::processSoEvent(const SoEvent* const event) -{ - const SoType type(event->getTypeId()); - - //Remapping mouse press events - if (type.isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) - { - SoMouseButtonEvent* const ev = (SoMouseButtonEvent*) event; - const int button = ev->getButton(); - const SbBool press = ev->getState() == SoButtonEvent::DOWN ? TRUE : FALSE; - - //LEFT MOUSE BUTTON - if (button == SoMouseButtonEvent::BUTTON1) - { - SoQtExaminerViewer::processSoEvent(ev); - } - - //MIDDLE MOUSE BUTTON - if (button == SoMouseButtonEvent::BUTTON3) - { - /*Middle mouse button now is used for all changes in camera perspective. - To also display the cool little rotation cursor, viewing mode is set to on - while button is down*/ - - //Enable or disable viewing mode while BUTTON3 pressed - if (press) - { - if (!this->isViewing()) - { - this->setViewing(true); - } - } - else - { - if (this->isViewing()) - { - this->setViewing(false); - } - } - - //Remap BUTTON3 to BUTTON1 - ev->setButton(SoMouseButtonEvent::BUTTON1); - - //Make sure this REALLY only can happen when viewing mode is on. - //Zooming can also turn it on and it leads to weird effects when doing both - //(deselections in scene etc.) because SoQtExaminerViewer passes BUTTON1 - //events up to scenegraph when not in viewing mode. - if (this->isViewing()) - { - return SoQtExaminerViewer::processSoEvent(ev); - } - } - - //MOUSE WHEEL UP AND DOWN - if (button == SoMouseButtonEvent::BUTTON4 || button == SoMouseButtonEvent::BUTTON5) - { - /*Zooming is allowed, so just use it. We have to temporarily turn viewing mode - on to make SoQtExaminerViewer allow zooming.*/ - - //Swap BUTTON4 and BUTTON5 because zooming out while scrolling up is just retarded - ev->setButton(button == SoMouseButtonEvent::BUTTON4 ? - SoMouseButtonEvent::BUTTON5 : SoMouseButtonEvent::BUTTON4); - - //Zooming is allowed, so just pass it and temporarily set viewing mode on, if it is not already - //(otherwise coin gives us warning messages...) - if (!this->isViewing()) - { - if (!this->isViewing()) - { - this->setViewing(true); - } - - SoQtExaminerViewer::processSoEvent(ev); - - if (this->isViewing()) - { - this->setViewing(false); - } - } - else - { - SoQtExaminerViewer::processSoEvent(ev); - } - - return TRUE; - } - } - - // Keyboard handling - if (type.isDerivedFrom(SoKeyboardEvent::getClassTypeId())) - { - const SoKeyboardEvent* const ev = (const SoKeyboardEvent*) event; - - /*The escape key and super key (windows key) is used to switch between - viewing modes. We need to disable this behaviour completely.*/ - - //65513 seems to be the super key, which is not available in the enum of keys in coin.... - if (ev->getKey() == SoKeyboardEvent::ESCAPE || ev->getKey() == 65513) - { - return TRUE; - } - else if (ev->getKey() == SoKeyboardEvent::S && ev->getState() == SoButtonEvent::DOWN) - { - if (!this->isSeekMode()) - { - if (!this->isViewing()) - { - this->setViewing(true); - } - - SoQtExaminerViewer::processSoEvent(ev); - this->setSeekTime(0.5); - this->seekToPoint(ev->getPosition()); - - if (this->isViewing()) - { - this->setViewing(false); - } - } - } - else - { - SoQtExaminerViewer::processSoEvent(ev); - } - - SoQtExaminerViewer::processSoEvent(ev); - } - - //Let all move events trough - if (type.isDerivedFrom(SoLocation2Event::getClassTypeId())) - { - return SoQtExaminerViewer::processSoEvent(event); - } - - //YOU SHALL NOT PASS! - return TRUE; - - return SoQtExaminerViewer::processSoEvent(event); -} diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewer.h b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewer.h deleted file mode 100644 index d5997ec42..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewer.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __RobotViewer_h__ -#define __RobotViewer_h__ - -/* Coin headers */ -#include <Inventor/nodes/SoPerspectiveCamera.h> -#include <Inventor/Qt/viewers/SoQtExaminerViewer.h> - -namespace armarx -{ - class RobotViewer : public SoQtExaminerViewer - { - public: - RobotViewer(QWidget* widget); - ~RobotViewer(); - SoSeparator* getRootNode(); - void cameraViewAll(); - private: - virtual SbBool processSoEvent(const SoEvent* const event); - SoSeparator* sceneRootNode; - SoSeparator* contentRootNode; - SoPerspectiveCamera* camera; - }; -} - -#endif diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewerWidget.cpp b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewerWidget.cpp deleted file mode 100644 index dd925f98f..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewerWidget.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "RobotViewerWidget.h" - -#include <QGridLayout> - -armarx::RobotViewerWidget::RobotViewerWidget(QWidget* parent) : QWidget(parent) -{ - this->setContentsMargins(1, 1, 1, 1); - - QGridLayout* grid = new QGridLayout(); - grid->setContentsMargins(0, 0, 0, 0); - this->setLayout(grid); - this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - - QWidget* view1 = new QWidget(this); - view1->setMinimumSize(100, 100); - view1->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - - viewer.reset(new RobotViewer(view1)); - viewer->show(); - - grid->addWidget(view1, 0, 0, 1, 2); -} - - -armarx::RobotViewerWidget::~RobotViewerWidget() -{ - -} - -RobotViewerPtr armarx::RobotViewerWidget::getRobotViewer() -{ - return viewer; -} diff --git a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewerWidget.h b/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewerWidget.h deleted file mode 100644 index ccb8d9979..000000000 --- a/source/RobotAPI/gui-plugins/moved_to_robotcomponents_RobotIKPlugin/RobotViewerWidget.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef RobotViewerWidget_h -#define RobotViewerWidget_h - -/* Qt headers */ -#include <QWidget> - -/* boost headers */ -#include <boost/smart_ptr/shared_ptr.hpp> - -#include "RobotViewer.h" - -typedef boost::shared_ptr<armarx::RobotViewer> RobotViewerPtr; - -namespace armarx -{ - class RobotViewerWidget : public QWidget - { - Q_OBJECT - - public: - /** - * Constructor. - * Constructs a robot viewer widget. - * Expects a controller::ControllerPtr. - * - * @param control shared pointer to controller::controller - * @param parent parent widget - * - */ - explicit RobotViewerWidget(QWidget* parent = 0); - - /** - * Destructor. - * - */ - ~RobotViewerWidget(); - - RobotViewerPtr getRobotViewer(); - - private: - RobotViewerPtr viewer; - }; -} - -#endif -- GitLab