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 
26 
29 
33 
34 #include <SimoxUtility/algorithm/string/string_tools.h>
35 
36 using namespace armarx;
37 
38 namespace armarx::HandGroup
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 
48  const std::string handUnitNamesStr = getProperty<std::string>("HandUnitNames").getValue();
49  handUnitNames = simox::alg::split(handUnitNamesStr, ",");
50 
51  for (std::string handUnitName : handUnitNames)
52  {
53  usingProxy(handUnitName);
54  }
55  }
56 
57 
59  {
60 
61  // retrieve proxies
62  robotStateComponent = getProxy<RobotStateComponentInterfacePrx>(getProperty<std::string>("RobotStateComponentName").getValue());
63  // kinematicUnitPrx = getProxy<KinematicUnitInterfacePrx>(getProperty<std::string>("KinematicUnitName").getValue());
64  // kinematicUnitObserverPrx = getProxy<KinematicUnitObserverInterfacePrx>(getProperty<std::string>("KinematicUnitObserverName").getValue());
65  // tcpControlPrx = getProxy<TCPControlUnitInterfacePrx>(getProperty<std::string>("TCPControlUnitName").getValue());
66 
67  // initialize remote robot
68  remoteRobot.reset(new RemoteRobot(robotStateComponent->getSynchronizedRobot()));
69 
70  for (std::string handUnitName : handUnitNames)
71  {
72  HandUnitInterfacePrx prx = getProxy<HandUnitInterfacePrx>(handUnitName);
73  handUnits.insert(std::make_pair(prx->getHandName(), prx));
74  }
75  }
76 
77  PropertyDefinitionsPtr HandGroupStatechartContext::createPropertyDefinitions()
78  {
81  }
82 }
83 
84 
RemoteRobot.h
Pose.h
Statechart.h
HandGroupStatechartContext.h
armarx::HandGroup::HandGroupStatechartContext::onConnectStatechartContext
void onConnectStatechartContext() override
onConnectStatechartContext can be implemented by subclasses
Definition: HandGroupStatechartContext.cpp:58
Component.h
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
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::HandGroup::HandGroupStatechartContextProperties
Definition: HandGroupStatechartContext.h:46
armarx::HandGroup::HandGroupStatechartContext::onInitStatechartContext
void onInitStatechartContext() override
onInitStatechartonInitStatechartContext can be implemented by subclasses
Definition: HandGroupStatechartContext.cpp:40
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
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
armarx::HandGroup
Definition: CloseHand.h:29
armarx::split
std::vector< std::string > split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelpers.cpp:36
ImportExportComponent.h