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 <RobotAPI/interface/units/KinematicUnitInterface.h>
36 #include <RobotAPI/interface/units/TCPControlUnit.h>
37 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
38 #include <RobotAPI/interface/core/RobotState.h>
40 #include <RobotAPI/interface/units/PlatformUnitInterface.h>
41 #include <RobotAPI/interface/observers/PlatformUnitObserverInterface.h>
44 
45 #include <VirtualRobot/VirtualRobot.h>
46 
47 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
48 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
49 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
53 #include <RobotAPI/interface/components/ViewSelectionInterface.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", "Name of the kinematic unit that should be used");
70  defineRequiredProperty<std::string>("KinematicUnitObserverName", "Name of the kinematic unit observer that should be used");
71  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the robot state component that should be used");
72  defineOptionalProperty<std::string>("TCPControlUnitName", "TCPControlUnit", "Name of the tcp control unit component that should be used");
73  defineOptionalProperty<std::string>("WorkingMemoryName", "WorkingMemory", "Name of the WorkingMemory component that should be used");
74  defineOptionalProperty<std::string>("ObjectMemoryObserverName", "ObjectMemoryObserver", "Name of the ObjectMemoryObserver component that should be used");
75  defineOptionalProperty<std::string>("PriorKnowledgeName", "PriorKnowledge", "Name of the PriorKnowledge component that should be used");
76  defineOptionalProperty<std::string>("PlatformUnitName", "PlatformUnitDynamicSimulation", "Name of the PlatformUnit to use");
77  defineOptionalProperty<std::string>("PlatformUnitObserverName", "PlatformUnitObserver", "Name of the PlatformUnitObserver to use");
78  defineOptionalProperty<std::string>("ForceTorqueObserverName", "ForceTorqueObserver", "Name of the ForceTorqueObserver to use");
79  defineOptionalProperty<std::string>("TCPControlUnitObserverName", "TCPControlUnitObserver", "Name of the tcp control unit observer that should be used");
80  defineOptionalProperty<std::string>("ViewSelectionName", "ViewSelection", "Name of the ViewSelection component that should be used");
81  }
82  };
83 
84  /**
85  * @class CoupledInteractionGroupStatechartContext is a custom implementation of the StatechartContext
86  * for a statechart
87  */
89  virtual public XMLStatechartContext
90  {
91  public:
92  // inherited from Component
93  std::string getDefaultName() const override
94  {
95  return "CoupledInteractionGroupStatechartContext";
96  }
97  void onInitStatechartContext() override;
98  void onConnectStatechartContext() override;
99 
100 
102  {
103  return remoteRobot;
104  }
106  {
107  return robotStateComponent;
108  }
109  KinematicUnitInterfacePrx getKinematicUnit()
110  {
111  return kinematicUnitPrx;
112  }
114  {
115  return getProperty<std::string>("KinematicUnitObserverName").getValue();
116  }
117  TCPControlUnitInterfacePrx getTCPControlUnit()
118  {
119  return tcpControlPrx;
120  }
121  TCPControlUnitObserverInterfacePrx getTCPControlUnitObserver()
122  {
123  return tcpControlUnitObserverPrx;
124  }
125  memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
126  {
127  return workingMemoryProxy;
128  }
129  memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
130  {
131  return objectMemoryObserverProxy;
132  }
133  memoryx::PriorKnowledgeInterfacePrx getPriorKnowledgeProxy()
134  {
135  return priorKnowledgeProxy;
136  }
137  PlatformUnitInterfacePrx getPlatformUnitProxy()
138  {
139  return platformUnitPrx;
140  }
141  PlatformUnitObserverInterfacePrx getPlatformUnitObserverProxy()
142  {
143  return platformUnitObserverPrx;
144  }
145 
147  {
148  return debugDrawerTopicProxy;
149  }
150  //SimulatorInterfacePrx getSimulatorProxy() { return simulatorPrx; }
151 
153  {
154  return platformUnitObserverName;
155  }
156  Eigen::Matrix4f getRobotPose();
157  ViewSelectionInterfacePrx getViewSelection()
158  {
159  return viewSelectionProxy;
160  }
161  ForceTorqueUnitObserverInterfacePrx getForceTorqueUnitObserver()
162  {
163  return ftUnitObserverPrx;
164  }
165  //SimpleLocationInterfacePrx getSimpleLocation() { return simpleLocationPrx;}
167  {
168  return getProperty<std::string>("ForceTorqueObserverName").getValue();
169  }
170  private:
171 
172 
173  /**
174  * @see PropertyUser::createPropertyDefinitions()
175  */
176  PropertyDefinitionsPtr createPropertyDefinitions() override;
177 
178 
179  RobotStateComponentInterfacePrx robotStateComponent;
180  KinematicUnitInterfacePrx kinematicUnitPrx;
181  KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
182  TCPControlUnitInterfacePrx tcpControlPrx;
183  TCPControlUnitObserverInterfacePrx tcpControlUnitObserverPrx;
184  VirtualRobot::RobotPtr remoteRobot;
185 
186  memoryx::WorkingMemoryInterfacePrx workingMemoryProxy;
187  memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserverProxy;
188  memoryx::PriorKnowledgeInterfacePrx priorKnowledgeProxy;
189 
190  //SimulatorInterfacePrx simulatorPrx;
191  armarx::DebugDrawerInterfacePrx debugDrawerTopicProxy;
192  ViewSelectionInterfacePrx viewSelectionProxy;
194  PlatformUnitInterfacePrx platformUnitPrx;
195  PlatformUnitObserverInterfacePrx platformUnitObserverPrx;
196  std::string platformUnitName;
197  std::string platformUnitObserverName;
198  //SimpleLocationInterfacePrx simpleLocationPrx;
199  ForceTorqueUnitObserverInterfacePrx ftUnitObserverPrx;
200  };
201 
202 }
203 
204 
DebugDrawerComponent.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getObjectMemoryObserverProxy
memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
Definition: CoupledInteractionGroupStatechartContext.h:129
RemoteRobot.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getKinematicUnitObserverName
std::string getKinematicUnitObserverName()
Definition: CoupledInteractionGroupStatechartContext.h:113
armarx::XMLStatechartContext
Definition: StatechartContext.h:196
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getPlatformUnitProxy
PlatformUnitInterfacePrx getPlatformUnitProxy()
Definition: CoupledInteractionGroupStatechartContext.h:137
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getDebugDrawerTopicProxy
armarx::DebugDrawerInterfacePrx getDebugDrawerTopicProxy()
Definition: CoupledInteractionGroupStatechartContext.h:146
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getRobotStateComponent
RobotStateComponentInterfacePrx getRobotStateComponent()
Definition: CoupledInteractionGroupStatechartContext.h:105
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getForceTorqueUnitObserver
ForceTorqueUnitObserverInterfacePrx getForceTorqueUnitObserver()
Definition: CoupledInteractionGroupStatechartContext.h:161
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getPriorKnowledgeProxy
memoryx::PriorKnowledgeInterfacePrx getPriorKnowledgeProxy()
Definition: CoupledInteractionGroupStatechartContext.h:133
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
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:93
StatechartContext.h
IceInternal::Handle< AgentInstance >
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getRobot
const VirtualRobot::RobotPtr getRobot()
Definition: CoupledInteractionGroupStatechartContext.h:101
DatafieldRef.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getPlatformUnitObserverName
std::string getPlatformUnitObserverName()
Definition: CoupledInteractionGroupStatechartContext.h:152
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getPlatformUnitObserverProxy
PlatformUnitObserverInterfacePrx getPlatformUnitObserverProxy()
Definition: CoupledInteractionGroupStatechartContext.h:141
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContextProperties
Definition: CoupledInteractionGroupStatechartContext.h:60
MemoryXCoreObjectFactories.h
Component.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getKinematicUnit
KinematicUnitInterfacePrx getKinematicUnit()
Definition: CoupledInteractionGroupStatechartContext.h:109
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getWorkingMemoryProxy
memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
Definition: CoupledInteractionGroupStatechartContext.h:125
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getTCPControlUnit
TCPControlUnitInterfacePrx getTCPControlUnit()
Definition: CoupledInteractionGroupStatechartContext.h:117
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext
Definition: CoupledInteractionGroupStatechartContext.h:88
MemoryXTypesObjectFactories.h
AgentInstance.h
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getViewSelection
ViewSelectionInterfacePrx getViewSelection()
Definition: CoupledInteractionGroupStatechartContext.h:157
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getTCPControlUnitObserver
TCPControlUnitObserverInterfacePrx getTCPControlUnitObserver()
Definition: CoupledInteractionGroupStatechartContext.h:121
armarx::CoupledInteractionGroup
Definition: CalculateApproachTablePose.h:31
armarx::CoupledInteractionGroup::CoupledInteractionGroupStatechartContext::getForceTorqueObserverName
std::string getForceTorqueObserverName()
Definition: CoupledInteractionGroupStatechartContext.h:166
armarx::StatechartContextPropertyDefinitions
The StatechartContextPropertyDefinitions class contains properties associated with all statecharts.
Definition: StatechartContext.h:58
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
ForceTorqueObserver.h
ImportExportComponent.h