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