GetLocalizationStatus.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package RobotSkillTemplates::ObjectLocalization
17  * @author Markus Grotz ( markus dot grotz at kit dot edu )
18  * @date 2016
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "GetLocalizationStatus.h"
24 
25 
29 
30 using namespace armarx;
31 using namespace ObjectLocalization;
32 
33 // DO NOT EDIT NEXT LINE
34 GetLocalizationStatus::SubClassRegistry GetLocalizationStatus::Registry(GetLocalizationStatus::GetName(), &GetLocalizationStatus::CreateInstance);
35 
36 
37 
39 {
40  const memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserver = getObjectMemoryObserver();
41  std::map<std::string, armarx::ChannelRegistryEntry> channels = objectMemoryObserver->getAvailableChannels(false);
42 
43  for (auto& channel : channels)
44  {
45  if (channel.first.find("_query_"))
46  {
47  if (channel.first.find(in.getObjectName()) != std::string::npos)
48  {
49  emitObjectRequested();
50  return;
51  }
52  }
53  }
54  emitObjectNotRequested();
55 }
56 
57 //void GetLocalizationStatus::run()
58 //{
59 // // put your user code for the execution-phase here
60 // // runs in seperate thread, thus can do complex operations
61 // // should check constantly whether isRunningTaskStopped() returns true
62 //
63 //// uncomment this if you need a continous run function. Make sure to use sleep or use blocking wait to reduce cpu load.
64 // while (!isRunningTaskStopped()) // stop run function if returning true
65 // {
66 // // do your calculations
67 // }
68 //}
69 
70 //void GetLocalizationStatus::onBreak()
71 //{
72 // // put your user code for the breaking point here
73 // // execution time should be short (<100ms)
74 //}
75 
77 {
78  // put your user code for the exit point here
79  // execution time should be short (<100ms)
80 }
81 
82 
83 // DO NOT EDIT NEXT FUNCTION
85 {
86  return XMLStateFactoryBasePtr(new GetLocalizationStatus(stateData));
87 }
88 
armarx::ObjectLocalization::GetLocalizationStatus::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: GetLocalizationStatus.cpp:84
armarx::ObjectLocalization::GetLocalizationStatus::Registry
static SubClassRegistry Registry
Definition: GetLocalizationStatus.h:46
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
armarx::ObjectLocalization::GetLocalizationStatus::GetLocalizationStatus
GetLocalizationStatus(const XMLStateConstructorParams &stateData)
Definition: GetLocalizationStatus.h:33
IceInternal::Handle
Definition: forward_declarations.h:8
MemoryXCoreObjectFactories.h
armarx::ObjectLocalization::GetLocalizationStatus::onEnter
void onEnter() override
Definition: GetLocalizationStatus.cpp:38
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:65
Entity.h
MemoryXTypesObjectFactories.h
armarx::ObjectLocalization::GetLocalizationStatus::onExit
void onExit() override
Definition: GetLocalizationStatus.cpp:76
GetLocalizationStatus.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28