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
35 LookBetweenHandAndObject::SubClassRegistry
38 
41 {
42 }
43 
44 void
46 {
47  // VisualServoGroupStatechartContext* context = getContext<VisualServoGroupStatechartContext>();
48 
49  // FramedPosePtr objectPose = getInput<FramedPose>("TcpTargetPose");
50  // FramedPosePtr handPose = getInput<FramedPose>("HandPose");
51 
52  // Eigen::Vector3f objectPosition, handPosition, viewTarget;
53  // objectPosition << objectPose->position->x, objectPose->position->y, objectPose->position->z;
54  // handPosition << handPose->position->x, handPose->position->y, handPose->position->z;
55  // if (objectPose->frame.compare(handPose->frame) != 0)
56  // {
57  // ARMARX_WARNING << "Hand and object pose are in different frames. Add code here to handle this!";
58  // }
59  // const float interpolationFactor = 0.4f;
60  // viewTarget = interpolationFactor*objectPosition + (1-interpolationFactor)*handPosition;
61 
62  // FramedDirectionPtr viewTargetPositionPtr = new FramedDirection(viewTarget, objectPose->frame, objectPose->agent);
63  // std::string headIKKinematicChainName = getInput<std::string>("HeadIKKinematicChainName");
64 
65  // //context->getHeadIKUnitProxy()->setHeadTarget(headIKKinematicChainName, viewTargetPositionPtr);
66  // FramedPosePtr viewPose = new FramedPose(Eigen::Matrix3f::Identity(), viewTargetPositionPtr->toEigen(),viewTargetPositionPtr->frame, objectPose->agent);
67  // PoseBasePtr globalViewTarget = context->getWorkingMemoryProxy()->getAgentInstancesSegment()->convertToWorldPose("Armar3", viewPose);
68  // context->getDebugDrawerTopicProxy()->setPoseDebugLayerVisu("viewTarget", globalViewTarget);
69 
70 
71  // FramedPosition viewTargetPosition(viewTarget, objectPose->frame);
72  // setLocal("target", viewTargetPosition);
73  // setLocal("jointTargetTolerance", 0.2f);
74  // setLocal("timeoutInMs", 3000);
75 
76  sendEvent<HeadTargetSet>();
77 }
78 
79 void
81 {
82  // put your user code for the breaking point here
83  // execution time should be short (<100ms)
84 }
85 
86 void
88 {
89  // put your user code for the exit point here
90  // execution time should be short (<100ms)
91 }
92 
93 // DO NOT EDIT NEXT FUNCTION
94 std::string
96 {
97  return "LookBetweenHandAndObject";
98 }
99 
100 // DO NOT EDIT NEXT FUNCTION
103 {
104  return XMLStateFactoryBasePtr(new LookBetweenHandAndObject(stateData));
105 }
armarx::VisualServoGroup::LookBetweenHandAndObject
Definition: LookBetweenHandAndObject.h:33
armarx::VisualServoGroup::LookBetweenHandAndObject::LookBetweenHandAndObject
LookBetweenHandAndObject(XMLStateConstructorParams stateData)
Definition: LookBetweenHandAndObject.cpp:39
armarx::XMLStateConstructorParams
Definition: XMLState.h:49
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:45
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:64
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::XMLStateTemplate
Class for legacy to stay compatible with old statecharts.
Definition: XMLState.h:146
armarx::VisualServoGroup::LookBetweenHandAndObject::GetName
static std::string GetName()
Definition: LookBetweenHandAndObject.cpp:95
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:87
armarx::VisualServoGroup::LookBetweenHandAndObject::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: LookBetweenHandAndObject.cpp:102
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:80
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:27