CoupledInteractionGroupStatechartContext.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::CoupledInteractionGroup
19  * @author [Author Name] ( [Author Email] )
20  * @date 2014
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 // Custom Includes
35 #include <VirtualRobot/VirtualRobot.h>
36 
39 #include <RobotAPI/interface/components/ViewSelectionInterface.h>
40 #include <RobotAPI/interface/core/RobotState.h>
41 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
42 #include <RobotAPI/interface/observers/PlatformUnitObserverInterface.h>
43 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
44 #include <RobotAPI/interface/units/PlatformUnitInterface.h>
45 #include <RobotAPI/interface/units/TCPControlUnit.h>
47 
49 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
50 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
51 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
54 //#include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
56 
58 {
59 
61  {
64  {
65  // defineRequiredProperty<std::string>("KinematicUnitName", "Name of the kinematic unit that should be used");
66  // defineRequiredProperty<std::string>("KinematicUnitObserverName", "Name of the kinematic unit observer that should be used");
67  // defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the robot state component that should be used");
68  // defineOptionalProperty<std::string>("TCPControlUnitName", "TCPControlUnit", "Name of the tcp control unit component that should be used");
69  defineRequiredProperty<std::string>("KinematicUnitName",
70  "Name of the kinematic unit that should be used");
71  defineRequiredProperty<std::string>(
72  "KinematicUnitObserverName",
73  "Name of the kinematic unit observer that should be used");
74  defineOptionalProperty<std::string>(
75  "RobotStateComponentName",
76  "RobotStateComponent",
77  "Name of the robot state component that should be used");
78  defineOptionalProperty<std::string>(
79  "TCPControlUnitName",
80  "TCPControlUnit",
81  "Name of the tcp control unit component that should be used");
82  defineOptionalProperty<std::string>(
83  "WorkingMemoryName",
84  "WorkingMemory",
85  "Name of the WorkingMemory component that should be used");
86  defineOptionalProperty<std::string>(
87  "ObjectMemoryObserverName",
88  "ObjectMemoryObserver",
89  "Name of the ObjectMemoryObserver component that should be used");
90  defineOptionalProperty<std::string>(
91  "PriorKnowledgeName",
92  "PriorKnowledge",
93  "Name of the PriorKnowledge component that should be used");
94  defineOptionalProperty<std::string>("PlatformUnitName",
95  "PlatformUnitDynamicSimulation",
96  "Name of the PlatformUnit to use");
97  defineOptionalProperty<std::string>("PlatformUnitObserverName",
98  "PlatformUnitObserver",
99  "Name of the PlatformUnitObserver to use");
100  defineOptionalProperty<std::string>("ForceTorqueObserverName",
101  "ForceTorqueObserver",
102  "Name of the ForceTorqueObserver to use");
103  defineOptionalProperty<std::string>(
104  "TCPControlUnitObserverName",
105  "TCPControlUnitObserver",
106  "Name of the tcp control unit observer that should be used");
107  defineOptionalProperty<std::string>(
108  "ViewSelectionName",
109  "ViewSelection",
110  "Name of the ViewSelection component that should be used");
111  }
112  };
113 
114  /**
115  * @class CoupledInteractionGroupStatechartContext is a custom implementation of the StatechartContext
116  * for a statechart
117  */
119  virtual public XMLStatechartContext
120  {
121  public:
122  // inherited from Component
123  std::string
124  getDefaultName() const override
125  {
126  return "CoupledInteractionGroupStatechartContext";
127  }
128 
129  void onInitStatechartContext() override;
130  void onConnectStatechartContext() override;
131 
134  {
135  return remoteRobot;
136  }
137 
140  {
141  return robotStateComponent;
142  }
143 
144  KinematicUnitInterfacePrx
146  {
147  return kinematicUnitPrx;
148  }
149 
150  std::string
152  {
153  return getProperty<std::string>("KinematicUnitObserverName").getValue();
154  }
155 
156  TCPControlUnitInterfacePrx
158  {
159  return tcpControlPrx;
160  }
161 
162  TCPControlUnitObserverInterfacePrx
164  {
165  return tcpControlUnitObserverPrx;
166  }
167 
168  memoryx::WorkingMemoryInterfacePrx
170  {
171  return workingMemoryProxy;
172  }
173 
174  memoryx::ObjectMemoryObserverInterfacePrx
176  {
177  return objectMemoryObserverProxy;
178  }
179 
180  memoryx::PriorKnowledgeInterfacePrx
182  {
183  return priorKnowledgeProxy;
184  }
185 
186  PlatformUnitInterfacePrx
188  {
189  return platformUnitPrx;
190  }
191 
192  PlatformUnitObserverInterfacePrx
194  {
195  return platformUnitObserverPrx;
196  }
197 
200  {
201  return debugDrawerTopicProxy;
202  }
203 
204  //SimulatorInterfacePrx getSimulatorProxy() { return simulatorPrx; }
205 
206  std::string
208  {
209  return platformUnitObserverName;
210  }
211 
212  Eigen::Matrix4f getRobotPose();
213 
214  ViewSelectionInterfacePrx
216  {
217  return viewSelectionProxy;
218  }
219 
220  ForceTorqueUnitObserverInterfacePrx
222  {
223  return ftUnitObserverPrx;
224  }
225 
226  //SimpleLocationInterfacePrx getSimpleLocation() { return simpleLocationPrx;}
227  std::string
229  {
230  return getProperty<std::string>("ForceTorqueObserverName").getValue();
231  }
232 
233  private:
234  /**
235  * @see PropertyUser::createPropertyDefinitions()
236  */
237  PropertyDefinitionsPtr createPropertyDefinitions() override;
238 
239 
240  RobotStateComponentInterfacePrx robotStateComponent;
241  KinematicUnitInterfacePrx kinematicUnitPrx;
242  KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
243  TCPControlUnitInterfacePrx tcpControlPrx;
244  TCPControlUnitObserverInterfacePrx tcpControlUnitObserverPrx;
245  VirtualRobot::RobotPtr remoteRobot;
246 
247  memoryx::WorkingMemoryInterfacePrx workingMemoryProxy;
248  memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserverProxy;
249  memoryx::PriorKnowledgeInterfacePrx priorKnowledgeProxy;
250 
251  //SimulatorInterfacePrx simulatorPrx;
252  armarx::DebugDrawerInterfacePrx debugDrawerTopicProxy;
253  ViewSelectionInterfacePrx viewSelectionProxy;
255  PlatformUnitInterfacePrx platformUnitPrx;
256  PlatformUnitObserverInterfacePrx platformUnitObserverPrx;
257  std::string platformUnitName;
258  std::string platformUnitObserverName;
259  //SimpleLocationInterfacePrx simpleLocationPrx;
260  ForceTorqueUnitObserverInterfacePrx ftUnitObserverPrx;
261  };
262 
263 } // namespace armarx::CoupledInteractionGroup
DebugDrawerComponent.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getObjectMemoryObserverProxy
memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
Definition: CoupledInteractionGroupStatechartContext.h:175
RemoteRobot.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getKinematicUnitObserverName
std::string getKinematicUnitObserverName()
Definition: CoupledInteractionGroupStatechartContext.h:151
armarx::XMLStatechartContext
Definition: StatechartContext.h:208
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getPlatformUnitProxy
PlatformUnitInterfacePrx getPlatformUnitProxy()
Definition: CoupledInteractionGroupStatechartContext.h:187
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getDebugDrawerTopicProxy
armarx::DebugDrawerInterfacePrx getDebugDrawerTopicProxy()
Definition: CoupledInteractionGroupStatechartContext.h:199
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getRobotStateComponent
RobotStateComponentInterfacePrx getRobotStateComponent()
Definition: CoupledInteractionGroupStatechartContext.h:139
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getForceTorqueUnitObserver
ForceTorqueUnitObserverInterfacePrx getForceTorqueUnitObserver()
Definition: CoupledInteractionGroupStatechartContext.h:221
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getPriorKnowledgeProxy
memoryx::PriorKnowledgeInterfacePrx getPriorKnowledgeProxy()
Definition: CoupledInteractionGroupStatechartContext.h:181
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContextProperties::CoupledInteractionGroupStatechartContextProperties
CoupledInteractionGroupStatechartContextProperties(std::string prefix)
Definition: CoupledInteractionGroupStatechartContext.h:62
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: CoupledInteractionGroupStatechartContext.h:124
StatechartContext.h
IceInternal::Handle< AgentInstance >
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getRobot
const VirtualRobot::RobotPtr getRobot()
Definition: CoupledInteractionGroupStatechartContext.h:133
DatafieldRef.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getPlatformUnitObserverName
std::string getPlatformUnitObserverName()
Definition: CoupledInteractionGroupStatechartContext.h:207
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getPlatformUnitObserverProxy
PlatformUnitObserverInterfacePrx getPlatformUnitObserverProxy()
Definition: CoupledInteractionGroupStatechartContext.h:193
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContextProperties
Definition: CoupledInteractionGroupStatechartContext.h:60
MemoryXCoreObjectFactories.h
Component.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getKinematicUnit
KinematicUnitInterfacePrx getKinematicUnit()
Definition: CoupledInteractionGroupStatechartContext.h:145
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getWorkingMemoryProxy
memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
Definition: CoupledInteractionGroupStatechartContext.h:169
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getTCPControlUnit
TCPControlUnitInterfacePrx getTCPControlUnit()
Definition: CoupledInteractionGroupStatechartContext.h:157
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext
Definition: CoupledInteractionGroupStatechartContext.h:118
MemoryXTypesObjectFactories.h
AgentInstance.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getViewSelection
ViewSelectionInterfacePrx getViewSelection()
Definition: CoupledInteractionGroupStatechartContext.h:215
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getTCPControlUnitObserver
TCPControlUnitObserverInterfacePrx getTCPControlUnitObserver()
Definition: CoupledInteractionGroupStatechartContext.h:163
armarx::CoupledInteractionGroup
Definition: CalculateApproachTablePose.h:35
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getForceTorqueObserverName
std::string getForceTorqueObserverName()
Definition: CoupledInteractionGroupStatechartContext.h:228
armarx::StatechartContextPropertyDefinitions
The StatechartContextPropertyDefinitions class contains properties associated with all statecharts.
Definition: StatechartContext.h:56
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19
ForceTorqueObserver.h
ImportExportComponent.h