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
26
28//#include <RobotAPI/libraries/core/Pose.h>
29
33
34namespace armarx
35{
36 namespace PickAndPlaceGroup
37 {
38 void
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
70 {
71
72 // retrieve proxies
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());
80 getProperty<std::string>("TCPControlUnitName").getValue());
81 //tcpControlUnitObserverPrx = getProxy<TCPControlUnitObserverInterfacePrx>(getProperty<std::string>("TCPControlUnitObserverName").getValue());
82 //ftUnitPrx = getProxy<ForceTorqueUnitInterfacePrx>(getProperty<std::string>("ForceTorqueUnitName").getValue());
84 getProperty<std::string>("ForceTorqueObserverName").getValue());
85 //simulatorProxy = getProxy<SimulatorInterfacePrx>(getProperty<std::string>("SimulatorName").getValue());
87 getProperty<std::string>("WorkingMemoryName").getValue());
89 getProperty<std::string>("ObjectMemoryObserverName").getValue());
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
107 PickAndPlaceGroupStatechartContext::createPropertyDefinitions()
108 {
111 }
112 } // namespace PickAndPlaceGroup
113
114
115} // namespace armarx
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
Property< PropertyType > getProperty(const std::string &name)
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)
virtual void onInitStatechartContext()
onInitStatechartonInitStatechartContext can be implemented by subclasses
virtual void onConnectStatechartContext()
onConnectStatechartContext can be implemented by subclasses
Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.
#define ARMARX_LOG
Definition Logging.h:165
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
const LogSender::manipulator flush
Definition LogSender.h:251