PlatformContext.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 RobotSkillTemplates::MovePlatform
17* @author Valerij Wittenbeck
18* @date 2014
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23
24#pragma once
25
29
31#include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
32#include <RobotAPI/interface/observers/PlatformUnitObserverInterface.h>
33#include <RobotAPI/interface/units/PlatformUnitInterface.h>
34#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
37
40//#include <VirtualRobot/VirtualRobot.h>
41#include <IceUtil/Time.h>
42
43#include <RobotAPI/interface/ArViz/Component.h>
44
45namespace armarx
46{
47
48 // ****************************************************************
49 // Component and context
50 // ****************************************************************
51
53 {
55 {
57 "PlatformUnitName", "PlatformUnit", "Name of the PlatformUnit to use");
58 defineOptionalProperty<std::string>("PlatformUnitObserverName",
59 "PlatformUnitObserver",
60 "Name of the PlatformUnitObserver to use");
62 "DebugDrawerTopic", "DebugDrawerUpdates", "Name of the DebugDrawerTopic to use");
64 "PriorKnowledgeName", "PriorKnowledge", "Name of the PriorKnowledge memory to use");
65 defineOptionalProperty<std::string>("GraphNodePoseResolverName",
66 "GraphNodePoseResolver",
67 "Name of the GraphNodePoseResolver to use");
69 "ArVizTopicName", "ArVizTopic", "Name of the ar viz topic that should be used");
71 "MemoryNameSystemName",
72 "MemoryNameSystem",
73 "Name of the Memory Name System that should be used");
74 }
75 };
76
78 {
79 public:
80 // inherited from Component
81 std::string
82 getDefaultName() const override
83 {
84 return "PlatformContext";
85 }
86
87 void
89 {
90 ARMARX_INFO << "Init PlatformContext" << flush;
91
93 getProperty<std::string>("PlatformUnitObserverName").getValue();
95 getProperty<std::string>("PlatformUnitName").getValue();
96 priorKnowledgeName = getProperty<std::string>("PriorKnowledgeName").getValue();
97
100 offeringTopic(getProperty<std::string>("DebugDrawerTopic").getValue());
101 offeringTopic("DebugObserver");
103 offeringTopic(getProperty<std::string>("ArVizTopicName").getValue());
104 usingProxy(getProperty<std::string>("GraphNodePoseResolverName").getValue());
105 usingProxyFromProperty("MemoryNameSystemName");
106 }
107
108 void
127
128 /**
129 * @see PropertyUser::createPropertyDefinitions()
130 */
136
137 std::string
142
143 PlatformUnitInterfacePrx platformUnitPrx;
144 PlatformUnitObserverInterfacePrx platformUnitObserverPrx;
146 memoryx::GraphNodePoseResolverInterfacePrx graphNodePoseResolverPrx;
150 armarx::viz::TopicPrx arvizTopic;
151 armarx::armem::mns::MemoryNameSystemInterfacePrx memoryNameSystemPrx;
152
154 memoryx::PriorKnowledgeInterfacePrx priorKnowledgePrx;
155
156 private:
157 };
158} // namespace armarx
#define ARMARXCOMPONENT_IMPORT_EXPORT
bool usingProxyFromProperty(const std::string &propertyName, const std::string &endpoints="")
Use a proxy whose name is specified by the given property.
ProxyType getProxyFromProperty(const std::string &propertyName, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true)
Get a proxy whose name is specified by the given property.
Definition Component.h:242
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Property< PropertyType > getProperty(const std::string &name)
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
std::string platformUnitObserverName
memoryx::GraphNodePoseResolverInterfacePrx graphNodePoseResolverPrx
memoryx::PriorKnowledgeInterfacePrx priorKnowledgePrx
std::string getPlatformUnitObserverName()
void onInitStatechartContext() override
onInitStatechartonInitStatechartContext can be implemented by subclasses
DebugObserverInterfacePrx debugObserverPrx
std::string platformUnitDynamicSimulationName
armarx::armem::mns::MemoryNameSystemInterfacePrx memoryNameSystemPrx
PlatformUnitObserverInterfacePrx platformUnitObserverPrx
PropertyDefinitionsPtr createPropertyDefinitions() override
void onConnectStatechartContext() override
onConnectStatechartContext can be implemented by subclasses
armarx::viz::TopicPrx arvizTopic
PlatformUnitInterfacePrx platformUnitPrx
std::string getDefaultName() const override
Retrieve default name of component.
DebugDrawerInterfacePrx debugDrawer
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
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.
const LogSender::manipulator flush
Definition LogSender.h:251
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
PlatformContextProperties(std::string prefix)