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 
34 
35 
36 namespace armarx
37 {
38  namespace PickAndPlaceGroup
39  {
41  {
42  // Register dependencies
43  usingProxy(getProperty<std::string>("KinematicUnitName").getValue());
44  usingProxy(getProperty<std::string>("KinematicUnitObserverName").getValue());
45  usingProxy(getProperty<std::string>("RobotStateComponentName").getValue());
46  usingProxy(getProperty<std::string>("TCPControlUnitName").getValue());
47  // usingProxy(getProperty<std::string>("TCPControlUnitObserverName").getValue());
48  //usingProxy(getProperty<std::string>("ForceTorqueUnitName").getValue());
49  usingProxy(getProperty<std::string>("ForceTorqueObserverName").getValue());
50  usingProxy(getProperty<std::string>("WorkingMemoryName").getValue());
51  usingProxy(getProperty<std::string>("ObjectMemoryObserverName").getValue());
52  usingProxy(getProperty<std::string>("PriorKnowledgeName").getValue());
53  /*std::string simPrxName = getProperty<std::string>("SimulatorName").getValue();
54  if (!simPrxName.empty())
55  {
56  usingProxy(simPrxName);
57  }*/
58  headIKUnitName = getProperty<std::string>("HeadIKUnitName").getValue();
59  ARMARX_LOG << eINFO << "headIKUnitName:" << headIKUnitName << flush;
60  headIKKinematicChainName = getProperty<std::string>("HeadIKKinematicChainName").getValue();
61 
62  if (!headIKUnitName.empty())
63  {
64  usingProxy(headIKUnitName);
65  }
66  }
67 
68 
70  {
71 
72  // retrieve proxies
73  robotStateComponent = getProxy<RobotStateComponentInterfacePrx>(getProperty<std::string>("RobotStateComponentName").getValue());
74  kinematicUnitPrx = getProxy<KinematicUnitInterfacePrx>(getProperty<std::string>("KinematicUnitName").getValue());
75  kinematicUnitObserverPrx = getProxy<KinematicUnitObserverInterfacePrx>(getProperty<std::string>("KinematicUnitObserverName").getValue());
76  tcpControlPrx = getProxy<TCPControlUnitInterfacePrx>(getProperty<std::string>("TCPControlUnitName").getValue());
77  //tcpControlUnitObserverPrx = getProxy<TCPControlUnitObserverInterfacePrx>(getProperty<std::string>("TCPControlUnitObserverName").getValue());
78  //ftUnitPrx = getProxy<ForceTorqueUnitInterfacePrx>(getProperty<std::string>("ForceTorqueUnitName").getValue());
79  ftUnitObserverPrx = getProxy<ForceTorqueUnitObserverInterfacePrx>(getProperty<std::string>("ForceTorqueObserverName").getValue());
80  //simulatorProxy = getProxy<SimulatorInterfacePrx>(getProperty<std::string>("SimulatorName").getValue());
81  workingMemoryProxy = getProxy<memoryx::WorkingMemoryInterfacePrx>(getProperty<std::string>("WorkingMemoryName").getValue());
82  objectMemoryObserverProxy = getProxy<memoryx::ObjectMemoryObserverInterfacePrx>(getProperty<std::string>("ObjectMemoryObserverName").getValue());
83  priorKnowledgeProxy = getProxy<memoryx::PriorKnowledgeInterfacePrx>(getProperty<std::string>("PriorKnowledgeName").getValue());
84 
85  if (!headIKUnitName.empty())
86  {
87  headIKUnitPrx = getProxy<HeadIKUnitInterfacePrx>(headIKUnitName);
88  ARMARX_LOG << eINFO << "Fetched headIK proxy " << headIKUnitName << ":" << headIKUnitPrx << ", head IK kin chain:" << headIKKinematicChainName << flush;
89  }
90 
91  // initialize remote robot
92  remoteRobot.reset(new RemoteRobot(robotStateComponent->getSynchronizedRobot()));
93  //simulatorProxy = getProxy<SimulatorInterfacePrx>("Simulator");
94  }
95 
96  PropertyDefinitionsPtr PickAndPlaceGroupStatechartContext::createPropertyDefinitions()
97  {
100  }
101  }
102 
103 
104 }
105 
RemoteRobot.h
Statechart.h
PickAndPlaceGroupStatechartContext.h
armarx::flush
const LogSender::manipulator flush
Definition: LogSender.h:251
ARMARX_LOG
#define ARMARX_LOG
Definition: Logging.h:163
Component.h
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::onConnectStatechartContext
virtual void onConnectStatechartContext()
onConnectStatechartContext can be implemented by subclasses
Definition: PickAndPlaceGroupStatechartContext.cpp:69
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
armarx::RemoteRobot
Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.
Definition: RemoteRobot.h:139
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::onInitStatechartContext
virtual void onInitStatechartContext()
onInitStatechartonInitStatechartContext can be implemented by subclasses
Definition: PickAndPlaceGroupStatechartContext.cpp:40
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContextProperties
Definition: PickAndPlaceGroupStatechartContext.h:51
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:151
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
ImportExportComponent.h