MotionControlGroupStatechartContext.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::MotionControlGroup
19  * @author Peter Kaiser ( peter dot kaiser at kit dot edu )
20  * @author Manfred Kroehnert ( Manfred dot Kroehnert at kit dot edu )
21  * @date 2014
22  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
23  * GNU General Public License
24  */
25 
26 
27 #pragma once
28 
32 
33 
34 // Custom Includes
36 #include <RobotAPI/interface/core/RobotState.h>
37 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
38 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
39 #include <RobotAPI/interface/units/TCPControlUnit.h>
42 
43 //#include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
44 
45 #include <VirtualRobot/VirtualRobot.h>
46 
48 {
49 
51  {
54  {
55  defineRequiredProperty<std::string>("KinematicUnitName",
56  "Name of the kinematic unit that should be used");
57  defineRequiredProperty<std::string>(
58  "KinematicUnitObserverName",
59  "Name of the kinematic unit observer that should be used");
60  defineOptionalProperty<std::string>(
61  "RobotStateComponentName",
62  "RobotStateComponent",
63  "Name of the robot state component that should be used");
64  defineOptionalProperty<std::string>(
65  "TCPControlUnitName",
66  "TCPControlUnit",
67  "Name of the tcp control unit component that should be used");
68  }
69  };
70 
71  /**
72  * @class MotionControlGroupStatechartContext is a custom implementation of the StatechartContext
73  * for a statechart
74  */
76  virtual public XMLStatechartContext
77  {
78  public:
79  // inherited from Component
80  std::string
81  getDefaultName() const override
82  {
83  return "MotionControlGroupStatechartContext";
84  }
85 
86  void onInitStatechartContext() override;
87  void onConnectStatechartContext() override;
88 
89  const std::shared_ptr<RemoteRobot>
91  {
92  return remoteRobot;
93  }
94 
97  {
98  return localrobot;
99  }
100 
103  {
104  return localCollisionRobot;
105  }
106 
109  {
110  return localStructureRobot;
111  }
112 
115  {
116  return robotStateComponent;
117  }
118 
119  KinematicUnitInterfacePrx
121  {
122  return kinematicUnitPrx;
123  }
124 
125  KinematicUnitObserverInterfacePrx
127  {
128  return kinematicUnitObserverPrx;
129  }
130 
131  std::string
133  {
134  return getProperty<std::string>("KinematicUnitObserverName").getValue();
135  }
136 
137  TCPControlUnitInterfacePrx
139  {
140  return tcpControlPrx;
141  }
142 
145  {
146  return debugDrawerTopicProxy;
147  }
148 
151  {
152  return debugObserverProxy;
153  }
154 
155  /**
156  * @brief Robot Pool containing collision robots
157  * @return
158  */
159  const RobotPoolPtr&
160  getRobotPool() const
161  {
162  return robotPool;
163  }
164 
165  private:
166  /**
167  * @see PropertyUser::createPropertyDefinitions()
168  */
169  PropertyDefinitionsPtr createPropertyDefinitions() override;
170  VirtualRobot::RobotPtr localrobot;
171  VirtualRobot::RobotPtr localCollisionRobot;
172  VirtualRobot::RobotPtr localStructureRobot;
173  std::shared_ptr<RemoteRobot> remoteRobot;
174  RobotStateComponentInterfacePrx robotStateComponent;
175  KinematicUnitInterfacePrx kinematicUnitPrx;
176  KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
177  TCPControlUnitInterfacePrx tcpControlPrx;
178  DebugDrawerInterfacePrx debugDrawerTopicProxy;
179  DebugObserverInterfacePrx debugObserverProxy;
180  RobotPoolPtr robotPool;
181  };
182 
183 } // namespace armarx::MotionControlGroup
DebugDrawerComponent.h
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getLocalStructureRobot
const VirtualRobot::RobotPtr getLocalStructureRobot()
Definition: MotionControlGroupStatechartContext.h:108
RemoteRobot.h
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getLocalRobot
const VirtualRobot::RobotPtr getLocalRobot()
Definition: MotionControlGroupStatechartContext.h:96
armarx::XMLStatechartContext
Definition: StatechartContext.h:208
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getDebugObserverProxy
DebugObserverInterfacePrx getDebugObserverProxy() const
Definition: MotionControlGroupStatechartContext.h:150
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getKinematicUnitObserverName
std::string getKinematicUnitObserverName()
Definition: MotionControlGroupStatechartContext.h:132
armarx::MotionControlGroup::MotionControlGroupStatechartContext
Definition: MotionControlGroupStatechartContext.h:75
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::MotionControlGroup::MotionControlGroupStatechartContextProperties::MotionControlGroupStatechartContextProperties
MotionControlGroupStatechartContextProperties(std::string prefix)
Definition: MotionControlGroupStatechartContext.h:52
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getDebugDrawerTopicProxy
DebugDrawerInterfacePrx getDebugDrawerTopicProxy()
Definition: MotionControlGroupStatechartContext.h:144
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getTCPControlUnit
TCPControlUnitInterfacePrx getTCPControlUnit()
Definition: MotionControlGroupStatechartContext.h:138
armarx::RobotPoolPtr
std::shared_ptr< class RobotPool > RobotPoolPtr
Definition: RobotUnitModuleRobotData.h:35
armarx::MotionControlGroup
Definition: CalculateGazeIk.h:29
StatechartContext.h
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getRobotPool
const RobotPoolPtr & getRobotPool() const
Robot Pool containing collision robots.
Definition: MotionControlGroupStatechartContext.h:160
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getRobot
const std::shared_ptr< RemoteRobot > getRobot()
Definition: MotionControlGroupStatechartContext.h:90
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getRobotStateComponent
RobotStateComponentInterfacePrx getRobotStateComponent()
Definition: MotionControlGroupStatechartContext.h:114
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
Component.h
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: MotionControlGroupStatechartContext.h:81
armarx::MotionControlGroup::MotionControlGroupStatechartContextProperties
Definition: MotionControlGroupStatechartContext.h:50
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getKinematicUnit
KinematicUnitInterfacePrx getKinematicUnit()
Definition: MotionControlGroupStatechartContext.h:120
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getKinematicUnitObserver
KinematicUnitObserverInterfacePrx getKinematicUnitObserver()
Definition: MotionControlGroupStatechartContext.h:126
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
RobotPool.h
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getLocalCollisionRobot
const VirtualRobot::RobotPtr getLocalCollisionRobot()
Definition: MotionControlGroupStatechartContext.h:102
ImportExportComponent.h