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
39namespace 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");
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
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");
63 "HeadIKUnitName", "", "Name of the head unit that should be used.");
65 "HeadIKKinematicChainName",
66 "",
67 "Name of the kinematic chain that should be used for head IK.");
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
#define ARMARXCOMPONENT_IMPORT_EXPORT
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)
RobotStateComponentInterfacePrx robotStateComponent
Prx for the RobotState.
KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx
KinematicUnitInterfacePrx kinematicUnitPrx
std::map< std::string, HandUnitInterfacePrx > handUnits
TCPControlUnitInterfacePrx tcpControlPrx
std::string getDefaultName() const override
Retrieve default name of component.
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx