31 #include <unordered_map>
38 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h>
52 #include "../QtWidgets/IndexedQCheckBox.h"
53 #include "../QtWidgets/MotionPlanningServerTaskList.h"
54 #include <Inventor/nodes/SoSeparator.h>
56 #pragma GCC diagnostic push
57 #pragma GCC diagnostic ignored "-Wpedantic"
58 #include <RobotComponents/gui-plugins/MotionPlanning/ui_SimoxCSpaceVisualizerWidget.h>
59 #pragma GCC diagnostic pop
113 float dcdStep = std::numeric_limits<float>::infinity();
123 return accPathLength.back();
151 void loadSettings(QSettings* settings)
override;
156 void saveSettings(QSettings* settings)
override;
162 QString getWidgetName()
const override;
167 void onInitComponent()
override;
173 QPointer<QDialog> getConfigDialog(QWidget* parent)
override;
181 motionPlanningServerProxyName = dialog->getProxyName(
"MotionPlanningServer");
187 void onConnectComponent()
override;
192 motionPlanningServerTaskList->enableAutoUpdate(
false);
203 soSeparatorCleanUpAndRemoveFromRoot(visuAgent);
204 soSeparatorCleanUp(visuRoot);
210 SoNode* getScene()
override;
216 void setMutex3D(RecursiveMutexPtr
const& mutex3D)
override;
229 return paths.at(widget.spinBoxPathNumber->value() - 1);
239 void setCurrentPath();
243 void setCurrentPathPosition();
247 void setCurrentConfig();
248 void updateCollisionState();
251 void drawEdges(
bool drawTrace);
256 drawEdges(widget.checkBoxDrawTrace->isChecked());
267 soSeparatorRootChildVis(visuObjStat.at(
index), state == Qt::Checked);
277 soSeparatorRootChildVis(visuAgent, state == Qt::Checked);
285 void setVisibilityPath(
int index, Qt::CheckState state);
293 void traceStepChanged();
294 void toggleRobotNodePath(
int index, Qt::CheckState);
295 void updateEdgeVisibility();
296 void highlightCollisionNodes(
bool checked);
300 void loadTaskFromServer();
302 void loadTaskFromSend();
308 void soSeparatorCleanUpAndRemoveFromRoot(SoSeparator*& toRemove);
313 void soSeparatorCleanUp(SoSeparator*& toClear);
318 void soSeparatorRemoveFromRoot(SoSeparator* toRemove);
323 void soSeparatorAddToRoot(SoSeparator* toAdd);
328 void soSeparatorToggleRootChild(SoSeparator* toToggle);
330 void soSeparatorRootChildVis(SoSeparator* child,
bool visible =
true);
339 void setPaths(std::vector<Path> newPaths);
345 void setAndApplyConfig(
const VectorXf& cfg);
351 void resetSimoxCSpace();
358 widget.sliderPathPosition->setScale(0, 0);
366 void setEnabledSimoxCSpace(
bool active =
true);
368 void setEnabledPaths(
bool active =
true);
370 void timerEvent(QTimerEvent*)
override;
371 void setCurrentPathPosition(
double p);
378 Ui::SimoxCSpaceVisualizerWidget widget;
382 QPointer<SimpleConfigDialog> dialog;
384 QPointer<MotionPlanningServerTaskList> motionPlanningServerTaskList;
387 std::string motionPlanningServerProxyName;
388 MotionPlanningServerInterfacePrx motionPlanningServerProxy;
398 SoSeparator* visuRoot;
411 std::vector<SoSeparator*> visuObjStat;
412 SoSeparator* visuAgent =
nullptr;
415 std::vector<PathData> paths;
419 std::vector<std::pair<VirtualRobot::RobotNodePtr, bool>> robotNodes;
420 QTimer updateCollisionStateTimer;
421 const long timerPeriod{30};