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 
27 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
28 #include <RobotAPI/interface/units/HandUnitInterface.h>
29 #include <RobotAPI/interface/units/TCPControlUnit.h>
30 #include <RobotAPI/interface/units/HeadIKUnit.h>
31 #include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
32 
36 
37 #include <IceUtil/Time.h>
38 
39 namespace armarx
40 {
41 
42  // ****************************************************************
43  // Component and context
44  // ****************************************************************
45 
47  {
50  {
51  defineRequiredProperty<std::string>("KinematicUnitName", "Name of the kinematic unit that should be used");
52  defineRequiredProperty<std::string>("KinematicUnitObserverName", "Name of the kinematic unit observer that should be used");
53  //HandUnits should only be changed via config file and default parameter should remain empty
54  defineOptionalProperty<std::string>("HandUnits", "", "Name of the comma-seperated hand units that should be used. Unitname for left hand should be LeftHandUnit, and for right hand RightHandUnit");
55  defineOptionalProperty<std::string>("HeadIKUnitName", "", "Name of the head unit that should be used.");
56  defineOptionalProperty<std::string>("HeadIKKinematicChainName", "", "Name of the kinematic chain that should be used for head IK.");
57  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the RobotStateComponent that should be used");
58 
59  }
60  };
61 
62  /**
63  * @class HumanoidRobotStatechartContext is the implementation of the StatechartContext
64  * for a HumanoidRobot
65  */
67  virtual public StatechartContext
68  {
69  public:
70  // inherited from Component
71  std::string getDefaultName() const override
72  {
73  return "RobotStatechartContext";
74  }
75  void onInitStatechartContext() override;
76  void onConnectStatechartContext() override;
77 
78  // todo:read access should only be allowed via const getters ?!
79  //const VirtualRobot::RobotPtr getRobot();
80  //private:
81 
82 
83  /**
84  * @see PropertyUser::createPropertyDefinitions()
85  */
86  PropertyDefinitionsPtr createPropertyDefinitions() override;
87 
89  {
90  return kinematicUnitObserverName;
91  }
92 
93  HandUnitInterfacePrx getHandUnit(const std::string& handUnitName);
94 
95  //! Prx for the RobotState
97  KinematicUnitInterfacePrx kinematicUnitPrx;
98  KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
99  TCPControlUnitInterfacePrx tcpControlPrx;
101  std::map<std::string, HandUnitInterfacePrx> handUnits;
102 
103  HeadIKUnitInterfacePrx headIKUnitPrx;
105 
106  private:
107  std::string kinematicUnitObserverName;
108  std::string headIKUnitName;
109  };
110 }
111 
armarx::RobotStatechartContext::headIKKinematicChainName
std::string headIKKinematicChainName
Definition: RobotStatechartContext.h:104
armarx::RobotStatechartContext::kinematicUnitObserverPrx
KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx
Definition: RobotStatechartContext.h:98
armarx::RobotStatechartContext::getKinematicUnitObserverName
std::string getKinematicUnitObserverName()
Definition: RobotStatechartContext.h:88
armarx::RobotStatechartContext::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: RobotStatechartContext.h:71
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::RobotStatechartContext::tcpControlPrx
TCPControlUnitInterfacePrx tcpControlPrx
Definition: RobotStatechartContext.h:99
StatechartContext.h
armarx::RobotStatechartContext::headIKUnitPrx
HeadIKUnitInterfacePrx headIKUnitPrx
Definition: RobotStatechartContext.h:103
armarx::RobotStatechartContext
Definition: RobotStatechartContext.h:66
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:89
Component.h
IceUtil::Handle
Definition: forward_declarations.h:29
armarx::RobotStatechartContext::robotStateComponent
RobotStateComponentInterfacePrx robotStateComponent
Prx for the RobotState.
Definition: RobotStatechartContext.h:96
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::RobotStatechartContext::handUnits
std::map< std::string, HandUnitInterfacePrx > handUnits
Definition: RobotStatechartContext.h:101
armarx::RobotStatechartContextProperties
Definition: RobotStatechartContext.h:46
armarx::RobotStatechartContext::remoteRobot
VirtualRobot::RobotPtr remoteRobot
Definition: RobotStatechartContext.h:100
armarx::RobotStatechartContext::kinematicUnitPrx
KinematicUnitInterfacePrx kinematicUnitPrx
Definition: RobotStatechartContext.h:97
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
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
ImportExportComponent.h