SimulatorToArviz.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 ArmarXSimulation::ArmarXObjects::SimulatorToArviz
17  * @author Peter Reiner ( ufekv at student dot 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 
27 #include <ArmarXCore/interface/observers/ObserverInterface.h>
28 
33 
34 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
38 
39 #include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
40 
41 //#include <RobotAPI/libraries/core/visualization/DebugDrawerTopic.h>
42 
43 
44 namespace armarx
45 {
46 
47  /**
48  * @defgroup Component-SimulatorToArviz SimulatorToArviz
49  * @ingroup ArmarXSimulation-Components
50  * A description of the component SimulatorToArviz.
51  *
52  * @class SimulatorToArviz
53  * @ingroup Component-SimulatorToArviz
54  * @brief Brief description of class SimulatorToArviz.
55  *
56  * Detailed description of class SimulatorToArviz.
57  */
59  virtual public armarx::Component,
60  virtual public armarx::ArVizComponentPluginUser,
61  virtual public armarx::SimulatorListenerInterface
62  {
63  public:
64 
66  /// @see armarx::ManagedIceObject::getDefaultName()
67  std::string getDefaultName() const override;
68  void reportSceneUpdated(const SceneVisuData& scene, const ::Ice::Current& = ::Ice::emptyCurrent) override;
69 
70  protected:
71 
72  /// @see armarx::ManagedIceObject::onInitComponent()
73  void onInitComponent() override;
74 
75  /// @see armarx::ManagedIceObject::onConnectComponent()
76  void onConnectComponent() override;
77 
78  /// @see armarx::ManagedIceObject::onDisconnectComponent()
79  void onDisconnectComponent() override;
80 
81  /// @see armarx::ManagedIceObject::onExitComponent()
82  void onExitComponent() override;
83 
84  /// @see PropertyUser::createPropertyDefinitions()
86 
87 
88  private:
89 
90  // Private methods and member variables go here.
91 
92  /// Debug observer. Used to visualize e.g. time series.
94 
95  void handleObjectPrimitiveData(const ObjectVisuData& _object, armarx::viz::Layer& objectLayer);
96  void handleObjectFromObjectClass(const ObjectVisuData& _object, armarx::viz::Layer& objectLayer);
97  std::string getClassFilename(const std::string& className);
98  void handleObjectFromFile(const ObjectVisuData& _object, armarx::viz::Layer& objectLayer);
99 
100  void handleRobotLayer(const RobotVisuList& robotList, armarx::viz::Layer& robotLayer);
101  void handleObjectLayer(const ObjectVisuList& objectList, armarx::viz::Layer& objectLayer);
102 
103  /// Debug drawer. Used for 3D visualization.
104  //armarx::DebugDrawerTopic debugDrawer;
105 
106 
107  struct Properties
108  {
110  {
111  bool use = false;
112  std::string name = "PriorKnowledge";
113  };
114  OldPriorKnowledge oldPriorKnowledge;
115  };
116  Properties properties;
117 
118  memoryx::PriorKnowledgeInterfacePrx priorKnowledge;
119  memoryx::ObjectClassSegmentWrapper objectClassSegment;
120 
121  std::map<std::string, std::string> classFilenameCache;
122 
123  //SimulatorListenerInterfacePrx _simulatorListenerInterfacePrx;
124  };
125 }
Client.h
ObjectClassSegmentWrapper.h
ArVizComponentPlugin.h
memoryx::ObjectClassSegmentWrapper
Definition: ObjectClassSegmentWrapper.h:23
Layer.h
Elements.h
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
armarx::SimulatorToArviz::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: SimulatorToArviz.cpp:31
armarx::SimulatorToArviz::onDisconnectComponent
void onDisconnectComponent() override
Definition: SimulatorToArviz.cpp:75
armarx::SimulatorToArviz::Properties::OldPriorKnowledge
Definition: SimulatorToArviz.h:109
armarx::SimulatorToArviz::Properties::OldPriorKnowledge::name
std::string name
Definition: SimulatorToArviz.h:112
armarx::SimulatorToArviz::Properties::OldPriorKnowledge::use
bool use
Definition: SimulatorToArviz.h:111
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
SimoxObjectWrapper.h
ObjectInstance.h
armarx::SimulatorToArviz::reportSceneUpdated
void reportSceneUpdated(const SceneVisuData &scene, const ::Ice::Current &=::Ice::emptyCurrent) override
Definition: SimulatorToArviz.cpp:85
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::SimulatorToArviz::onConnectComponent
void onConnectComponent() override
Definition: SimulatorToArviz.cpp:65
armarx::SimulatorToArviz::onExitComponent
void onExitComponent() override
Definition: SimulatorToArviz.cpp:80
armarx::SimulatorToArviz::getDefaultName
std::string getDefaultName() const override
Definition: SimulatorToArviz.cpp:47
armarx::SimulatorToArviz::onInitComponent
void onInitComponent() override
Definition: SimulatorToArviz.cpp:53
armarx::viz::Layer
Definition: Layer.h:12
armarx::SimulatorToArviz
Brief description of class SimulatorToArviz.
Definition: SimulatorToArviz.h:58
armarx::SimulatorToArviz::SimulatorToArviz
SimulatorToArviz()
Definition: SimulatorToArviz.cpp:42
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28