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 <RobotAPI/interface/core/RobotState.h>
35#include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
36#include <RobotAPI/interface/units/ForceTorqueUnit.h>
37#include <RobotAPI/interface/units/HeadIKUnit.h>
38#include <RobotAPI/interface/units/KinematicUnitInterface.h>
39#include <RobotAPI/interface/units/TCPControlUnit.h>
40
41#include <MemoryX/interface/components/PriorKnowledgeInterface.h>
42#include <MemoryX/interface/components/WorkingMemoryInterface.h>
43#include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
44//#include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
45#include <VirtualRobot/VirtualRobot.h>
46
48{
49
51 {
54 {
55 defineOptionalProperty<std::string>("KinematicUnitName",
56 "Name of the kinematic unit that should be used");
58 "KinematicUnitObserverName",
59 "Name of the kinematic unit observer that should be used");
61 "RobotStateComponentName",
62 "RobotStateComponent",
63 "Name of the robot state component that should be used");
65 "TCPControlUnitName",
66 "TCPControlUnit",
67 "Name of the tcp control unit component that should be used");
68 //defineOptionalProperty<std::string>("TCPControlUnitObserverName", "TCPControlUnitObserver", "Name of the tcp control unit observer that should be used");
69 //defineOptionalProperty<std::string>("ForceTorqueUnitName", "ForceTorqueUnit", "Name of the force torque unit component that should be used");
71 "ForceTorqueObserverName",
72 "ForceTorqueObserver",
73 "Name of the force torque observer that should be used");
74 //defineOptionalProperty<std::string>("SimulatorName", "Simulator", "Name of the simulator component that should be used");
76 "HeadIKUnitName", "HeadIKUnit", "Name of the head unit that should be used.");
78 "HeadIKKinematicChainName",
79 "",
80 "Name of the inematic chain that should be used for head IK.");
82 "WorkingMemoryName",
83 "WorkingMemory",
84 "Name of the WorkingMemory component that should be used");
86 "ObjectMemoryObserverName",
87 "ObjectMemoryObserver",
88 "Name of the ObjectMemoryObserver component that should be used");
90 "PriorKnowledgeName",
91 "PriorKnowledge",
92 "Name of the PriorKnowledge component that should be used");
93 }
94 };
95
96 /**
97 * @class PickAndPlaceGroupStatechartContext is a custom implementation of the StatechartContext
98 * for a statechart
99 */
101 virtual public XMLStatechartContext
102 {
103 public:
104 // inherited from Component
105 virtual std::string
107 {
108 return "PickAndPlaceGroupStatechartContext";
109 }
110
111 virtual void onInitStatechartContext();
112 virtual void onConnectStatechartContext();
113
116 {
117 return remoteRobot;
118 }
119
122 {
123 return robotStateComponent;
124 }
125
126 KinematicUnitInterfacePrx
128 {
129 return kinematicUnitPrx;
130 }
131
132 std::string
134 {
135 return getProperty<std::string>("KinematicUnitObserverName").getValue();
136 }
137
138 TCPControlUnitInterfacePrx
140 {
141 return tcpControlPrx;
142 }
143
144 //std::string getTCPControlUnitObserverName() { return getProperty<std::string>("TCPControlUnitObserverName").getValue(); }
145 //ForceTorqueUnitInterfacePrx getForceTorqueUnit() { return ftUnitPrx;}
146 ForceTorqueUnitObserverInterfacePrx
148 {
149 return ftUnitObserverPrx;
150 }
151
152 std::string
154 {
155 return getProperty<std::string>("ForceTorqueObserverName").getValue();
156 }
157
158 //SimulatorInterfacePrx getSimulatorUnit(){ return simulatorProxy;}
159 HeadIKUnitInterfacePrx
161 {
162 return headIKUnitPrx;
163 }
164
165 std::string
167 {
168 return headIKKinematicChainName;
169 }
170
171 memoryx::WorkingMemoryInterfacePrx
173 {
174 return workingMemoryProxy;
175 }
176
177 memoryx::ObjectMemoryObserverInterfacePrx
179 {
180 return objectMemoryObserverProxy;
181 }
182
183 memoryx::PriorKnowledgeInterfacePrx
185 {
186 return priorKnowledgeProxy;
187 }
188
189 private:
190 /**
191 * @see PropertyUser::createPropertyDefinitions()
192 */
193 virtual PropertyDefinitionsPtr createPropertyDefinitions();
194
195
196 RobotStateComponentInterfacePrx robotStateComponent;
197 KinematicUnitInterfacePrx kinematicUnitPrx;
198 KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
199 TCPControlUnitInterfacePrx tcpControlPrx;
200 //TCPControlUnitObserverInterfacePrx tcpControlUnitObserverPrx;
201 //ForceTorqueUnitInterfacePrx ftUnitPrx;
202 ForceTorqueUnitObserverInterfacePrx ftUnitObserverPrx;
203 VirtualRobot::RobotPtr remoteRobot;
204 memoryx::WorkingMemoryInterfacePrx workingMemoryProxy;
205 memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserverProxy;
206 memoryx::PriorKnowledgeInterfacePrx priorKnowledgeProxy;
207 //SimulatorInterfacePrx simulatorProxy;
208 HeadIKUnitInterfacePrx headIKUnitPrx;
209 std::string headIKKinematicChainName;
210 std::string headIKUnitName;
211 };
212
213} // namespace armarx::PickAndPlaceGroup
#define ARMARXCOMPONENT_IMPORT_EXPORT
Property< PropertyType > getProperty(const std::string &name)
custom implementation of the StatechartContext for a statechart
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx