BringObjectGroupStatechartContext.h
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::BringObjectGroup
19  * @author Mirko Waechter ( mirko dot waechter at kit dot edu )
20  * @date 2015
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 
26 #pragma once
27 
31 
32 
33 // Custom Includes
34 //#include <RobotAPI/interface/units/KinematicUnitInterface.h>
35 //#include <RobotAPI/interface/units/TCPControlUnit.h>
36 //#include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
37 #include <VirtualRobot/VirtualRobot.h>
38 
39 #include <RobotAPI/interface/core/FramedPoseBase.h>
40 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
41 
42 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
43 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
44 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
45 //#include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
46 #include <RobotAPI/interface/components/ViewSelectionInterface.h>
47 
48 #include <RobotComponents/interface/components/PathPlanner.h>
49 
51 
53 {
54 
56  {
59  {
60  // defineRequiredProperty<std::string>("KinematicUnitName", "Name of the kinematic unit that should be used");
61  // defineRequiredProperty<std::string>("KinematicUnitObserverName", "Name of the kinematic unit observer that should be used");
62  defineOptionalProperty<std::string>(
63  "RobotStateComponentName",
64  "RobotStateComponent",
65  "Name of the robot state component that should be used");
66  // defineOptionalProperty<std::string>("TCPControlUnitName", "TCPControlUnit", "Name of the tcp control unit component that should be used");
67 
68  defineOptionalProperty<std::string>(
69  "WorkingMemoryName",
70  "WorkingMemory",
71  "Name of the WorkingMemory component that should be used");
72  defineOptionalProperty<std::string>(
73  "ObjectMemoryObserverName",
74  "ObjectMemoryObserver",
75  "Name of the ObjectMemoryObserver component that should be used");
76  defineOptionalProperty<std::string>(
77  "PriorKnowledgeName",
78  "PriorKnowledge",
79  "Name of the PriorKnowledge component that should be used");
80  defineOptionalProperty<std::string>(
81  "PathPlannerName",
82  "PathPlanner",
83  "Name of the Path Planner component that should be used");
84  defineOptionalProperty<std::string>(
85  "ViewSelectionName",
86  "ViewSelection",
87  "Name of the ViewSelection component that should be used");
88  }
89  };
90 
91  /**
92  * @class BringObjectGroupStatechartContext is a custom implementation of the StatechartContext
93  * for a statechart
94  */
96  virtual public XMLStatechartContext
97  {
98  public:
99  // inherited from Component
100  std::string
101  getDefaultName() const override
102  {
103  return "BringObjectGroupStatechartContext";
104  }
105 
106  void onInitStatechartContext() override;
107  void onConnectStatechartContext() override;
108 
109  memoryx::WorkingMemoryInterfacePrx
111  {
112  return workingMemoryProxy;
113  }
114 
115  memoryx::ObjectMemoryObserverInterfacePrx
117  {
118  return objectMemoryObserverProxy;
119  }
120 
121  memoryx::PriorKnowledgeInterfacePrx
123  {
124  return priorKnowledgeProxy;
125  }
126 
129  {
130  return debugDrawerTopicProxy;
131  }
132 
135  {
136  return remoteRobot;
137  }
138 
141  {
142  return robotStateComponent;
143  }
144 
145  // KinematicUnitInterfacePrx getKinematicUnit() { return kinematicUnitPrx; }
146  // std::string getKinematicUnitObserverName() { return getProperty<std::string>("KinematicUnitObserverName").getValue(); }
147  // TCPControlUnitInterfacePrx getTCPControlUnit() { return tcpControlPrx;}
148  //SimulatorInterfacePrx getSimulatorProxy() { return simulatorPrx; }
149  PathPlannerBasePrx
151  {
152  return pathPlannerPrx;
153  }
154 
155  ViewSelectionInterfacePrx
157  {
158  return viewSelection;
159  }
160 
161  private:
162  /**
163  * @see PropertyUser::createPropertyDefinitions()
164  */
165  PropertyDefinitionsPtr createPropertyDefinitions() override;
166 
167 
168  RobotStateComponentInterfacePrx robotStateComponent;
169  // KinematicUnitInterfacePrx kinematicUnitPrx;
170  // KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
171  // TCPControlUnitInterfacePrx tcpControlPrx;
172  VirtualRobot::RobotPtr remoteRobot;
173 
174  memoryx::WorkingMemoryInterfacePrx workingMemoryProxy;
175  memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserverProxy;
176  memoryx::PriorKnowledgeInterfacePrx priorKnowledgeProxy;
177 
178  armarx::DebugDrawerInterfacePrx debugDrawerTopicProxy;
179  //SimulatorInterfacePrx simulatorPrx;
180  PathPlannerBasePrx pathPlannerPrx;
181  ViewSelectionInterfacePrx viewSelection;
182  };
183 
184 } // namespace armarx::BringObjectGroup
armarx::XMLStatechartContext
Definition: StatechartContext.h:208
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
StatechartContext.h
armarx::BringObjectGroup
Definition: BringObjectGroupRemoteStateOfferer.h:31
armarx::BringObjectGroup::BringObjectGroupStatechartContext
Definition: BringObjectGroupStatechartContext.h:95
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getObjectMemoryObserverProxy
memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
Definition: BringObjectGroupStatechartContext.h:116
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getPathPlanner
PathPlannerBasePrx getPathPlanner() const
Definition: BringObjectGroupStatechartContext.h:150
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: BringObjectGroupStatechartContext.h:101
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getWorkingMemoryProxy
memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
Definition: BringObjectGroupStatechartContext.h:110
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getPriorKnowledgeProxy
memoryx::PriorKnowledgeInterfacePrx getPriorKnowledgeProxy()
Definition: BringObjectGroupStatechartContext.h:122
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getRobotStateComponent
RobotStateComponentInterfacePrx getRobotStateComponent()
Definition: BringObjectGroupStatechartContext.h:140
Component.h
armarx::BringObjectGroup::BringObjectGroupStatechartContextProperties::BringObjectGroupStatechartContextProperties
BringObjectGroupStatechartContextProperties(std::string prefix)
Definition: BringObjectGroupStatechartContext.h:57
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getRobot
const VirtualRobot::RobotPtr getRobot()
Definition: BringObjectGroupStatechartContext.h:134
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getViewSelection
ViewSelectionInterfacePrx getViewSelection() const
Definition: BringObjectGroupStatechartContext.h:156
MemoryXUpdaterObjectFactories.h
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getDebugDrawerTopicProxy
armarx::DebugDrawerInterfacePrx getDebugDrawerTopicProxy()
Definition: BringObjectGroupStatechartContext.h:128
armarx::StatechartContextPropertyDefinitions
The StatechartContextPropertyDefinitions class contains properties associated with all statecharts.
Definition: StatechartContext.h:56
armarx::BringObjectGroup::BringObjectGroupStatechartContextProperties
Definition: BringObjectGroupStatechartContext.h:55
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19
ImportExportComponent.h