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 std::string getDefaultName() const override;
67 void reportSceneUpdated(const SceneVisuData& scene,
68 const ::Ice::Current& = ::Ice::emptyCurrent) override;
69
70 protected:
71 /// @see armarx::ManagedIceObject::onInitComponent()
72 void onInitComponent() override;
73
74 /// @see armarx::ManagedIceObject::onConnectComponent()
75 void onConnectComponent() override;
76
77 /// @see armarx::ManagedIceObject::onDisconnectComponent()
78 void onDisconnectComponent() override;
79
80 /// @see armarx::ManagedIceObject::onExitComponent()
81 void onExitComponent() override;
82
83 /// @see PropertyUser::createPropertyDefinitions()
85
86
87 private:
88 // Private methods and member variables go here.
89
90 /// Debug observer. Used to visualize e.g. time series.
92
93 void handleObjectPrimitiveData(const ObjectVisuData& _object,
94 armarx::viz::Layer& objectLayer);
95 void handleObjectFromObjectClass(const ObjectVisuData& _object,
96 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
115 OldPriorKnowledge oldPriorKnowledge;
116 };
117
118 Properties properties;
119
120 memoryx::PriorKnowledgeInterfacePrx priorKnowledge;
121 memoryx::ObjectClassSegmentWrapper objectClassSegment;
122
123 std::map<std::string, std::string> classFilenameCache;
124
125 //SimulatorListenerInterfacePrx _simulatorListenerInterfacePrx;
126 };
127} // 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
std::string getDefaultName() const override
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.