CloseHand.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 2015
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #include "CloseHand.h"
27 
29 
30 using namespace armarx;
31 using namespace HandGroup;
32 
33 // DO NOT EDIT NEXT LINE
34 CloseHand::SubClassRegistry CloseHand::Registry(CloseHand::GetName(), &CloseHand::CreateInstance);
35 
36 
37 
39  XMLStateTemplate<CloseHand>(stateData), CloseHandGeneratedBase<CloseHand>(stateData)
40 {
41 }
42 
44 {
45  HandUnitInterfacePrx handUnit = getContext<HandGroupStatechartContext>()->getHandUnit(in.getHandName());
46  handUnit->setShape(in.getShapeName());
47 
48  // Fix for hand sometimes not closing?
50  handUnit->setShape(in.getShapeName());
51 
52  setTimeoutEvent(in.getWaitTimeMs(), this->createEventDone());
53 }
54 
56 {
57  // nop
58 }
59 
61 {
62  // nop
63 }
64 
66 {
67  // nop
68 }
69 
70 
71 // DO NOT EDIT NEXT FUNCTION
73 {
74  return XMLStateFactoryBasePtr(new CloseHand(stateData));
75 }
76 
armarx::HandGroup::CloseHand::onEnter
void onEnter() override
Definition: CloseHand.cpp:43
armarx::core::time::Clock::WaitFor
static void WaitFor(const Duration &duration)
Wait for a certain duration on the virtual clock.
Definition: Clock.cpp:104
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
CloseHand.h
Clock.h
HandGroupStatechartContext.h
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::HandGroup::CloseHand::run
void run() override
Definition: CloseHand.cpp:55
armarx::XMLStateTemplate
Class for legacy to stay compatible with old statecharts.
Definition: XMLState.h:137
armarx::HandGroup::CloseHand::CloseHand
CloseHand(const XMLStateConstructorParams &stateData)
Definition: CloseHand.cpp:38
armarx::HandGroup::CloseHand::onBreak
void onBreak() override
Definition: CloseHand.cpp:60
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:65
armarx::HandGroup::CloseHand
Definition: CloseHand.h:31
armarx::HandGroup::CloseHand::onExit
void onExit() override
Definition: CloseHand.cpp:65
armarx::HandGroup::CloseHand::Registry
static SubClassRegistry Registry
Definition: CloseHand.h:45
armarx::HandGroup::CloseHand::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: CloseHand.cpp:72
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition: Duration.cpp:55