HandControlSkill.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
* @author Fabian Reister ( fabian dot reister at kit dot edu )
17
* @date 2021
18
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19
* GNU General Public License
20
*/
21
22
#pragma once
23
24
// STD/STL
25
#include <string>
26
27
// ArmarX
28
#include <
ArmarXCore/core/Component.h
>
29
30
// RobotAPI
31
#include <
RobotAPI/libraries/skills/provider/SimpleSpecializedSkill.h
>
32
#include <
RobotAPI/libraries/skills/provider/SkillContext.h
>
33
34
// Proxies
35
#include <RobotAPI/interface/units/HandUnitInterface.h>
36
37
// ArmarX
38
#include <
ArmarXCore/core/Component.h
>
39
#include <
RobotAPI/libraries/RobotAPIComponentPlugins/ArVizComponentPlugin.h
>
40
#include <
RobotAPI/libraries/armem/client/MemoryNameSystem.h
>
41
42
namespace
armarx::skills
43
{
44
struct
HandControlSkillContext
:
public
SkillContext
45
{
46
// Properties
47
HandUnitInterfacePrx
leftHandUnitPrx
;
48
HandUnitInterfacePrx
rightHandUnitPrx
;
49
50
void
defineProperties
(
const
armarx::PropertyDefinitionsPtr
& defs,
const
std::string& prefix)
final
51
{
52
defs->component(
leftHandUnitPrx
,
"LeftHandUnitName"
, prefix +
"LeftHandUnitInterfaceName"
);
53
defs->component(
rightHandUnitPrx
,
"RightHandUnitName"
, prefix +
"RightHandUnitInterfaceName"
);
54
}
55
};
56
57
class
HandControlSkill
58
{
59
public
:
60
HandControlSkill
(
HandControlSkillContext
&
c
) :
61
context
(
c
)
62
{
63
};
64
65
protected
:
66
void
closeLeftHand
()
67
{
68
context
.
leftHandUnitPrx
->setShape(
"Close Preshape"
);
69
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
70
}
71
72
void
openLeftHand
()
73
{
74
context
.
leftHandUnitPrx
->setShape(
"Open Preshape"
);
75
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
76
}
77
78
void
closeRightHand
()
79
{
80
context
.
rightHandUnitPrx
->setShape(
"Close Preshape"
);
81
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
82
}
83
84
void
openRightHand
()
85
{
86
context
.
rightHandUnitPrx
->setShape(
"Open Preshape"
);
87
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
88
}
89
90
protected
:
91
HandControlSkillContext
&
context
;
92
};
93
}
ArVizComponentPlugin.h
armarx::skills
This file is part of ArmarX.
Definition:
PeriodicUpdateWidget.cpp:11
armarx::skills::HandControlSkill::openLeftHand
void openLeftHand()
Definition:
HandControlSkill.h:72
armarx::skills::HandControlSkill::openRightHand
void openRightHand()
Definition:
HandControlSkill.h:84
c
constexpr T c
Definition:
UnscentedKalmanFilterTest.cpp:43
SimpleSpecializedSkill.h
armarx::skills::HandControlSkillContext::leftHandUnitPrx
HandUnitInterfacePrx leftHandUnitPrx
Definition:
HandControlSkill.h:47
armarx::skills::SkillContext
Definition:
SkillContext.h:13
armarx::skills::HandControlSkill
Definition:
HandControlSkill.h:57
armarx::skills::HandControlSkill::closeRightHand
void closeRightHand()
Definition:
HandControlSkill.h:78
Component.h
armarx::skills::HandControlSkillContext::rightHandUnitPrx
HandUnitInterfacePrx rightHandUnitPrx
Definition:
HandControlSkill.h:48
SkillContext.h
armarx::skills::HandControlSkillContext
Definition:
HandControlSkill.h:44
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::skills::HandControlSkill::closeLeftHand
void closeLeftHand()
Definition:
HandControlSkill.h:66
MemoryNameSystem.h
armarx::skills::HandControlSkill::context
HandControlSkillContext & context
Definition:
HandControlSkill.h:91
armarx::skills::HandControlSkillContext::defineProperties
void defineProperties(const armarx::PropertyDefinitionsPtr &defs, const std::string &prefix) final
Definition:
HandControlSkill.h:50
armarx::skills::HandControlSkill::HandControlSkill
HandControlSkill(HandControlSkillContext &c)
Definition:
HandControlSkill.h:60
RobotSkillTemplates
libraries
skill_hand_control
HandControlSkill.h
Generated on Sat Oct 5 2024 09:14:05 for armarx_documentation by
1.8.17