PickAndPlaceGroupStatechartContext.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::PickAndPlaceGroup
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 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
35 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
36 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
37 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
38 #include <RobotAPI/interface/units/TCPControlUnit.h>
39 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
40 #include <RobotAPI/interface/units/ForceTorqueUnit.h>
41 #include <RobotAPI/interface/units/HeadIKUnit.h>
42 #include <RobotAPI/interface/core/RobotState.h>
43 //#include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
44 #include <VirtualRobot/VirtualRobot.h>
45 
46 
47 
49 {
50 
52  {
55  {
56  defineOptionalProperty<std::string>("KinematicUnitName", "Name of the kinematic unit that should be used");
57  defineOptionalProperty<std::string>("KinematicUnitObserverName", "Name of the kinematic unit observer that should be used");
58  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the robot state component that should be used");
59  defineOptionalProperty<std::string>("TCPControlUnitName", "TCPControlUnit", "Name of the tcp control unit component that should be used");
60  //defineOptionalProperty<std::string>("TCPControlUnitObserverName", "TCPControlUnitObserver", "Name of the tcp control unit observer that should be used");
61  //defineOptionalProperty<std::string>("ForceTorqueUnitName", "ForceTorqueUnit", "Name of the force torque unit component that should be used");
62  defineOptionalProperty<std::string>("ForceTorqueObserverName", "ForceTorqueObserver", "Name of the force torque observer that should be used");
63  //defineOptionalProperty<std::string>("SimulatorName", "Simulator", "Name of the simulator component that should be used");
64  defineOptionalProperty<std::string>("HeadIKUnitName", "HeadIKUnit", "Name of the head unit that should be used.");
65  defineOptionalProperty<std::string>("HeadIKKinematicChainName", "", "Name of the inematic chain that should be used for head IK.");
66  defineOptionalProperty<std::string>("WorkingMemoryName", "WorkingMemory", "Name of the WorkingMemory component that should be used");
67  defineOptionalProperty<std::string>("ObjectMemoryObserverName", "ObjectMemoryObserver", "Name of the ObjectMemoryObserver component that should be used");
68  defineOptionalProperty<std::string>("PriorKnowledgeName", "PriorKnowledge", "Name of the PriorKnowledge component that should be used");
69  }
70  };
71 
72  /**
73  * @class PickAndPlaceGroupStatechartContext is a custom implementation of the StatechartContext
74  * for a statechart
75  */
77  virtual public XMLStatechartContext
78  {
79  public:
80  // inherited from Component
81  virtual std::string getDefaultName()
82  {
83  return "PickAndPlaceGroupStatechartContext";
84  }
85  virtual void onInitStatechartContext();
86  virtual void onConnectStatechartContext();
87 
88 
90  {
91  return remoteRobot;
92  }
94  {
95  return robotStateComponent;
96  }
97  KinematicUnitInterfacePrx getKinematicUnit()
98  {
99  return kinematicUnitPrx;
100  }
102  {
103  return getProperty<std::string>("KinematicUnitObserverName").getValue();
104  }
105  TCPControlUnitInterfacePrx getTCPControlUnit()
106  {
107  return tcpControlPrx;
108  }
109  //std::string getTCPControlUnitObserverName() { return getProperty<std::string>("TCPControlUnitObserverName").getValue(); }
110  //ForceTorqueUnitInterfacePrx getForceTorqueUnit() { return ftUnitPrx;}
111  ForceTorqueUnitObserverInterfacePrx getForceTorqueUnitObserver()
112  {
113  return ftUnitObserverPrx;
114  }
116  {
117  return getProperty<std::string>("ForceTorqueObserverName").getValue();
118  }
119  //SimulatorInterfacePrx getSimulatorUnit(){ return simulatorProxy;}
120  HeadIKUnitInterfacePrx getHeadIKUnit()
121  {
122  return headIKUnitPrx;
123  }
125  {
126  return headIKKinematicChainName;
127  }
128  memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
129  {
130  return workingMemoryProxy;
131  }
132  memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
133  {
134  return objectMemoryObserverProxy;
135  }
136  memoryx::PriorKnowledgeInterfacePrx getPriorKnowledgeProxy()
137  {
138  return priorKnowledgeProxy;
139  }
140 
141  private:
142 
143 
144  /**
145  * @see PropertyUser::createPropertyDefinitions()
146  */
147  virtual PropertyDefinitionsPtr createPropertyDefinitions();
148 
149 
150  RobotStateComponentInterfacePrx robotStateComponent;
151  KinematicUnitInterfacePrx kinematicUnitPrx;
152  KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
153  TCPControlUnitInterfacePrx tcpControlPrx;
154  //TCPControlUnitObserverInterfacePrx tcpControlUnitObserverPrx;
155  //ForceTorqueUnitInterfacePrx ftUnitPrx;
156  ForceTorqueUnitObserverInterfacePrx ftUnitObserverPrx;
157  VirtualRobot::RobotPtr remoteRobot;
158  memoryx::WorkingMemoryInterfacePrx workingMemoryProxy;
159  memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserverProxy;
160  memoryx::PriorKnowledgeInterfacePrx priorKnowledgeProxy;
161  //SimulatorInterfacePrx simulatorProxy;
162  HeadIKUnitInterfacePrx headIKUnitPrx;
163  std::string headIKKinematicChainName;
164  std::string headIKUnitName;
165  };
166 
167 }
168 
169 
armarx::XMLStatechartContext
Definition: StatechartContext.h:196
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getWorkingMemoryProxy
memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
Definition: PickAndPlaceGroupStatechartContext.h:128
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getPriorKnowledgeProxy
memoryx::PriorKnowledgeInterfacePrx getPriorKnowledgeProxy()
Definition: PickAndPlaceGroupStatechartContext.h:136
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getObjectMemoryObserverProxy
memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
Definition: PickAndPlaceGroupStatechartContext.h:132
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::PickAndPlaceGroup
Definition: PickAndPlace.h:32
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getHeadIKUnit
HeadIKUnitInterfacePrx getHeadIKUnit()
Definition: PickAndPlaceGroupStatechartContext.h:120
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext
Definition: PickAndPlaceGroupStatechartContext.h:76
StatechartContext.h
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getForceTorqueUnitObserver
ForceTorqueUnitObserverInterfacePrx getForceTorqueUnitObserver()
Definition: PickAndPlaceGroupStatechartContext.h:111
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getKinematicUnitObserverName
std::string getKinematicUnitObserverName()
Definition: PickAndPlaceGroupStatechartContext.h:101
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getKinematicUnit
KinematicUnitInterfacePrx getKinematicUnit()
Definition: PickAndPlaceGroupStatechartContext.h:97
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getDefaultName
virtual std::string getDefaultName()
Definition: PickAndPlaceGroupStatechartContext.h:81
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getRobotStateComponent
RobotStateComponentInterfacePrx getRobotStateComponent()
Definition: PickAndPlaceGroupStatechartContext.h:93
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContextProperties::PickAndPlaceGroupStatechartContextProperties
PickAndPlaceGroupStatechartContextProperties(std::string prefix)
Definition: PickAndPlaceGroupStatechartContext.h:53
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getForceTorqueObserverName
std::string getForceTorqueObserverName()
Definition: PickAndPlaceGroupStatechartContext.h:115
Component.h
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getHeadIKKinematicChainName
std::string getHeadIKKinematicChainName()
Definition: PickAndPlaceGroupStatechartContext.h:124
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getTCPControlUnit
TCPControlUnitInterfacePrx getTCPControlUnit()
Definition: PickAndPlaceGroupStatechartContext.h:105
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContextProperties
Definition: PickAndPlaceGroupStatechartContext.h:51
armarx::PickAndPlaceGroup::PickAndPlaceGroupStatechartContext::getRobot
const VirtualRobot::RobotPtr getRobot()
Definition: PickAndPlaceGroupStatechartContext.h:89
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
ImportExportComponent.h