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
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>
42 
43 //#include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
44 
45 #include <VirtualRobot/VirtualRobot.h>
46 
48 {
49 
51  {
54  {
55  defineRequiredProperty<std::string>("KinematicUnitName", "Name of the kinematic unit that should be used");
56  defineRequiredProperty<std::string>("KinematicUnitObserverName", "Name of the kinematic unit observer that should be used");
57  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the robot state component that should be used");
58  defineOptionalProperty<std::string>("TCPControlUnitName", "TCPControlUnit", "Name of the tcp control unit component that should be used");
59  }
60  };
61 
62  /**
63  * @class MotionControlGroupStatechartContext is a custom implementation of the StatechartContext
64  * for a statechart
65  */
67  virtual public XMLStatechartContext
68  {
69  public:
70  // inherited from Component
71  std::string getDefaultName() const override
72  {
73  return "MotionControlGroupStatechartContext";
74  }
75  void onInitStatechartContext() override;
76  void onConnectStatechartContext() override;
77 
78 
79  const std::shared_ptr<RemoteRobot> getRobot()
80  {
81  return remoteRobot;
82  }
84  {
85  return localrobot;
86  }
88  {
89  return localCollisionRobot;
90  }
92  {
93  return localStructureRobot;
94  }
95 
97  {
98  return robotStateComponent;
99  }
100  KinematicUnitInterfacePrx getKinematicUnit()
101  {
102  return kinematicUnitPrx;
103  }
104  KinematicUnitObserverInterfacePrx getKinematicUnitObserver()
105  {
106  return kinematicUnitObserverPrx;
107  }
109  {
110  return getProperty<std::string>("KinematicUnitObserverName").getValue();
111  }
112  TCPControlUnitInterfacePrx getTCPControlUnit()
113  {
114  return tcpControlPrx;
115  }
117  {
118  return debugDrawerTopicProxy;
119  }
120 
122  {
123  return debugObserverProxy;
124  }
125 
126  /**
127  * @brief Robot Pool containing collision robots
128  * @return
129  */
130  const RobotPoolPtr& getRobotPool() const
131  {
132  return robotPool;
133  }
134 
135  private:
136 
137 
138  /**
139  * @see PropertyUser::createPropertyDefinitions()
140  */
141  PropertyDefinitionsPtr createPropertyDefinitions() override;
142  VirtualRobot::RobotPtr localrobot;
143  VirtualRobot::RobotPtr localCollisionRobot;
144  VirtualRobot::RobotPtr localStructureRobot;
145  std::shared_ptr<RemoteRobot> remoteRobot;
146  RobotStateComponentInterfacePrx robotStateComponent;
147  KinematicUnitInterfacePrx kinematicUnitPrx;
148  KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
149  TCPControlUnitInterfacePrx tcpControlPrx;
150  DebugDrawerInterfacePrx debugDrawerTopicProxy;
151  DebugObserverInterfacePrx debugObserverProxy;
152  RobotPoolPtr robotPool;
153  };
154 
155 }
156 
DebugDrawerComponent.h
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getLocalStructureRobot
const VirtualRobot::RobotPtr getLocalStructureRobot()
Definition: MotionControlGroupStatechartContext.h:91
RemoteRobot.h
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getLocalRobot
const VirtualRobot::RobotPtr getLocalRobot()
Definition: MotionControlGroupStatechartContext.h:83
armarx::XMLStatechartContext
Definition: StatechartContext.h:196
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getDebugObserverProxy
DebugObserverInterfacePrx getDebugObserverProxy() const
Definition: MotionControlGroupStatechartContext.h:121
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getKinematicUnitObserverName
std::string getKinematicUnitObserverName()
Definition: MotionControlGroupStatechartContext.h:108
armarx::MotionControlGroup::MotionControlGroupStatechartContext
Definition: MotionControlGroupStatechartContext.h:66
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::MotionControlGroup::MotionControlGroupStatechartContextProperties::MotionControlGroupStatechartContextProperties
MotionControlGroupStatechartContextProperties(std::string prefix)
Definition: MotionControlGroupStatechartContext.h:52
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getDebugDrawerTopicProxy
DebugDrawerInterfacePrx getDebugDrawerTopicProxy()
Definition: MotionControlGroupStatechartContext.h:116
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getTCPControlUnit
TCPControlUnitInterfacePrx getTCPControlUnit()
Definition: MotionControlGroupStatechartContext.h:112
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:130
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getRobot
const std::shared_ptr< RemoteRobot > getRobot()
Definition: MotionControlGroupStatechartContext.h:79
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getRobotStateComponent
RobotStateComponentInterfacePrx getRobotStateComponent()
Definition: MotionControlGroupStatechartContext.h:96
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:71
armarx::MotionControlGroup::MotionControlGroupStatechartContextProperties
Definition: MotionControlGroupStatechartContext.h:50
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getKinematicUnit
KinematicUnitInterfacePrx getKinematicUnit()
Definition: MotionControlGroupStatechartContext.h:100
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getKinematicUnitObserver
KinematicUnitObserverInterfacePrx getKinematicUnitObserver()
Definition: MotionControlGroupStatechartContext.h:104
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
RobotPool.h
armarx::MotionControlGroup::MotionControlGroupStatechartContext::getLocalCollisionRobot
const VirtualRobot::RobotPtr getLocalCollisionRobot()
Definition: MotionControlGroupStatechartContext.h:87
ImportExportComponent.h