HandGroupStatechartContext.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::HandGroup
19
* @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
20
* @date 2014
21
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22
* GNU General Public License
23
*/
24
25
#include "
HandGroupStatechartContext.h
"
26
27
#include <SimoxUtility/algorithm/string/string_tools.h>
28
29
#include <
ArmarXCore/core/Component.h
>
30
#include <
ArmarXCore/core/system/ImportExportComponent.h
>
31
#include <
ArmarXCore/statechart/Statechart.h
>
32
33
#include <
RobotAPI/libraries/core/Pose.h
>
34
#include <
RobotAPI/libraries/core/remoterobot/RemoteRobot.h
>
35
36
using namespace
armarx
;
37
38
namespace
armarx::HandGroup
39
{
40
void
41
HandGroupStatechartContext::onInitStatechartContext
()
42
{
43
// Register dependencies
44
// usingProxy(getProperty<std::string>("KinematicUnitName").getValue());
45
// usingProxy(getProperty<std::string>("KinematicUnitObserverName").getValue());
46
usingProxy
(
getProperty<std::string>
(
"RobotStateComponentName"
).getValue());
47
// usingProxy(getProperty<std::string>("TCPControlUnitName").getValue());
48
49
const
std::string handUnitNamesStr =
getProperty<std::string>
(
"HandUnitNames"
).getValue();
50
handUnitNames = simox::alg::split(handUnitNamesStr,
","
);
51
52
for
(std::string handUnitName : handUnitNames)
53
{
54
usingProxy
(handUnitName);
55
}
56
}
57
58
void
59
HandGroupStatechartContext::onConnectStatechartContext
()
60
{
61
62
// retrieve proxies
63
robotStateComponent =
getProxy<RobotStateComponentInterfacePrx>
(
64
getProperty<std::string>
(
"RobotStateComponentName"
).getValue());
65
// kinematicUnitPrx = getProxy<KinematicUnitInterfacePrx>(getProperty<std::string>("KinematicUnitName").getValue());
66
// kinematicUnitObserverPrx = getProxy<KinematicUnitObserverInterfacePrx>(getProperty<std::string>("KinematicUnitObserverName").getValue());
67
// tcpControlPrx = getProxy<TCPControlUnitInterfacePrx>(getProperty<std::string>("TCPControlUnitName").getValue());
68
69
// initialize remote robot
70
remoteRobot.reset(
new
RemoteRobot
(robotStateComponent->getSynchronizedRobot()));
71
72
for
(std::string handUnitName : handUnitNames)
73
{
74
HandUnitInterfacePrx prx =
getProxy<HandUnitInterfacePrx>
(handUnitName);
75
handUnits.insert(std::make_pair(prx->getHandName(), prx));
76
}
77
}
78
79
PropertyDefinitionsPtr
80
HandGroupStatechartContext::createPropertyDefinitions()
81
{
82
return
PropertyDefinitionsPtr
(
83
new
HandGroupStatechartContextProperties
(
getConfigIdentifier
()));
84
}
85
}
// namespace armarx::HandGroup
Component.h
HandGroupStatechartContext.h
ImportExportComponent.h
Pose.h
RemoteRobot.h
Statechart.h
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::HandGroup::HandGroupStatechartContext::onInitStatechartContext
void onInitStatechartContext() override
onInitStatechartonInitStatechartContext can be implemented by subclasses
Definition
HandGroupStatechartContext.cpp:41
armarx::HandGroup::HandGroupStatechartContext::onConnectStatechartContext
void onConnectStatechartContext() override
onConnectStatechartContext can be implemented by subclasses
Definition
HandGroupStatechartContext.cpp:59
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::HandGroup
Definition
CloseHand.h:30
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition
ArmarXTimeserver.cpp:28
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition
forward_declarations.h:35
armarx::HandGroup::HandGroupStatechartContextProperties
Definition
HandGroupStatechartContext.h:49
RobotSkillTemplates
statecharts
HandGroup
HandGroupStatechartContext.cpp
Generated by
1.13.2