LocalizeObject.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::FindAndGraspObjectGroup
19  * @author Valerij Wittenbeck ( valerij dot wittenbeck at student dot kit dot edu )
20  * @date 2014
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #include "LocalizeObject.h"
26 
27 using namespace armarx;
28 using namespace FindAndGraspObjectGroup;
29 
30 // DO NOT EDIT NEXT LINE
32 
33 
34 
36  XMLStateTemplate < LocalizeObject > (stateData)
37 {
38 }
39 
41 {
42  Literal objectLocalizedLiteral(getInput<ChannelRef>("objectChannel")->getDataFieldIdentifier("localized"), "equals", Literal::createParameterList(true));
43  Literal markerLocalizedLiteral(getInput<ChannelRef>("markerChannel")->getDataFieldIdentifier("localized"), "equals", Literal::createParameterList(true));
44  Term objectAndMarkerLocalized = objectLocalizedLiteral && markerLocalizedLiteral;
45  objectsLocalized = installCondition(objectAndMarkerLocalized, createEvent<EvObjectsLocalized>());
46 
47  //DEBUG: does the above not work because of the working memory error or because some call/variable is missing?
48  sendEvent<EvObjectsLocalized>();
49 
50  ARMARX_VERBOSE << "Done LocalizeObject::onEnter()" << flush;
51 }
52 
54 {
56 }
57 
58 // DO NOT EDIT NEXT FUNCTION
60 {
61  return "LocalizeObject";
62 }
63 
64 // DO NOT EDIT NEXT FUNCTION
66 {
67  return XMLStateFactoryBasePtr(new LocalizeObject(stateData));
68 }
69 
armarx::FindAndGraspObjectGroup::LocalizeObject::LocalizeObject
LocalizeObject(XMLStateConstructorParams stateData)
Definition: LocalizeObject.cpp:35
armarx::StateUtility::removeCondition
void removeCondition(ConditionIdentifier conditionId)
Utility function to remove an installed condition on the distributed conditionhandler.
Definition: StateUtil.cpp:131
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
armarx::Literal::createParameterList
static VarList createParameterList()
Static helper method to create an empty parameterlist.
Definition: Term.cpp:129
armarx::Term
Definition: Term.h:111
armarx::FindAndGraspObjectGroup::LocalizeObject::onEnter
void onEnter() override
Virtual function, in which the behaviour of state is defined, when it is entered. Can be overridden,...
Definition: LocalizeObject.cpp:40
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::XMLStateTemplate
Class for legacy to stay compatible with old statecharts.
Definition: XMLState.h:137
armarx::flush
const LogSender::manipulator flush
Definition: LogSender.h:251
armarx::StateUtility::installCondition
ConditionIdentifier installCondition(const Term &condition, const EventPtr evt, const std::string &desc="")
Utility function to install a condition on the distributed conditionhandler.
Definition: StateUtil.cpp:97
LocalizeObject.h
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:65
armarx::FindAndGraspObjectGroup::LocalizeObject
Definition: LocalizeObject.h:33
armarx::FindAndGraspObjectGroup::LocalizeObject::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: LocalizeObject.cpp:65
armarx::Literal
Definition: Term.h:208
armarx::FindAndGraspObjectGroup::LocalizeObject::objectsLocalized
ConditionIdentifier objectsLocalized
Definition: LocalizeObject.h:52
armarx::FindAndGraspObjectGroup::LocalizeObject::GetName
static std::string GetName()
Definition: LocalizeObject.cpp:59
armarx::FindAndGraspObjectGroup::LocalizeObject::onExit
void onExit() override
Virtual function, in which the behaviour of state is defined, when it is exited. Can be overridden,...
Definition: LocalizeObject.cpp:53
armarx::FindAndGraspObjectGroup::LocalizeObject::Registry
static SubClassRegistry Registry
Definition: LocalizeObject.h:47
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28