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");
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 }
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&
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
#define ARMARXCOMPONENT_IMPORT_EXPORT
Property< PropertyType > getProperty(const std::string &name)
custom implementation of the StatechartContext for a statechart
const RobotPoolPtr & getRobotPool() const
Robot Pool containing collision robots.
std::string getDefaultName() const override
Retrieve default name of component.
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)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface > DebugObserverInterfacePrx
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
std::shared_ptr< class RobotPool > RobotPoolPtr