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
30using namespace armarx;
31using namespace VisualServoGroup;
32
33
34// DO NOT EDIT NEXT LINE
35LookBetweenHandAndObject::SubClassRegistry
38
43
44void
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
77}
78
79void
81{
82 // put your user code for the breaking point here
83 // execution time should be short (<100ms)
84}
85
86void
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
94std::string
96{
97 return "LookBetweenHandAndObject";
98}
99
100// DO NOT EDIT NEXT FUNCTION
void sendEvent(const EventPtr event, StateBasePtr eventProcessor=nullptr)
Function to send an event to a specific state from an onEnter()-function. Must not be called anywhere...
Definition StateUtil.cpp:40
void onBreak() override
Virtual function, in which the behaviour of state is defined, when it is abnormally exited....
void onEnter() override
Virtual function, in which the behaviour of state is defined, when it is entered. Can be overridden,...
void onExit() override
Virtual function, in which the behaviour of state is defined, when it is exited. Can be overridden,...
LookBetweenHandAndObject(XMLStateConstructorParams stateData)
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
XMLStateTemplate(const XMLStateConstructorParams &params)
Definition XMLState.h:149
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition XMLState.h:64