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
27using namespace armarx;
28using namespace FindAndGraspObjectGroup;
29
30// DO NOT EDIT NEXT LINE
31LocalizeObject::SubClassRegistry LocalizeObject::Registry(LocalizeObject::GetName(),
33
38
39void
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?
56
57 ARMARX_VERBOSE << "Done LocalizeObject::onEnter()" << flush;
58}
59
60void
65
66// DO NOT EDIT NEXT FUNCTION
67std::string
69{
70 return "LocalizeObject";
71}
72
73// DO NOT EDIT NEXT FUNCTION
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,...
LocalizeObject(XMLStateConstructorParams stateData)
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Literals are part of the user front end of the ArmarX condition mechanism.
Definition Term.h:209
static VarList createParameterList()
Static helper method to create an empty parameterlist.
Definition Term.cpp:142
void removeCondition(ConditionIdentifier conditionId)
Utility function to remove an installed condition on the distributed conditionhandler.
EventPtr createEvent()
Utility function to create a new Event.
Definition StateUtil.h:63
ConditionIdentifier installCondition(const Term &condition, const EventPtr evt, const std::string &desc="")
Utility function to install a condition on the distributed conditionhandler.
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
std::enable_if_t< std::is_base_of_v< VariantDataClass, T >, IceInternal::Handle< T > > getInput(const std::string &key) const
getInput can be used to access a specific input parameter.
Definition State.h:620
Terms are part of the user front end of the ArmarX condition mechanism.
Definition Term.h:112
XMLStateTemplate(const XMLStateConstructorParams &params)
Definition XMLState.h:149
#define ARMARX_VERBOSE
The logging level for verbose information.
Definition Logging.h:187
This file offers overloads of toIce() and fromIce() functions for STL container types.
const LogSender::manipulator flush
Definition LogSender.h:251
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition XMLState.h:64