Go to the documentation of this file.
38 #include <MemoryX/gui-plugins/WorkingMemoryGui/ui_WorkingMemoryGuiPlugin.h>
42 #include <MemoryX/interface/memorytypes/MemorySegments.h>
43 #include <MemoryX/interface/workingmemory/AbstractWorkingMemoryInterface.h>
50 #include <VirtualRobot/Nodes/RobotNode.h>
51 #include <VirtualRobot/Robot.h>
52 #include <VirtualRobot/RobotNodeSet.h>
53 #include <VirtualRobot/Visualization/CoinVisualization/CoinVisualization.h>
54 #include <VirtualRobot/Visualization/VisualizationFactory.h>
57 #include <QMainWindow>
59 #include <QTreeWidget>
60 #include <QTreeWidgetItem>
66 #include <Eigen/Dense>
68 #include <Inventor/Qt/SoQt.h>
69 #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
70 #include <Inventor/nodes/SoEventCallback.h>
71 #include <Inventor/nodes/SoMatrixTransform.h>
72 #include <Inventor/nodes/SoNode.h>
73 #include <Inventor/nodes/SoSeparator.h>
74 #include <Inventor/sensors/SoTimerSensor.h>
78 class WorkingMemoryConfigDialog;
89 Q_PLUGIN_METADATA(IID
"ArmarXGuiInterface/1.00")
174 public WorkingMemoryListenerInterface
191 return "MemoryX.WorkingMemoryGui";
197 return QIcon(
"://icons/brain.svg");
210 const ::memoryx::EntityBasePtr& entity,
211 const ::Ice::Current& = Ice::emptyCurrent)
override;
213 const ::memoryx::EntityBasePtr& entityBaseOld,
214 const ::memoryx::EntityBasePtr& entityBaseNew,
215 const ::Ice::Current& = Ice::emptyCurrent)
override;
217 const ::memoryx::EntityBasePtr& entity,
218 const ::Ice::Current& = Ice::emptyCurrent)
override;
220 const ::Ice::Current& = Ice::emptyCurrent)
override;
223 const ::Ice::Current& = Ice::emptyCurrent)
override;
232 void entityChanged(memoryx::EntityBasePtr entity, QString entityType,
bool isNew);
269 void updateEntityVisu(memoryx::EntityBasePtr entity, QString entityType,
bool isNew);
286 void updateEntityTree(memoryx::EntityBasePtr entity, QString entityType,
bool isNew);
349 Ui::WorkingMemoryGuiPlugin
ui;
368 VirtualRobot::ManipulationObjectPtr
449 int addTab(std::string segmentName);
471 bool createEntity(memoryx::EntityBasePtr entity,
const std::string& entityType);
474 std::recursive_mutex mutexEntities;
475 std::map<std::string, std::pair<long, armarx::FramedPosePtr>>
478 AbstractWorkingMemoryInterfacePrx memoryPrx;
479 ObjectInstanceMemorySegmentBasePrx objectInstancesPrx;
480 AgentInstancesSegmentBasePrx agentInstancesProxy;
481 WorldStateSegmentBasePrx worldStateProxy;
482 PersistentObjectClassSegmentBasePrx classesSegmentPrx;
483 PriorKnowledgeInterfacePrx priorKnowledgePrx;
487 QPointer<WorkingMemoryConfigDialog> dialog;
489 std::string settings_priorMemoryName;
490 std::string settings_workingMemoryName;
491 std::string settings_workingMemoryUpdatesTopic;
492 std::string settings_objectInstancesSegmentName;
493 std::string settings_agentInstancesSegmentName;
494 std::string settings_worldStateSegmentName;
495 std::string settings_packages;
497 int robotUpdateTimerId;
500 bool visuSetting_transparentExistanceCertatinty;
501 bool visuSetting_showObjectModels;
504 using AgentEntryMap = std::map<std::string, RobotDefinition>;
508 AgentEntryMap currentAgents;
513 QToolBar* customToolbar;
515 QPointer<QDialog> sceneConfigDialog;
516 QPointer<armarx::DebugDrawerConfigWidget> debugDrawerConfigWidget;
The WorkingMemoryGuiPlugin provides a widget that allows you to inspect the current state of the work...
void createObjectVisualization(ObjectDefinition &o)
bool createEntity(memoryx::EntityBasePtr entity, const std::string &entityType)
createEntity Updates currentEntities or currentAgents with data.
SoNode * getScene() override
Reimplementing this function and returning a SoNode* will show this SoNode in the 3DViewerWidget,...
std::atomic< bool > showObjInstanceUncertainties
VirtualRobot::RobotPtr robot
Robot used for visualisation purposes.
~WorkingMemoryController() override
void onInitComponent() override
Pure virtual hook for the subclass.
SoSeparator * objectsVisu
static QString GetWidgetName()
void existenceCertaintyToggled(bool isChecked)
void setupVisualization()
void clearEntitiesVisu(const std::string &segmentName="")
void removeTab(std::string segmentName)
EntityEntryMap deletedEntities
QPointer< QWidget > getCustomTitlebarWidget(QWidget *parent) override
getTitleToolbar returns a pointer to the a toolbar widget of this controller.
void treeItemDoubleClicked(QTreeWidgetItem *item, int column)
void updateEntityVisu(memoryx::EntityBasePtr entity, QString entityType, bool isNew)
void reportEntityRemoved(const std::string &segmentName, const ::memoryx::EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
static QIcon GetWidgetIcon()
DebugLayerControlWidget * debugLayerControlWidget
memoryx::NameList segmentNames
void uncertaintyVisuToggled(bool isChecked)
void convertObjectInstanceToGlobalPose(ObjectInstance &obj)
int addTab(std::string segmentName)
VirtualRobot::CoinVisualizationPtr cv
void agentsRemoved()
agentsRemoved One or multiple agent(s) have been removed from memory. This method updates all Qt rela...
std::map< std::string, struct SegmentTab > segmentTabs
EntityEntryMap currentEntities
void refetchEntitiesFromMemory()
void processPackages(const std::string &packages)
void updateAgentVisualisation(const std::string entityId)
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
void objectsRemoved()
objectsRemoved One or multiple object(s) have been removed from memory. This method updates all Qt re...
void reportMemoryCleared(const std::string &segmentName, const ::Ice::Current &=Ice::emptyCurrent) override
void showAgents(bool show)
Sets the visibility for agents.
void reportSnapshotLoaded(const std::string &segmentName, const ::Ice::Current &=Ice::emptyCurrent) override
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
void signalRebuildVisualization()
armarx::RobotStateComponentInterfacePrx robotStateComponent
void timerEvent(QTimerEvent *) override
void signalRefetchEntities()
void updateEntityTree(memoryx::EntityBasePtr entity, QString entityType, bool isNew)
boost::shared_ptr< VirtualRobot::CoinVisualization > CoinVisualizationPtr
WorkingMemoryController()
IceUtil::Time timestamp
Time when timestamped robot was updated.
void signalObjectRemoved()
void clearWorkingMemory()
clearWorkingMemory deletes the current contents of WorkingMemory
VirtualRobot::ManipulationObjectPtr manipObj
Object used for visualisation purposes.
void onExitComponent() override
Hook for subclass.
void onDisconnectComponent() override
Hook for subclass.
void onConnectComponent() override
Pure virtual hook for the subclass.
void createAgentVisualisation(const std::string entityId)
void reportEntityCreated(const std::string &segmentName, const ::memoryx::EntityBasePtr &entity, const ::Ice::Current &=Ice::emptyCurrent) override
void updateVisualization(const EntityWrappers::SimoxObjectWrapperPtr objWrapper)
void showVisuLayers(bool show)
Sets the visibility for debugDrawer's visualization layers.
std::shared_ptr< WorkingMemoryController > WorkingMemoryGuiPluginPtr
armarx::core::time::DateTime Time
QPointer< QDialog > getConfigDialog(QWidget *parent=nullptr) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
void reportSnapshotCompletelyLoaded(const Ice::Current &c=Ice::emptyCurrent) override
QPointer< QDialog > getSceneConfigDialog(QWidget *parent=nullptr) override
Reimplementing this function and returning a QDialog* will enable a configuration button which opens ...
void setMutex3D(RecursiveMutexPtr const &mutex3D) override
This mutex is used to protect 3d scene updates. Usually called by the ArmarXGui main window on creati...
void updateObjectData(const ObjectInstancePtr obj)
void entityChanged(memoryx::EntityBasePtr entity, QString entityType, bool isNew)
std::shared_ptr< GridFileManager > GridFileManagerPtr
void showPlane(bool show)
Ui::WorkingMemoryGuiPlugin ui
void removeEntityInTree(const std::string entityId, const std::string entityType)
void rebuildVisualization()
SoSeparator * debugLayerVisu
This widget allows you to inspect the current state of the working memory.
bool addAgent(const AgentInstancePtr agent)
SoNode * visualization
Object visualisation.
EntityWrappers::SimoxObjectWrapperPtr simoxWrapper
void signalClearEntities(const std::string &segmentName)
VirtualRobot::RobotPtr timestampedRobot
std::map< std::string, ObjectDefinition > EntityEntryMap
SoNode * visualization
Robot visualisation.
void signalAgentsRemoved()
std::shared_ptr< class Robot > RobotPtr
void reportEntityUpdated(const std::string &segmentName, const ::memoryx::EntityBasePtr &entityBaseOld, const ::memoryx::EntityBasePtr &entityBaseNew, const ::Ice::Current &=Ice::emptyCurrent) override
void setupEntityVisu(const ObjectDefinition &objWrapper)
void startTimerInGUIThread()