LookBetweenHandAndObject.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::GraspObjectGroup
19  * @author David ( david dot schiebener 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 
27 #include "VisualServoGroupStatechartContext.generated.h"
28 
29 
30 using namespace armarx;
31 using namespace VisualServoGroup;
32 
33 
34 // DO NOT EDIT NEXT LINE
36 
37 
38 
41 {
42 }
43 
44 
45 
47 {
48  // VisualServoGroupStatechartContext* context = getContext<VisualServoGroupStatechartContext>();
49 
50  // FramedPosePtr objectPose = getInput<FramedPose>("TcpTargetPose");
51  // FramedPosePtr handPose = getInput<FramedPose>("HandPose");
52 
53  // Eigen::Vector3f objectPosition, handPosition, viewTarget;
54  // objectPosition << objectPose->position->x, objectPose->position->y, objectPose->position->z;
55  // handPosition << handPose->position->x, handPose->position->y, handPose->position->z;
56  // if (objectPose->frame.compare(handPose->frame) != 0)
57  // {
58  // ARMARX_WARNING << "Hand and object pose are in different frames. Add code here to handle this!";
59  // }
60  // const float interpolationFactor = 0.4f;
61  // viewTarget = interpolationFactor*objectPosition + (1-interpolationFactor)*handPosition;
62 
63  // FramedDirectionPtr viewTargetPositionPtr = new FramedDirection(viewTarget, objectPose->frame, objectPose->agent);
64  // std::string headIKKinematicChainName = getInput<std::string>("HeadIKKinematicChainName");
65 
66  // //context->getHeadIKUnitProxy()->setHeadTarget(headIKKinematicChainName, viewTargetPositionPtr);
67  // FramedPosePtr viewPose = new FramedPose(Eigen::Matrix3f::Identity(), viewTargetPositionPtr->toEigen(),viewTargetPositionPtr->frame, objectPose->agent);
68  // PoseBasePtr globalViewTarget = context->getWorkingMemoryProxy()->getAgentInstancesSegment()->convertToWorldPose("Armar3", viewPose);
69  // context->getDebugDrawerTopicProxy()->setPoseDebugLayerVisu("viewTarget", globalViewTarget);
70 
71 
72  // FramedPosition viewTargetPosition(viewTarget, objectPose->frame);
73  // setLocal("target", viewTargetPosition);
74  // setLocal("jointTargetTolerance", 0.2f);
75  // setLocal("timeoutInMs", 3000);
76 
77  sendEvent<HeadTargetSet>();
78 }
79 
80 
81 
82 
83 
84 
86 {
87  // put your user code for the breaking point here
88  // execution time should be short (<100ms)
89 }
90 
91 
92 
94 {
95  // put your user code for the exit point here
96  // execution time should be short (<100ms)
97 
98 }
99 
100 
101 
102 // DO NOT EDIT NEXT FUNCTION
104 {
105  return "LookBetweenHandAndObject";
106 }
107 
108 
109 
110 // DO NOT EDIT NEXT FUNCTION
112 {
113  return XMLStateFactoryBasePtr(new LookBetweenHandAndObject(stateData));
114 }
115 
armarx::VisualServoGroup::LookBetweenHandAndObject
Definition: LookBetweenHandAndObject.h:33
armarx::VisualServoGroup::LookBetweenHandAndObject::LookBetweenHandAndObject
LookBetweenHandAndObject(XMLStateConstructorParams stateData)
Definition: LookBetweenHandAndObject.cpp:39
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
LookBetweenHandAndObject.h
armarx::VisualServoGroup::LookBetweenHandAndObject::onEnter
void onEnter() override
Virtual function, in which the behaviour of state is defined, when it is entered. Can be overridden,...
Definition: LookBetweenHandAndObject.cpp:46
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::XMLStateTemplate
Class for legacy to stay compatible with old statecharts.
Definition: XMLState.h:137
armarx::VisualServoGroup::LookBetweenHandAndObject::GetName
static std::string GetName()
Definition: LookBetweenHandAndObject.cpp:103
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:65
armarx::VisualServoGroup::LookBetweenHandAndObject::onExit
void onExit() override
Virtual function, in which the behaviour of state is defined, when it is exited. Can be overridden,...
Definition: LookBetweenHandAndObject.cpp:93
armarx::VisualServoGroup::LookBetweenHandAndObject::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: LookBetweenHandAndObject.cpp:111
armarx::VisualServoGroup::LookBetweenHandAndObject::onBreak
void onBreak() override
Virtual function, in which the behaviour of state is defined, when it is abnormally exited....
Definition: LookBetweenHandAndObject.cpp:85
armarx::VisualServoGroup::LookBetweenHandAndObject::Registry
static SubClassRegistry Registry
Definition: LookBetweenHandAndObject.h:48
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28