PickAndPlaceGroupStatechartContext.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::PickAndPlaceGroup
19
* @author [Author Name] ( [Author Email] )
20
* @date 2014
21
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22
* GNU General Public License
23
*/
24
25
#include "
PickAndPlaceGroupStatechartContext.h
"
26
27
#include <
RobotAPI/libraries/core/remoterobot/RemoteRobot.h
>
28
//#include <RobotAPI/libraries/core/Pose.h>
29
30
#include <
ArmarXCore/core/Component.h
>
31
#include <
ArmarXCore/core/system/ImportExportComponent.h
>
32
#include <
ArmarXCore/statechart/Statechart.h
>
33
34
namespace
armarx
35
{
36
namespace
PickAndPlaceGroup
37
{
38
void
39
PickAndPlaceGroupStatechartContext::onInitStatechartContext
()
40
{
41
// Register dependencies
42
usingProxy
(
getProperty<std::string>
(
"KinematicUnitName"
).getValue());
43
usingProxy
(
getProperty<std::string>
(
"KinematicUnitObserverName"
).getValue());
44
usingProxy
(
getProperty<std::string>
(
"RobotStateComponentName"
).getValue());
45
usingProxy
(
getProperty<std::string>
(
"TCPControlUnitName"
).getValue());
46
// usingProxy(getProperty<std::string>("TCPControlUnitObserverName").getValue());
47
//usingProxy(getProperty<std::string>("ForceTorqueUnitName").getValue());
48
usingProxy
(
getProperty<std::string>
(
"ForceTorqueObserverName"
).getValue());
49
usingProxy
(
getProperty<std::string>
(
"WorkingMemoryName"
).getValue());
50
usingProxy
(
getProperty<std::string>
(
"ObjectMemoryObserverName"
).getValue());
51
usingProxy
(
getProperty<std::string>
(
"PriorKnowledgeName"
).getValue());
52
/*std::string simPrxName = getProperty<std::string>("SimulatorName").getValue();
53
if (!simPrxName.empty())
54
{
55
usingProxy(simPrxName);
56
}*/
57
headIKUnitName =
getProperty<std::string>
(
"HeadIKUnitName"
).getValue();
58
ARMARX_LOG
<< eINFO <<
"headIKUnitName:"
<< headIKUnitName <<
flush
;
59
headIKKinematicChainName =
60
getProperty<std::string>
(
"HeadIKKinematicChainName"
).getValue();
61
62
if
(!headIKUnitName.empty())
63
{
64
usingProxy
(headIKUnitName);
65
}
66
}
67
68
void
69
PickAndPlaceGroupStatechartContext::onConnectStatechartContext
()
70
{
71
72
// retrieve proxies
73
robotStateComponent =
getProxy<RobotStateComponentInterfacePrx>
(
74
getProperty<std::string>
(
"RobotStateComponentName"
).getValue());
75
kinematicUnitPrx =
getProxy<KinematicUnitInterfacePrx>
(
76
getProperty<std::string>
(
"KinematicUnitName"
).getValue());
77
kinematicUnitObserverPrx =
getProxy<KinematicUnitObserverInterfacePrx>
(
78
getProperty<std::string>
(
"KinematicUnitObserverName"
).getValue());
79
tcpControlPrx =
getProxy<TCPControlUnitInterfacePrx>
(
80
getProperty<std::string>
(
"TCPControlUnitName"
).getValue());
81
//tcpControlUnitObserverPrx = getProxy<TCPControlUnitObserverInterfacePrx>(getProperty<std::string>("TCPControlUnitObserverName").getValue());
82
//ftUnitPrx = getProxy<ForceTorqueUnitInterfacePrx>(getProperty<std::string>("ForceTorqueUnitName").getValue());
83
ftUnitObserverPrx =
getProxy<ForceTorqueUnitObserverInterfacePrx>
(
84
getProperty<std::string>
(
"ForceTorqueObserverName"
).getValue());
85
//simulatorProxy = getProxy<SimulatorInterfacePrx>(getProperty<std::string>("SimulatorName").getValue());
86
workingMemoryProxy =
getProxy<memoryx::WorkingMemoryInterfacePrx>
(
87
getProperty<std::string>
(
"WorkingMemoryName"
).getValue());
88
objectMemoryObserverProxy =
getProxy<memoryx::ObjectMemoryObserverInterfacePrx>
(
89
getProperty<std::string>
(
"ObjectMemoryObserverName"
).getValue());
90
priorKnowledgeProxy =
getProxy<memoryx::PriorKnowledgeInterfacePrx>
(
91
getProperty<std::string>
(
"PriorKnowledgeName"
).getValue());
92
93
if
(!headIKUnitName.empty())
94
{
95
headIKUnitPrx =
getProxy<HeadIKUnitInterfacePrx>
(headIKUnitName);
96
ARMARX_LOG
<< eINFO <<
"Fetched headIK proxy "
<< headIKUnitName <<
":"
97
<< headIKUnitPrx <<
", head IK kin chain:"
<< headIKKinematicChainName
98
<<
flush
;
99
}
100
101
// initialize remote robot
102
remoteRobot.reset(
new
RemoteRobot
(robotStateComponent->getSynchronizedRobot()));
103
//simulatorProxy = getProxy<SimulatorInterfacePrx>("Simulator");
104
}
105
106
PropertyDefinitionsPtr
107
PickAndPlaceGroupStatechartContext::createPropertyDefinitions()
108
{
109
return
PropertyDefinitionsPtr
(
110
new
PickAndPlaceGroupStatechartContextProperties
(
getConfigIdentifier
()));
111
}
112
}
// namespace PickAndPlaceGroup
113
114
115
}
// namespace armarx
Component.h
ImportExportComponent.h
PickAndPlaceGroupStatechartContext.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::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::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::onInitStatechartContext
virtual void onInitStatechartContext()
onInitStatechartonInitStatechartContext can be implemented by subclasses
Definition
PickAndPlaceGroupStatechartContext.cpp:39
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::onConnectStatechartContext
virtual void onConnectStatechartContext()
onConnectStatechartContext can be implemented by subclasses
Definition
PickAndPlaceGroupStatechartContext.cpp:69
armarx::RemoteRobot
Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.
Definition
RemoteRobot.h:145
ARMARX_LOG
#define ARMARX_LOG
Definition
Logging.h:165
armarx::PickAndPlaceGroup
Definition
PickAndPlace.h:36
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::flush
const LogSender::manipulator flush
Definition
LogSender.h:251
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContextProperties
Definition
PickAndPlaceGroupStatechartContext.h:51
RobotSkillTemplates
statecharts
deprecated
PickAndPlaceGroup
PickAndPlaceGroupStatechartContext.cpp
Generated by
1.13.2