RobotViewerGuiPlugin.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #include "RobotViewerGuiPlugin.h"
25 
26 
27 
33 
35 
36 #include <VirtualRobot/XML/RobotIO.h>
37 #include <VirtualRobot/CollisionDetection/CollisionModel.h>
38 
39 // Qt headers
40 #include <Qt>
41 #include <QtGlobal>
42 #include <QPushButton>
43 #include <QCheckBox>
44 #include <QClipboard>
45 #include <QScrollBar>
46 
47 #include <Inventor/SoDB.h>
48 #include <Inventor/Qt/SoQt.h>
51 
52 // System
53 #include <stdio.h>
54 #include <string>
55 #include <string.h>
56 #include <stdlib.h>
57 #include <iostream>
58 #include <cmath>
59 
60 #include <filesystem>
61 
62 #define TIMER_MS 33
63 #define ROBOTSTATE_NAME_DEFAULT "RobotStateComponent"
64 
65 using namespace armarx;
66 using namespace VirtualRobot;
67 
69 {
74 
76 };
77 
79 {
80  "Joint Configuration",
81  "Framed Position (TCP)",
82  "Framed Orientation (TCP)",
83  "Framed Pose (TCP)",
84 };
85 
87 {
88  addWidget<RobotViewerWidgetController>();
89 }
90 
91 
93  : rootVisu(nullptr)
94  , robotVisu(nullptr)
95  , timerSensor(nullptr)
96  , debugLayerVisu(nullptr)
97 {
98  ui.setupUi(getWidget());
99  getWidget()->setEnabled(false);
100 
101  QComboBox* outputTypes = ui.outputTypeComboBox;
102  for (int typeIndex = 0; typeIndex < eRobotStateOutputTypeSize; ++typeIndex)
103  {
104  auto& typeName = ROBOT_STATE_OUTPUT_TYPE_NAMES[typeIndex];
105  outputTypes->addItem(typeName);
106  }
107  outputTypes->setCurrentIndex(0);
108 }
109 
110 
112 {
113  bool createDebugDrawer = true;
114  verbose = true;
115 
117 
118  rootVisu = new SoSeparator();
119  rootVisu->ref();
120 
121  robotVisu = new SoSeparator;
122  robotVisu->ref();
123  rootVisu->addChild(robotVisu);
124 
125  // create the debugdrawer component
126  if (createDebugDrawer)
127  {
128  std::string debugDrawerComponentName = "RobotViewerGUIDebugDrawer_" + getName();
129  ARMARX_INFO << "Creating component " << debugDrawerComponentName;
130  debugDrawer = Component::create<DebugDrawerComponent>(getIceProperties(), debugDrawerComponentName);
131 
132  if (mutex3D)
133  {
134  debugDrawer->setMutex(mutex3D);
135  }
136  else
137  {
138  ARMARX_ERROR << " No 3d mutex available...";
139  }
140 
142  m->addObject(debugDrawer);
143 
144 
145  {
146  std::unique_lock lock(*mutex3D);
147  debugLayerVisu = new SoSeparator();
148  debugLayerVisu->ref();
149  debugLayerVisu->addChild(debugDrawer->getVisualization());
150  rootVisu->addChild(debugLayerVisu);
151  }
152  }
153 
154  showRoot(true);
155 }
156 
158 {
159  robotStateComponentPrx = getProxy<RobotStateComponentInterfacePrx>(robotStateComponentName);
160  usingTopic(robotStateComponentPrx->getRobotStateTopicName());
161  if (robotVisu)
162  {
163  robotVisu->removeAllChildren();
164  }
165 
166  robot.reset();
167 
168  std::string rfile;
169  Ice::StringSeq includePaths;
170 
171  // get robot filename
172  try
173  {
174 
175  Ice::StringSeq packages = robotStateComponentPrx->getArmarXPackages();
176  packages.push_back(Application::GetProjectName());
177  ARMARX_VERBOSE << "ArmarX packages " << packages;
178 
179  for (const std::string& projectName : packages)
180  {
181  if (projectName.empty())
182  {
183  continue;
184  }
185 
186  CMakePackageFinder project(projectName);
187  auto pathsString = project.getDataDir();
188  ARMARX_VERBOSE << "Data paths of ArmarX package " << projectName << ": " << pathsString;
189  Ice::StringSeq projectIncludePaths = Split(pathsString, ";,", true, true);
190  ARMARX_VERBOSE << "Result: Data paths of ArmarX package " << projectName << ": " << projectIncludePaths;
191  includePaths.insert(includePaths.end(), projectIncludePaths.begin(), projectIncludePaths.end());
192 
193  }
194 
195  rfile = robotStateComponentPrx->getRobotFilename();
196  ARMARX_VERBOSE << "Relative robot file " << rfile;
197  ArmarXDataPath::getAbsolutePath(rfile, rfile, includePaths);
198  ARMARX_VERBOSE << "Absolute robot file " << rfile;
199  }
200  catch (...)
201  {
202  ARMARX_ERROR << "Unable to retrieve robot filename";
203  }
204 
205  try
206  {
207  ARMARX_INFO << "Loading robot from file " << rfile;
208  robot = loadRobotFile(rfile);
209  }
210  catch (...)
211  {
212  ARMARX_ERROR << "Failed to init robot";
213  }
214 
215  if (!robot)
216  {
217  getObjectScheduler()->terminate();
218 
219  if (getWidget()->parentWidget())
220  {
221  getWidget()->parentWidget()->close();
222  }
223 
224  std::cout << "returning" << std::endl;
225  return;
226  }
227 
228  setRobotVisu(ui.radioButtonCol->isChecked());
229  showRobot(ui.cbRobot->isChecked());
230 
231  // start update timer
232  SoSensorManager* sensor_mgr = SoDB::getSensorManager();
233  timerSensor = new SoTimerSensor(timerCB, this);
234  timerSensor->setInterval(SbTime(TIMER_MS / 1000.0f));
235  sensor_mgr->insertTimerSensor(timerSensor);
236 
237  // Initialize the copy state GUI
238  {
239  auto sharedRobot = robotStateComponentPrx->getSynchronizedRobot();
240 
241  ui.kinematicChainComboBox->addItem("<All Nodes>");
242  robotNodeSetNames = sharedRobot->getRobotNodeSets();
243  for (std::string const& nodeSetName : robotNodeSetNames)
244  {
245  ui.kinematicChainComboBox->addItem(QString::fromStdString(nodeSetName));
246  }
247  ui.kinematicChainComboBox->setCurrentIndex(0);
248  ui.tcpComboBox->addItem("<default>");
249  for (auto& node : sharedRobot->getRobotNodes())
250  {
251  ui.tcpComboBox->addItem(QString::fromStdString(node));
252  }
253  ui.tcpComboBox->setCurrentIndex(0);
254 
255  ui.frameComboBox->addItem("<Global>");
256  robotNodeNames = sharedRobot->getRobotNodes();
257  for (std::string const& nodeName : robotNodeNames)
258  {
259  ui.frameComboBox->addItem(QString::fromStdString(nodeName));
260  }
261  ui.frameComboBox->setCurrentIndex(0);
262  }
263 
264  connectSlots();
265  enableMainWidgetAsync(true);
266 }
267 
269 {
270 
271  ARMARX_INFO << "Disconnecting component";
272 
273  // stop update timer
274  if (timerSensor)
275  {
276  SoSensorManager* sensor_mgr = SoDB::getSensorManager();
277  sensor_mgr->removeTimerSensor(timerSensor);
278  }
279 
280  ARMARX_INFO << "Disconnecting component: timer stopped";
281 
282  robotStateComponentPrx = nullptr;
283 
284  {
285  std::unique_lock lock(*mutex3D);
286 
287  if (robotVisu)
288  {
289  ARMARX_INFO << "Disconnecting component: removing visu";
290  robotVisu->removeAllChildren();
291  }
292 
293  robot.reset();
294  }
295  ARMARX_INFO << "Disconnecting component: finished";
296 }
297 
298 
300 {
301  enableMainWidgetAsync(false);
302 
303  {
304  std::unique_lock lock(*mutex3D);
305 
306  if (debugLayerVisu)
307  {
308  debugLayerVisu->removeAllChildren();
309  debugLayerVisu->unref();
310  debugLayerVisu = NULL;
311  }
312 
313  if (robotVisu)
314  {
315  robotVisu->removeAllChildren();
316  robotVisu->unref();
317  robotVisu = NULL;
318  }
319 
320  if (rootVisu)
321  {
322  rootVisu->removeAllChildren();
323  rootVisu->unref();
324  rootVisu = NULL;
325  }
326  }
327 
328  /*
329  if (debugDrawer && debugDrawer->getObjectScheduler())
330  {
331  ARMARX_INFO << "Removing DebugDrawer component...";
332  debugDrawer->getObjectScheduler()->terminate();
333  ARMARX_INFO << "Removing DebugDrawer component...done";
334  }
335  */
336 }
337 
338 QPointer<QDialog> RobotViewerWidgetController::getConfigDialog(QWidget* parent)
339 {
340  if (!dialog)
341  {
342  dialog = new SimpleConfigDialog(parent);
343  dialog->addProxyFinder<RobotStateComponentInterfacePrx>({"RobotStateComponent", "", "RobotState*"});
344  }
345  return qobject_cast<SimpleConfigDialog*>(dialog);
346 }
347 
348 
349 
351 {
352  robotStateComponentName = dialog->getProxyName("RobotStateComponent");
353 }
354 
355 
357 {
358  robotStateComponentName = settings->value("RobotStateComponent", QString::fromStdString(ROBOTSTATE_NAME_DEFAULT)).toString().toStdString();
359 
360  bool showRob = settings->value("showRobot", QVariant(true)).toBool();
361  bool fullMod = settings->value("fullModel", QVariant(true)).toBool();
362  ui.cbRobot->setChecked(showRob);
363  ui.radioButtonFull->setChecked(fullMod);
364  ui.radioButtonCol->setChecked(!fullMod);
365 }
366 
368 {
369  settings->setValue("RobotStateComponent", QString::fromStdString(robotStateComponentName));
370  settings->setValue("showRobot", ui.cbRobot->isChecked());
371  settings->setValue("fullModel", ui.radioButtonFull->isChecked());
372 }
373 
375 {
376  robotVisu->removeAllChildren();
377 
378  if (!robot)
379  {
380  return;
381  }
382 
383  std::unique_lock lock(*mutex3D);
384 
385  VirtualRobot::SceneObject::VisualizationType v = VirtualRobot::SceneObject::Full;
386 
387  if (colModel)
388  {
389  v = VirtualRobot::SceneObject::Collision;
390  }
391 
392  CoinVisualizationPtr robotViewerVisualization = robot->getVisualization<CoinVisualization>(v);
393 
394  if (robotViewerVisualization)
395  {
396  robotVisu->addChild(robotViewerVisualization->getCoinVisualization());
397  }
398  else
399  {
400  ARMARX_WARNING << "no robot visu available...";
401  }
402 }
403 
405 {
406  if (debugDrawer)
407  {
408  if (show)
409  {
410  debugDrawer->enableAllLayers();
411  }
412  else
413  {
414  debugDrawer->disableAllLayers();
415  }
416  }
417 }
418 
420 {
421  if (!debugDrawer)
422  {
423  return;
424  }
425 
426  std::string poseName("root");
427 
428  if (show)
429  {
431  PosePtr gpP(new Pose(gp));
432  debugDrawer->setPoseDebugLayerVisu(poseName, gpP);
433  }
434  else
435  {
436  debugDrawer->removePoseDebugLayerVisu(poseName);
437  }
438 }
439 
441 {
442  if (!robotVisu)
443  {
444  return;
445  }
446 
447  std::unique_lock lock(*mutex3D);
448 
449  if (show && rootVisu->findChild(robotVisu) < 0)
450  {
451  rootVisu->addChild(robotVisu);
452  }
453  else if (!show && rootVisu->findChild(robotVisu) >= 0)
454  {
455  rootVisu->removeChild(robotVisu);
456  }
457 }
459 {
460  return rootVisu;
461 }
462 
463 void RobotViewerWidgetController::timerCB(void* data, SoSensor* sensor)
464 {
466 
467  if (!controller)
468  {
469  return;
470  }
471 
472  controller->updateRobotVisu();
473 }
474 
475 
477 {
478  // Robot viewer GUI (top part)
479  connect(this, SIGNAL(robotStatusUpdated()), this, SLOT(updateRobotVisu()));
480  connect(ui.cbDebugLayer, SIGNAL(toggled(bool)), this, SLOT(showVisuLayers(bool)), Qt::QueuedConnection);
481  connect(ui.cbRoot, SIGNAL(toggled(bool)), this, SLOT(showRoot(bool)), Qt::QueuedConnection);
482  connect(ui.cbRobot, SIGNAL(toggled(bool)), this, SLOT(showRobot(bool)), Qt::QueuedConnection);
483  connect(ui.radioButtonCol, SIGNAL(toggled(bool)), this, SLOT(colModel(bool)), Qt::QueuedConnection);
484  connect(ui.radioButtonFull, SIGNAL(toggled(bool)), this, SLOT(colModel(bool)), Qt::QueuedConnection);
485  connect(ui.horizontalSliderCollisionModelInflation, SIGNAL(sliderMoved(int)), this, SLOT(inflateCollisionModel(int)), Qt::QueuedConnection);
486 
487  // Copy state GUI (bottom part)
488  connect(ui.kinematicChainComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateStateSettings(int)));
489  connect(ui.frameComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateStateSettings(int)));
490  connect(ui.outputTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateStateSettings(int)));
491  connect(ui.copyToClipboardButton, SIGNAL(clicked()), this, SLOT(copyToClipboard()));
492 
493  connect(this, SIGNAL(configurationChanged()), this, SLOT(onConfigurationChanged()), Qt::QueuedConnection);
494 }
495 
496 
497 
498 VirtualRobot::RobotPtr RobotViewerWidgetController::loadRobotFile(std::string fileName)
499 {
500  VirtualRobot::RobotPtr robot;
501 
502  if (!ArmarXDataPath::getAbsolutePath(fileName, fileName))
503  {
504  ARMARX_INFO << "Could not find Robot XML file with name " << fileName;
505  }
506 
507  robot = RobotIO::loadRobot(fileName);
508 
509  if (!robot)
510  {
511  ARMARX_INFO << "Could not find Robot XML file with name " << fileName;
512  }
513 
514  return robot;
515 }
516 
517 
519 {
520  bool colModel = false;
521 
522  if (ui.radioButtonCol->isChecked())
523  {
524  colModel = true;
525  }
526  ui.horizontalSliderCollisionModelInflation->setEnabled(ui.radioButtonCol->isChecked());
527 
529 }
530 
532 {
533  updateState();
534 }
535 
537 {
538  QClipboard* clipboard = QApplication::clipboard();
539  if (clipboard)
540  {
541  QString currentText = ui.previewTextBox->document()->toPlainText();
542  clipboard->setText(currentText);
543  }
544  else
545  {
546  ARMARX_ERROR << "Could not copy text to clipboard";
547  }
548 }
549 
550 static std::string writeJointConfigurationToJson(VirtualRobot::Robot& robot,
551  VirtualRobot::RobotNodeSetPtr const& robotNodeSet)
552 {
553  int indenting = 2; // Magic value for correct indenting
554  JsonWriter writer(indenting);
555  writer.startObject();
556 
557  if (robotNodeSet)
558  {
559  for (RobotNodePtr const& node : *robotNodeSet)
560  {
561  writer.writeKey(node->getName());
562  writer.writeRawValue(to_string(node->getJointValue()));
563  }
564  }
565  else // Write all rotational and translational joints
566  {
567  for (RobotNodePtr const& node : robot.getRobotNodes())
568  {
569  if (node->isRotationalJoint() || node->isTranslationalJoint())
570  {
571  writer.writeKey(node->getName());
572  writer.writeRawValue(to_string(node->getJointValue()));
573  }
574  }
575  }
576 
577  writer.endObject();
578  return writer.toString();
579 }
580 
581 template <typename FrameType>
582 static std::string writeFramedTCP(VirtualRobot::RobotPtr const& robot, VirtualRobot::RobotNodeSetPtr const& nodeSet, std::string const& frameName, const std::string& tcpName)
583 {
584  if (nodeSet)
585  {
586  auto tcp = tcpName.empty() ? nodeSet->getTCP() : robot->getRobotNode(tcpName);
587  Eigen::Matrix4f tcpMatrix = tcp->getPoseInRootFrame();
588  IceInternal::Handle<FrameType> position = new FrameType(tcpMatrix, robot->getRootNode()->getName(), robot->getName());
589  position->changeFrame(robot, frameName);
590 
591  JSONObjectPtr object = new JSONObject;
592  object->serializeIceObject(position);
593  return object->asString(true);
594  }
595  else
596  {
597  return "{}";
598  }
599 }
600 
602 {
603  if (!robot)
604  {
605  return;
606  }
607 
608  std::string kinematicChainName = ui.kinematicChainComboBox->currentText().toStdString();
609  VirtualRobot::RobotNodeSetPtr robotNodeSet;
610  if (ui.kinematicChainComboBox->currentIndex() > 0)
611  {
612  robotNodeSet = robot->getRobotNodeSet(kinematicChainName);
613  }
614 
615  std::string frameName = ui.frameComboBox->currentText().toStdString();
616  if (ui.frameComboBox->currentIndex() <= 0)
617  {
618  frameName = "Global";
619  }
620 
621  int selectedOutputType = ui.outputTypeComboBox->currentIndex();
622  if (selectedOutputType < 0 || selectedOutputType > eRobotStateOutputTypeSize)
623  {
624  selectedOutputType = eJointConfiguration;
625  }
626  RobotStateOutputType outputType = static_cast<RobotStateOutputType>(selectedOutputType);
627 
628  // Set the locale so that the floats get converted correctly
629  const char* oldLocale = std::setlocale(LC_ALL, "en_US.UTF-8");
630  std::string tcpName = ui.tcpComboBox->currentIndex() == 0 ? "" : ui.tcpComboBox->currentText().toStdString();
631  std::string output;
632  switch (outputType)
633  {
634  case eJointConfiguration:
635  output = writeJointConfigurationToJson(*robot, robotNodeSet);
636  break;
637 
638  case eFramedPositionTCP:
639  output = writeFramedTCP<FramedPosition>(robot, robotNodeSet, frameName, tcpName);
640  break;
641 
643  output = writeFramedTCP<FramedOrientation>(robot, robotNodeSet, frameName, tcpName);
644  break;
645 
646  case eFramedPoseTCP:
647  output = writeFramedTCP<FramedPose>(robot, robotNodeSet, frameName, tcpName);
648  break;
649 
650  default:
651  ARMARX_ERROR << "Output type not supported: " << outputType;
652  break;
653  }
654 
655  QString jsonOutput = QString::fromStdString(output);
656  QPlainTextEdit* previewTextBox = ui.previewTextBox;
657  QTextDocument* document = previewTextBox->document();
658  if (document->toPlainText() != jsonOutput)
659  {
660  QScrollBar* scrollBar = previewTextBox->verticalScrollBar();
661  int oldScrollValue = scrollBar->value();
662 
663  document->setPlainText(jsonOutput);
664 
665  int newScrollValue = std::min(oldScrollValue, scrollBar->maximum());
666  scrollBar->setValue(newScrollValue);
667  }
668 
669  std::setlocale(LC_ALL, oldLocale);
670 }
671 
673 {
674  if (ui.autoUpdateCheckBox->isChecked())
675  {
676  updateState();
677  }
678 }
679 
681 {
682  std::unique_lock lock(*mutex3D);
683 
684  if (!robotStateComponentPrx || !robot)
685  {
686  return;
687  }
688 
689  // try
690  // {
691  // RemoteRobot::synchronizeLocalClone(robot, robotStateComponentPrx);
692  // }
693  // catch (...)
694  // {
695  // ARMARX_INFO << deactivateSpam(5) << "Robot synchronization failed";
696  // return;
697  // }
698 
699  Eigen::Matrix4f gp = robot->getGlobalPose();
700  QString roboInfo("Robot Pose (global): pos: ");
701  roboInfo += QString::number(gp(0, 3), 'f', 2);
702  roboInfo += QString(", ");
703  roboInfo += QString::number(gp(1, 3), 'f', 2);
704  roboInfo += QString(", ");
705  roboInfo += QString::number(gp(2, 3), 'f', 2);
706  roboInfo += QString(", rot:");
707  Eigen::Vector3f rpy;
708  VirtualRobot::MathTools::eigen4f2rpy(gp, rpy);
709  roboInfo += QString::number(rpy(0), 'f', 2);
710  roboInfo += QString(", ");
711  roboInfo += QString::number(rpy(1), 'f', 2);
712  roboInfo += QString(", ");
713  roboInfo += QString::number(rpy(2), 'f', 2);
714  ui.leRobotInfo->setText(roboInfo);
715 
716  emit configurationChanged();
717 }
718 
720 {
721  std::unique_lock lock(*mutex3D);
722 
723  for (auto& model : robot->getCollisionModels())
724  {
725  model->inflateModel(inflationValueMM);
726  }
727  ui.label_collisionModelInflationValue->setText(QString::number(inflationValueMM) + " mm");
728  setRobotVisu(true);
729 }
730 
732 {
733  //ARMARX_IMPORTANT << "set mutex3d :" << mutex3D.get();
734  this->mutex3D = mutex3D;
735 
736  if (debugDrawer)
737  {
738  debugDrawer->setMutex(mutex3D);
739  }
740 }
741 
742 void armarx::RobotViewerWidgetController::reportGlobalRobotRootPose(const FramedPoseBasePtr& pose, Ice::Long timestamp, bool poseChanged, const Ice::Current&)
743 {
744  std::unique_lock lock(*mutex3D);
745  if (!robotStateComponentPrx || !robot)
746  {
747  return;
748  }
749  Eigen::Matrix4f newPose = PosePtr::dynamicCast(pose)->toEigen();
750 
751  if (!robot->getGlobalPose().isApprox(newPose))
752  {
753  robot->setGlobalPose(newPose);
754  }
755 }
756 
757 void armarx::RobotViewerWidgetController::reportJointValues(const NameValueMap& jointAngles, Ice::Long, bool aValueChanged, const Ice::Current&)
758 {
759  std::unique_lock lock(*mutex3D);
760 
761  if (!robotStateComponentPrx || !robot || !aValueChanged)
762  {
763  return;
764  }
765  robot->setJointValues(jointAngles);
766 }
armarx::ArmarXWidgetController::mutex3D
std::shared_ptr< std::recursive_mutex > mutex3D
Definition: ArmarXWidgetController.h:301
armarx::RobotViewerWidgetController
Definition: RobotViewerGuiPlugin.h:86
armarx::RobotViewerWidgetController::robotStateComponentName
std::string robotStateComponentName
Definition: RobotViewerGuiPlugin.h:141
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::RobotViewerWidgetController::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: RobotViewerGuiPlugin.cpp:299
ROBOTSTATE_NAME_DEFAULT
#define ROBOTSTATE_NAME_DEFAULT
Definition: RobotViewerGuiPlugin.cpp:63
armarx::RobotViewerWidgetController::RobotViewerWidgetController
RobotViewerWidgetController()
Definition: RobotViewerGuiPlugin.cpp:92
armarx::Application::GetProjectName
static const std::string & GetProjectName()
Definition: Application.cpp:840
armarx::RobotViewerWidgetController::reportGlobalRobotRootPose
void reportGlobalRobotRootPose(const FramedPoseBasePtr &pose, Ice::Long timestamp, bool poseChanged, const Ice::Current &) override
Definition: RobotViewerGuiPlugin.cpp:742
armarx::RobotViewerWidgetController::showVisuLayers
void showVisuLayers(bool show)
Definition: RobotViewerGuiPlugin.cpp:404
armarx::RobotViewerWidgetController::updateState
void updateState()
Definition: RobotViewerGuiPlugin.cpp:601
boost::shared_ptr< VirtualRobot::CoinVisualization >
JSONObject.h
eFramedOrientationTCP
@ eFramedOrientationTCP
Definition: RobotViewerGuiPlugin.cpp:72
ArmarXManager.h
VirtualRobot
Definition: FramedPose.h:43
string.h
armarx::JSONObject
The JSONObject class is used to represent and (de)serialize JSON objects.
Definition: JSONObject.h:43
armarx::RobotViewerWidgetController::inflateCollisionModel
void inflateCollisionModel(int inflationValueMM)
Definition: RobotViewerGuiPlugin.cpp:719
armarx::Split
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelperTemplates.h:35
armarx::ManagedIceObject::getArmarXManager
ArmarXManagerPtr getArmarXManager() const
Returns the ArmarX manager used to add and remove components.
Definition: ManagedIceObject.cpp:348
armarx::CMakePackageFinder
The CMakePackageFinder class provides an interface to the CMake Package finder capabilities.
Definition: CMakePackageFinder.h:53
armarx::RobotViewerWidgetController::robotStateComponentPrx
RobotStateComponentInterfacePrx robotStateComponentPrx
Definition: RobotViewerGuiPlugin.h:135
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
eJointConfiguration
@ eJointConfiguration
Definition: RobotViewerGuiPlugin.cpp:70
armarx::RobotViewerWidgetController::verbose
bool verbose
Definition: RobotViewerGuiPlugin.h:132
armarx::RobotViewerWidgetController::robotNodeNames
NameList robotNodeNames
Definition: RobotViewerGuiPlugin.h:139
eRobotStateOutputTypeSize
@ eRobotStateOutputTypeSize
Definition: RobotViewerGuiPlugin.cpp:75
RobotViewerGuiPlugin.h
project
std::string project
Definition: VisualizationRobot.cpp:83
armarx::RobotViewerWidgetController::debugLayerVisu
SoSeparator * debugLayerVisu
Definition: RobotViewerGuiPlugin.h:148
armarx::RobotViewerWidgetController::saveSettings
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
Definition: RobotViewerGuiPlugin.cpp:367
armarx::RobotViewerWidgetController::robotVisu
SoSeparator * robotVisu
Definition: RobotViewerGuiPlugin.h:144
eFramedPoseTCP
@ eFramedPoseTCP
Definition: RobotViewerGuiPlugin.cpp:73
armarx::RobotViewerWidgetController::debugDrawer
armarx::DebugDrawerComponentPtr debugDrawer
Definition: RobotViewerGuiPlugin.h:149
IceInternal::Handle< Pose >
eFramedPositionTCP
@ eFramedPositionTCP
Definition: RobotViewerGuiPlugin.cpp:71
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::ArmarXWidgetController::RecursiveMutexPtr
std::shared_ptr< RecursiveMutex > RecursiveMutexPtr
Definition: ArmarXWidgetController.h:256
controller
Definition: AddOperation.h:39
armarx::RobotViewerWidgetController::rootVisu
SoSeparator * rootVisu
Definition: RobotViewerGuiPlugin.h:143
armarx::RobotViewerWidgetController::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: RobotViewerGuiPlugin.cpp:111
armarx::RobotViewerWidgetController::showRobot
void showRobot(bool show)
Definition: RobotViewerGuiPlugin.cpp:440
FramedPose.h
armarx::RobotViewerWidgetController::configurationChanged
void configurationChanged()
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
armarx::RobotViewerWidgetController::timerCB
static void timerCB(void *data, SoSensor *sensor)
Definition: RobotViewerGuiPlugin.cpp:463
timestamp
std::string timestamp()
Definition: CartographerAdapter.cpp:85
ArmarXObjectScheduler.h
armarx::AbstractObjectSerializer::serializeIceObject
void serializeIceObject(const SerializablePtr &obj)
Definition: AbstractObjectSerializer.cpp:290
TIMER_MS
#define TIMER_MS
Definition: RobotViewerGuiPlugin.cpp:62
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::RobotViewerWidgetController::timerSensor
SoTimerSensor * timerSensor
Definition: RobotViewerGuiPlugin.h:146
armarx::RobotViewerWidgetController::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: RobotViewerGuiPlugin.cpp:268
armarx::RobotViewerWidgetController::updateRobotVisu
void updateRobotVisu()
Definition: RobotViewerGuiPlugin.cpp:680
armarx::to_string
const std::string & to_string(const std::string &s)
Definition: StringHelpers.h:40
RobotStateOutputType
RobotStateOutputType
Definition: RobotViewerGuiPlugin.cpp:68
armarx::RobotViewerWidgetController::configured
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
Definition: RobotViewerGuiPlugin.cpp:350
armarx::RobotViewerWidgetController::onConfigurationChanged
void onConfigurationChanged()
Definition: RobotViewerGuiPlugin.cpp:672
armarx::RobotViewerWidgetController::updateStateSettings
void updateStateSettings(int)
Definition: RobotViewerGuiPlugin.cpp:531
armarx::RobotViewerWidgetController::robotNodeSetNames
NameList robotNodeSetNames
Definition: RobotViewerGuiPlugin.h:138
armarx::channels::KinematicUnitObserver::jointAngles
const KinematicUnitDatafieldCreator jointAngles("jointAngles")
armarx::RobotViewerGuiPlugin::RobotViewerGuiPlugin
RobotViewerGuiPlugin()
Definition: RobotViewerGuiPlugin.cpp:86
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:248
CMakePackageFinder.h
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:35
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::JsonWriter
Definition: JsonWriter.h:32
armarx::RobotViewerWidgetController::robotStatusUpdated
void robotStatusUpdated()
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::RobotViewerWidgetController::setRobotVisu
void setRobotVisu(bool colModel)
Definition: RobotViewerGuiPlugin.cpp:374
armarx::ArmarXWidgetController::enableMainWidgetAsync
void enableMainWidgetAsync(bool enable)
This function enables/disables the main widget asynchronously (if called from a non qt thread).
Definition: ArmarXWidgetController.cpp:174
armarx::RobotViewerWidgetController::getConfigDialog
QPointer< QDialog > getConfigDialog(QWidget *parent=0) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
Definition: RobotViewerGuiPlugin.cpp:338
IceUtil::Handle< ArmarXManager >
armarx::RobotViewerWidgetController::robot
VirtualRobot::RobotPtr robot
Definition: RobotViewerGuiPlugin.h:136
armarx::RobotViewerWidgetController::copyToClipboard
void copyToClipboard()
Definition: RobotViewerGuiPlugin.cpp:536
armarx::RobotViewerWidgetController::showRoot
void showRoot(bool show)
Definition: RobotViewerGuiPlugin.cpp:419
armarx::RobotViewerWidgetController::getScene
SoNode * getScene() override
Reimplementing this function and returning a SoNode* will show this SoNode in the 3DViewerWidget,...
Definition: RobotViewerGuiPlugin.cpp:458
armarx::RobotViewerWidgetController::connectSlots
void connectSlots()
Definition: RobotViewerGuiPlugin.cpp:476
armarx::ArmarXWidgetController::getWidget
virtual QPointer< QWidget > getWidget()
getWidget returns a pointer to the a widget of this controller.
Definition: ArmarXWidgetController.cpp:54
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:107
armarx::RobotViewerWidgetController::setMutex3D
void setMutex3D(RecursiveMutexPtr const &mutex3D) override
This mutex is used to protect 3d scene updates. Usually called by the ArmarXGui main window on creati...
Definition: RobotViewerGuiPlugin.cpp:731
armarx::ArmarXDataPath::getAbsolutePath
static bool getAbsolutePath(const std::string &relativeFilename, std::string &storeAbsoluteFilename, const std::vector< std::string > &additionalSearchPaths={}, bool verbose=true)
Definition: ArmarXDataPath.cpp:111
armarx::PropertyUser::getIceProperties
Ice::PropertiesPtr getIceProperties() const
Returns the set of Ice properties.
Definition: PropertyUser.cpp:229
min
T min(T t1, T t2)
Definition: gdiam.h:42
armarx::RobotViewerWidgetController::colModel
void colModel(bool c)
Definition: RobotViewerGuiPlugin.cpp:518
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::RobotViewerWidgetController::ui
Ui::RobotViewerGuiPlugin ui
Definition: RobotViewerGuiPlugin.h:130
armarx::RobotViewerWidgetController::loadSettings
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
Definition: RobotViewerGuiPlugin.cpp:356
ArmarXDataPath.h
armarx::RobotViewerWidgetController::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: RobotViewerGuiPlugin.cpp:157
armarx::RobotViewerWidgetController::reportJointValues
void reportJointValues(const NameValueMap &jointAngles, Ice::Long timestamp, bool aValueChanged, const Ice::Current &) override
Definition: RobotViewerGuiPlugin.cpp:757
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
armarx::VariantType::Pose
const VariantTypeId Pose
Definition: Pose.h:40
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::ManagedIceObject::getObjectScheduler
ArmarXObjectSchedulerPtr getObjectScheduler() const
Definition: ManagedIceObject.cpp:731
JsonWriter.h
Application.h
ROBOT_STATE_OUTPUT_TYPE_NAMES
const QString ROBOT_STATE_OUTPUT_TYPE_NAMES[eRobotStateOutputTypeSize]
Definition: RobotViewerGuiPlugin.cpp:78
armarx::SimpleConfigDialog
A config-dialog containing one (or multiple) proxy finders.
Definition: SimpleConfigDialog.h:84