BringObjectGroupStatechartContext.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of ArmarX.
3
*
4
* Copyright (C) 2014-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5
*
6
* ArmarX is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 2 as
8
* published by the Free Software Foundation.
9
*
10
* ArmarX is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*
18
* @package RobotSkillTemplates::BringObjectGroup
19
* @author Mirko Waechter ( mirko dot waechter at kit dot edu )
20
* @date 2015
21
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22
* GNU General Public License
23
*/
24
25
#include "
BringObjectGroupStatechartContext.h
"
26
27
#include <
ArmarXCore/core/Component.h
>
28
#include <
ArmarXCore/core/system/ImportExportComponent.h
>
29
#include <
ArmarXCore/statechart/Statechart.h
>
30
31
#include <RobotAPI/interface/core/FramedPoseBase.h>
32
#include <
RobotAPI/libraries/core/remoterobot/RemoteRobot.h
>
33
34
namespace
armarx::BringObjectGroup
35
{
36
void
37
BringObjectGroupStatechartContext::onInitStatechartContext
()
38
{
39
// Register dependencies
40
// usingProxy(getProperty<std::string>("KinematicUnitName").getValue());
41
// usingProxy(getProperty<std::string>("KinematicUnitObserverName").getValue());
42
usingProxy
(
getProperty<std::string>
(
"RobotStateComponentName"
).getValue());
43
// usingProxy(getProperty<std::string>("TCPControlUnitName").getValue());
44
usingProxy
(
getProperty<std::string>
(
"WorkingMemoryName"
).getValue());
45
usingProxy
(
getProperty<std::string>
(
"ObjectMemoryObserverName"
).getValue());
46
usingProxy
(
getProperty<std::string>
(
"PriorKnowledgeName"
).getValue());
47
usingProxy
(
getProperty<std::string>
(
"ViewSelectionName"
).getValue());
48
// usingProxy(getProperty<std::string>("PathPlannerName").getValue());
49
50
offeringTopic
(
"DebugDrawerUpdates"
);
51
}
52
53
void
54
BringObjectGroupStatechartContext::onConnectStatechartContext
()
55
{
56
57
// retrieve proxies
58
robotStateComponent =
getProxy<RobotStateComponentInterfacePrx>
(
59
getProperty<std::string>
(
"RobotStateComponentName"
).getValue());
60
// kinematicUnitPrx = getProxy<KinematicUnitInterfacePrx>(getProperty<std::string>("KinematicUnitName").getValue());
61
// kinematicUnitObserverPrx = getProxy<KinematicUnitObserverInterfacePrx>(getProperty<std::string>("KinematicUnitObserverName").getValue());
62
// tcpControlPrx = getProxy<TCPControlUnitInterfacePrx>(getProperty<std::string>("TCPControlUnitName").getValue());
63
64
workingMemoryProxy =
getProxy<memoryx::WorkingMemoryInterfacePrx>
(
65
getProperty<std::string>
(
"WorkingMemoryName"
).getValue());
66
objectMemoryObserverProxy =
getProxy<memoryx::ObjectMemoryObserverInterfacePrx>
(
67
getProperty<std::string>
(
"ObjectMemoryObserverName"
).getValue());
68
priorKnowledgeProxy =
getProxy<memoryx::PriorKnowledgeInterfacePrx>
(
69
getProperty<std::string>
(
"PriorKnowledgeName"
).getValue());
70
viewSelection =
getProxy<ViewSelectionInterfacePrx>
(
71
getProperty<std::string>
(
"ViewSelectionName"
).getValue());
72
// pathPlannerPrx = getProxy<PathPlannerBasePrx>(getProperty<std::string>("PriorPathPlannerNameKnowledgeName").getValue());
73
74
75
// // initialize remote robot
76
remoteRobot.reset(
new
RemoteRobot
(robotStateComponent->getSynchronizedRobot()));
77
78
debugDrawerTopicProxy =
getTopic<armarx::DebugDrawerInterfacePrx>
(
"DebugDrawerUpdates"
);
79
/*try
80
{
81
simulatorPrx = getProxy<SimulatorInterfacePrx>("Simulator");
82
}
83
catch(...)
84
{
85
ARMARX_WARNING << "Could not get simulator proxy";
86
}*/
87
}
88
89
PropertyDefinitionsPtr
90
BringObjectGroupStatechartContext::createPropertyDefinitions()
91
{
92
return
PropertyDefinitionsPtr
(
93
new
BringObjectGroupStatechartContextProperties
(
getConfigIdentifier
()));
94
}
95
}
// namespace armarx::BringObjectGroup
Component.h
BringObjectGroupStatechartContext.h
ImportExportComponent.h
RemoteRobot.h
Statechart.h
armarx::BringObjectGroup::BringObjectGroupStatechartContext::onInitStatechartContext
void onInitStatechartContext() override
onInitStatechartonInitStatechartContext can be implemented by subclasses
Definition
BringObjectGroupStatechartContext.cpp:37
armarx::BringObjectGroup::BringObjectGroupStatechartContext::onConnectStatechartContext
void onConnectStatechartContext() override
onConnectStatechartContext can be implemented by subclasses
Definition
BringObjectGroupStatechartContext.cpp:54
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition
Component.cpp:90
armarx::Component::getProperty
Property< PropertyType > getProperty(const std::string &name)
Definition
PropertyUser.h:180
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition
ManagedIceObject.cpp:300
armarx::ManagedIceObject::getTopic
TopicProxyType getTopic(const std::string &name)
Returns a proxy of the specified topic.
Definition
ManagedIceObject.h:480
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition
ManagedIceObject.cpp:154
armarx::ManagedIceObject::getProxy
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
Definition
ManagedIceObject.cpp:407
armarx::RemoteRobot
Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.
Definition
RemoteRobot.h:145
armarx::BringObjectGroup
Definition
BringObjectGroupRemoteStateOfferer.h:32
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition
forward_declarations.h:35
armarx::BringObjectGroup::BringObjectGroupStatechartContextProperties
Definition
BringObjectGroupStatechartContext.h:56
RobotSkillTemplates
statecharts
BringObjectGroup
BringObjectGroupStatechartContext.cpp
Generated by
1.13.2