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 <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
35
36#include <MemoryX/interface/components/PriorKnowledgeInterface.h>
40
41//#include <RobotAPI/libraries/core/visualization/DebugDrawerTopic.h>
42
43
44namespace 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,
61 virtual public armarx::SimulatorListenerInterface
62 {
63 public:
65 /// @see armarx::ManagedIceObject::getDefaultName()
66 static std::string GetDefaultName();
67 std::string getDefaultName() const override;
68 void reportSceneUpdated(const SceneVisuData& scene,
69 const ::Ice::Current& = ::Ice::emptyCurrent) override;
70
71 protected:
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 // Private methods and member variables go here.
90
91 /// Debug observer. Used to visualize e.g. time series.
93
94 void handleObjectPrimitiveData(const ObjectVisuData& _object,
95 armarx::viz::Layer& objectLayer);
96 void handleObjectFromObjectClass(const ObjectVisuData& _object,
97 armarx::viz::Layer& objectLayer);
98 std::string getClassFilename(const std::string& className);
99 void handleObjectFromFile(const ObjectVisuData& _object, armarx::viz::Layer& objectLayer);
100
101 void handleRobotLayer(const RobotVisuList& robotList, armarx::viz::Layer& robotLayer);
102 void handleObjectLayer(const ObjectVisuList& objectList, armarx::viz::Layer& objectLayer);
103
104 /// Debug drawer. Used for 3D visualization.
105 //armarx::DebugDrawerTopic debugDrawer;
106
107
108 struct Properties
109 {
111 {
112 bool use = false;
113 std::string name = "PriorKnowledge";
114 };
115
116 OldPriorKnowledge oldPriorKnowledge;
117 };
118
119 Properties properties;
120
121 memoryx::PriorKnowledgeInterfacePrx priorKnowledge;
122 memoryx::ObjectClassSegmentWrapper objectClassSegment;
123
124 std::map<std::string, std::string> classFilenameCache;
125
126 //SimulatorListenerInterfacePrx _simulatorListenerInterfacePrx;
127 };
128} // namespace armarx
Provides a ready-to-use ArViz client arviz as member variable.
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void reportSceneUpdated(const SceneVisuData &scene, const ::Ice::Current &=::Ice::emptyCurrent) override
void onConnectComponent() override
static std::string GetDefaultName()
std::string getDefaultName() const override
Retrieve default name of component.
This file offers overloads of toIce() and fromIce() functions for STL container types.
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.