RobotStatechartContext.h
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package Armar4::api
17 * @author Nikolaus Vahrenkamp
18 * @date 2012 Nikolaus Vahrenkamp
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 
24 #pragma once
25 
26 #include <IceUtil/Time.h>
27 
31 
32 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
33 #include <RobotAPI/interface/units/HandUnitInterface.h>
34 #include <RobotAPI/interface/units/HeadIKUnit.h>
35 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
36 #include <RobotAPI/interface/units/TCPControlUnit.h>
38 
39 namespace armarx
40 {
41 
42  // ****************************************************************
43  // Component and context
44  // ****************************************************************
45 
47  {
50  {
51  defineRequiredProperty<std::string>("KinematicUnitName",
52  "Name of the kinematic unit that should be used");
53  defineRequiredProperty<std::string>(
54  "KinematicUnitObserverName",
55  "Name of the kinematic unit observer that should be used");
56  //HandUnits should only be changed via config file and default parameter should remain empty
57  defineOptionalProperty<std::string>(
58  "HandUnits",
59  "",
60  "Name of the comma-seperated hand units that should be used. Unitname for left "
61  "hand should be LeftHandUnit, and for right hand RightHandUnit");
62  defineOptionalProperty<std::string>(
63  "HeadIKUnitName", "", "Name of the head unit that should be used.");
64  defineOptionalProperty<std::string>(
65  "HeadIKKinematicChainName",
66  "",
67  "Name of the kinematic chain that should be used for head IK.");
68  defineOptionalProperty<std::string>(
69  "RobotStateComponentName",
70  "RobotStateComponent",
71  "Name of the RobotStateComponent that should be used");
72  }
73  };
74 
75  /**
76  * @class HumanoidRobotStatechartContext is the implementation of the StatechartContext
77  * for a HumanoidRobot
78  */
80  {
81  public:
82  // inherited from Component
83  std::string
84  getDefaultName() const override
85  {
86  return "RobotStatechartContext";
87  }
88 
89  void onInitStatechartContext() override;
90  void onConnectStatechartContext() override;
91 
92  // todo:read access should only be allowed via const getters ?!
93  //const VirtualRobot::RobotPtr getRobot();
94  //private:
95 
96 
97  /**
98  * @see PropertyUser::createPropertyDefinitions()
99  */
100  PropertyDefinitionsPtr createPropertyDefinitions() override;
101 
102  std::string
104  {
105  return kinematicUnitObserverName;
106  }
107 
108  HandUnitInterfacePrx getHandUnit(const std::string& handUnitName);
109 
110  //! Prx for the RobotState
112  KinematicUnitInterfacePrx kinematicUnitPrx;
113  KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
114  TCPControlUnitInterfacePrx tcpControlPrx;
116  std::map<std::string, HandUnitInterfacePrx> handUnits;
117 
118  HeadIKUnitInterfacePrx headIKUnitPrx;
120 
121  private:
122  std::string kinematicUnitObserverName;
123  std::string headIKUnitName;
124  };
125 } // namespace armarx
armarx::RobotStatechartContext::headIKKinematicChainName
std::string headIKKinematicChainName
Definition: RobotStatechartContext.h:119
armarx::RobotStatechartContext::kinematicUnitObserverPrx
KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx
Definition: RobotStatechartContext.h:113
armarx::RobotStatechartContext::getKinematicUnitObserverName
std::string getKinematicUnitObserverName()
Definition: RobotStatechartContext.h:103
armarx::RobotStatechartContext::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: RobotStatechartContext.h:84
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::RobotStatechartContext::tcpControlPrx
TCPControlUnitInterfacePrx tcpControlPrx
Definition: RobotStatechartContext.h:114
StatechartContext.h
armarx::RobotStatechartContext::headIKUnitPrx
HeadIKUnitInterfacePrx headIKUnitPrx
Definition: RobotStatechartContext.h:118
armarx::RobotStatechartContext
Definition: RobotStatechartContext.h:79
armarx::RobotStatechartContextProperties::RobotStatechartContextProperties
RobotStatechartContextProperties(std::string prefix)
Definition: RobotStatechartContext.h:48
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
FramedPose.h
armarx::StatechartContext
This class contains a statechart and provides the interfaces to distributed components.
Definition: StatechartContext.h:85
Component.h
IceUtil::Handle
Definition: forward_declarations.h:30
armarx::RobotStatechartContext::robotStateComponent
RobotStateComponentInterfacePrx robotStateComponent
Prx for the RobotState.
Definition: RobotStatechartContext.h:111
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::RobotStatechartContext::handUnits
std::map< std::string, HandUnitInterfacePrx > handUnits
Definition: RobotStatechartContext.h:116
armarx::RobotStatechartContextProperties
Definition: RobotStatechartContext.h:46
armarx::RobotStatechartContext::remoteRobot
VirtualRobot::RobotPtr remoteRobot
Definition: RobotStatechartContext.h:115
armarx::RobotStatechartContext::kinematicUnitPrx
KinematicUnitInterfacePrx kinematicUnitPrx
Definition: RobotStatechartContext.h:112
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
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
ImportExportComponent.h