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
31 LocalizeObject::SubClassRegistry LocalizeObject::Registry(LocalizeObject::GetName(),
33 
36 {
37 }
38 
39 void
41 {
42  Literal objectLocalizedLiteral(
43  getInput<ChannelRef>("objectChannel")->getDataFieldIdentifier("localized"),
44  "equals",
46  Literal markerLocalizedLiteral(
47  getInput<ChannelRef>("markerChannel")->getDataFieldIdentifier("localized"),
48  "equals",
50  Term objectAndMarkerLocalized = objectLocalizedLiteral && markerLocalizedLiteral;
52  installCondition(objectAndMarkerLocalized, createEvent<EvObjectsLocalized>());
53 
54  //DEBUG: does the above not work because of the working memory error or because some call/variable is missing?
55  sendEvent<EvObjectsLocalized>();
56 
57  ARMARX_VERBOSE << "Done LocalizeObject::onEnter()" << flush;
58 }
59 
60 void
62 {
64 }
65 
66 // DO NOT EDIT NEXT FUNCTION
67 std::string
69 {
70  return "LocalizeObject";
71 }
72 
73 // DO NOT EDIT NEXT FUNCTION
76 {
77  return XMLStateFactoryBasePtr(new LocalizeObject(stateData));
78 }
armarx::FindAndGraspObjectGroup::LocalizeObject::LocalizeObject
LocalizeObject(XMLStateConstructorParams stateData)
Definition: LocalizeObject.cpp:34
armarx::StateUtility::removeCondition
void removeCondition(ConditionIdentifier conditionId)
Utility function to remove an installed condition on the distributed conditionhandler.
Definition: StateUtil.cpp:148
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:187
armarx::XMLStateConstructorParams
Definition: XMLState.h:49
armarx::Literal::createParameterList
static VarList createParameterList()
Static helper method to create an empty parameterlist.
Definition: Term.cpp:142
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
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::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:102
LocalizeObject.h
armarx::FindAndGraspObjectGroup::LocalizeObject
Definition: LocalizeObject.h:35
armarx::FindAndGraspObjectGroup::LocalizeObject::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: LocalizeObject.cpp:75
armarx::Literal
Definition: Term.h:208
armarx::FindAndGraspObjectGroup::LocalizeObject::objectsLocalized
ConditionIdentifier objectsLocalized
Definition: LocalizeObject.h:54
armarx::FindAndGraspObjectGroup::LocalizeObject::GetName
static std::string GetName()
Definition: LocalizeObject.cpp:68
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:61
armarx::FindAndGraspObjectGroup::LocalizeObject::Registry
static SubClassRegistry Registry
Definition: LocalizeObject.h:49
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27