SelectArmAndGraspObject.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::BringObjectGroup
19  * @author Mirko Waechter ( mirko dot waechter 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 
27 
30 
31 using namespace armarx;
32 using namespace BringObjectGroup;
33 
34 // DO NOT EDIT NEXT LINE
35 SelectArmAndGraspObject::SubClassRegistry SelectArmAndGraspObject::Registry(SelectArmAndGraspObject::GetName(), &SelectArmAndGraspObject::CreateInstance);
36 
37 
38 
40  XMLStateTemplate<SelectArmAndGraspObject>(stateData), SelectArmAndGraspObjectGeneratedBase<SelectArmAndGraspObject>(stateData)
41 {
42 }
43 
45 {
46 
47 
48  BringObjectGroupStatechartContext* c = getContext<BringObjectGroupStatechartContext>();
49  // put your user code for the enter-point here
50  // execution time should be short (<100ms)
51  FramedPositionPtr pos = in.getObjectInstanceChannel()->getDataField("position")->get<FramedPosition>();
52  c->getViewSelection()->addManualViewTarget(pos);
53  TimeUtil::MSSleep(2000);
54 
55  // if(!in.isObjectInstanceChannelSet())
56  // local.setObjectName(in.getObjectInstanceChannel()->getDataField("className")->getString());
57 
58  // get memory channel for the object
59  // std::string objectName = in.getObjectName();
60  // ChannelRefBasePtr objectClassMemoryChannel = c->getObjectMemoryObserverProxy()->requestObjectClassOnce(objectName);
61  // if (objectClassMemoryChannel)
62  // {
63  // local.setObjectClassChannel(ChannelRefPtr::dynamicCast(objectClassMemoryChannel));
64  // }
65  // else
66  // {
67  //// emitFailure();
68  // ARMARX_WARNING << "Unknown Object Class: " << objectName;
69  // }
70 }
71 
72 
73 
74 
75 
77 {
78  // put your user code for the exit point here
79  // execution time should be short (<100ms)
80 
81 
82 }
83 
84 
85 // DO NOT EDIT NEXT FUNCTION
87 {
88  return XMLStateFactoryBasePtr(new SelectArmAndGraspObject(stateData));
89 }
90 
SelectArmAndGraspObject.h
armarx::TimeUtil::MSSleep
static void MSSleep(int durationMS)
lock the calling thread for a given duration (like usleep(...) but using Timeserver time)
Definition: TimeUtil.cpp:94
BringObjectGroupStatechartContext.h
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::BringObjectGroup::SelectArmAndGraspObject
Definition: SelectArmAndGraspObject.h:31
IceInternal::Handle< FramedPosition >
armarx::XMLStateTemplate
Class for legacy to stay compatible with old statecharts.
Definition: XMLState.h:137
armarx::BringObjectGroup::BringObjectGroupStatechartContext
Definition: BringObjectGroupStatechartContext.h:77
FramedPose.h
armarx::FramedPosition
The FramedPosition class.
Definition: FramedPose.h:142
armarx::BringObjectGroup::SelectArmAndGraspObject::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: SelectArmAndGraspObject.cpp:86
armarx::BringObjectGroup::SelectArmAndGraspObject::Registry
static SubClassRegistry Registry
Definition: SelectArmAndGraspObject.h:43
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:65
armarx::BringObjectGroup::SelectArmAndGraspObject::onExit
void onExit() override
Definition: SelectArmAndGraspObject.cpp:76
TimeUtil.h
armarx::BringObjectGroup::SelectArmAndGraspObject::SelectArmAndGraspObject
SelectArmAndGraspObject(XMLStateConstructorParams stateData)
Definition: SelectArmAndGraspObject.cpp:39
armarx::BringObjectGroup::SelectArmAndGraspObject::onEnter
void onEnter() override
Definition: SelectArmAndGraspObject.cpp:44
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28