WorkingMemoryToArViz.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package MemoryX::ArmarXObjects::WorkingMemoryToArViz
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2020
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <mutex>
26 
29 
31 
32 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
33 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
34 #include <MemoryX/interface/components/WorkingMemoryToArVizInterface.h>
35 
36 #include "ObjectInstancesToArViz.h"
37 
38 
39 
40 namespace armarx
41 {
42  /**
43  * @class WorkingMemoryToArVizPropertyDefinitions
44  * @brief Property definitions of `WorkingMemoryToArViz`.
45  */
48  {
49  public:
51  };
52 
53 
54 
55  /**
56  * @defgroup Component-WorkingMemoryToArViz WorkingMemoryToArViz
57  * @ingroup MemoryX-Components
58  * A description of the component WorkingMemoryToArViz.
59  *
60  * @class WorkingMemoryToArViz
61  * @ingroup Component-WorkingMemoryToArViz
62  * @brief Brief description of class WorkingMemoryToArViz.
63  *
64  * Detailed description of class WorkingMemoryToArViz.
65  */
67  virtual public armarx::Component,
68  virtual public memoryx::WorkingMemoryToArVizInterface,
70  {
71  public:
72 
73  /// @see armarx::ManagedIceObject::getDefaultName()
74  std::string getDefaultName() const override;
75 
76 
77  // WorkingMemoryToArVizInterface interface
78 
79  void updateBlackWhitelist(const BlackWhitelistUpdate& update,
80  const Ice::Current& = Ice::emptyCurrent) override;
81 
82  void attachObjectToRobotNode(const memoryx::AttachObjectToRobotNodeInput& input,
83  const Ice::Current& = Ice::emptyCurrent) override;
84  void detachObjectFromRobotNode(const memoryx::DetachObjectFromRobotNodeInput& input,
85  const Ice::Current& = Ice::emptyCurrent) override;
86 
87 
88  protected:
89 
91 
92  void onInitComponent() override;
93  void onConnectComponent() override;
94  void onDisconnectComponent() override;
95  void onExitComponent() override;
96 
97 
98  private:
99 
100  struct Properties
101  {
102  float updateFrequency = 30;
103 
104  struct Floor
105  {
106  bool show = true;
107  float height = -1;
108  };
109  Floor floor;
110 
111  std::string loadObjectDatasetsStr = "";
112  };
113  Properties p;
114 
115  memoryx::PriorKnowledgeInterfacePrx priorKnowledge;
116  memoryx::WorkingMemoryInterfacePrx workingMemory;
117 
118  armarx::RobotStateComponentInterfacePrx robotStateComponent;
119 
120  std::mutex drawerMutex;
121 
123 
125 
126  };
127 }
armarx::WorkingMemoryToArViz::updateBlackWhitelist
void updateBlackWhitelist(const BlackWhitelistUpdate &update, const Ice::Current &=Ice::emptyCurrent) override
Definition: WorkingMemoryToArViz.cpp:148
ArVizComponentPlugin.h
armarx::WorkingMemoryToArVizPropertyDefinitions::WorkingMemoryToArVizPropertyDefinitions
WorkingMemoryToArVizPropertyDefinitions(std::string prefix)
Definition: WorkingMemoryToArViz.cpp:30
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::WorkingMemoryToArViz::getDefaultName
std::string getDefaultName() const override
Definition: WorkingMemoryToArViz.cpp:70
armarx::WorkingMemoryToArViz::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: WorkingMemoryToArViz.cpp:76
armarx::WorkingMemoryToArViz::Properties::Floor::show
bool show
Definition: WorkingMemoryToArViz.h:106
memoryx::ObjectInstancesToArViz
This class can be used to visualize object instances from working memory to ArViz.
Definition: ObjectInstancesToArViz.h:29
armarx::WorkingMemoryToArViz::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: WorkingMemoryToArViz.cpp:142
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
armarx::WorkingMemoryToArViz::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: WorkingMemoryToArViz.cpp:132
armarx::aron::input
ReaderT::InputType & input
Definition: rw.h:19
armarx::WorkingMemoryToArViz::Properties::Floor
Definition: WorkingMemoryToArViz.h:104
armarx::WorkingMemoryToArVizPropertyDefinitions
Property definitions of WorkingMemoryToArViz.
Definition: WorkingMemoryToArViz.h:46
armarx::WorkingMemoryToArViz::detachObjectFromRobotNode
void detachObjectFromRobotNode(const memoryx::DetachObjectFromRobotNodeInput &input, const Ice::Current &=Ice::emptyCurrent) override
Definition: WorkingMemoryToArViz.cpp:163
TaskUtil.h
armarx::WorkingMemoryToArViz::Properties::Floor::height
float height
Definition: WorkingMemoryToArViz.h:107
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:67
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
armarx::WorkingMemoryToArViz::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: WorkingMemoryToArViz.cpp:87
ObjectInstancesToArViz.h
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::WorkingMemoryToArViz
Brief description of class WorkingMemoryToArViz.
Definition: WorkingMemoryToArViz.h:66
armarx::WorkingMemoryToArViz::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: WorkingMemoryToArViz.cpp:36
armarx::WorkingMemoryToArViz::attachObjectToRobotNode
void attachObjectToRobotNode(const memoryx::AttachObjectToRobotNodeInput &input, const Ice::Current &=Ice::emptyCurrent) override
Definition: WorkingMemoryToArViz.cpp:155
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28