ShapeHand.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <armarx/control/skills/aron/ShapeHandParams.aron.generated.h>
7
8#include "HandUnitServices.h"
9
11{
12
13 class ShapeHand : public ::armarx::skills::SpecializedSkill<arondto::ShapeHandParams>
14 {
15
16 public:
18 {
20 };
21
22 static ::armarx::skills::SkillDescription
24
25 {
26 ParamType defaultParams;
27
28 return ::armarx::skills::SkillDescription{
29 .skillId = {.skillName = constants::SHAPE_HAND_SKILL_NAME},
30 .description =
31 "Shapes the hand according to a predefined shape or passed joint angles",
32 .rootProfileDefaults = defaultParams.toAron(),
33 .timeout = ::armarx::Duration::Minutes(1),
34 .parametersType = ParamType::ToAronType(),
35 };
36 }
37
38 ShapeHand(const HandUnitServices&, Properties p);
39
40 private:
42 Skill::MainResult waitUntilFinished(const NameValueMap& targetAngles);
43
44 private:
46 Properties p_;
47
48 float getAccuracy(const std::string& jointName);
49 };
50
51 class OpenHand : public ::armarx::skills::SpecializedSkill<arondto::OpenHandParams>
52 {
53 public:
54 static ::armarx::skills::SkillDescription
56 {
57 ParamType defaultParams;
58
59 return ::armarx::skills::SkillDescription{
60 .skillId = {.skillName = constants::OPEN_HAND_SKILL_NAME},
61 .description = "Sets hand shape to 'Open'",
62 .rootProfileDefaults = defaultParams.toAron(),
63 .timeout = ::armarx::Duration::Minutes(1),
64 .parametersType = ParamType::ToAronType()};
65 }
66
67 OpenHand();
68
69 private:
71 };
72
73 class CloseHand : public ::armarx::skills::SpecializedSkill<arondto::CloseHandParams>
74 {
75 public:
76 static ::armarx::skills::SkillDescription
78 {
79 ParamType defaultParams;
80
81 return ::armarx::skills::SkillDescription{
82 .skillId = {.skillName = constants::CLOSE_HAND_SKILL_NAME},
83 .description = "Sets hand shape to 'Close'",
84 .rootProfileDefaults = defaultParams.toAron(),
85 .timeout = ::armarx::Duration::Minutes(1),
86 .parametersType = ParamType::ToAronType()};
87 }
88
89 CloseHand();
90
91 private:
93 };
94
95} // namespace armarx::control::skills::skills
int main(int argc, char *argv[])
Definition Admin.cpp:45
static Duration Minutes(std::int64_t minutes)
Constructs a duration in minutes.
Definition Duration.cpp:96
::armarx::skills::SkillDescription GetSkillDescription()
Definition ShapeHand.h:77
::armarx::skills::SkillDescription GetSkillDescription()
Definition ShapeHand.h:55
ShapeHand(const HandUnitServices &, Properties p)
Definition ShapeHand.cpp:52
::armarx::skills::SkillDescription GetSkillDescription()
Definition ShapeHand.h:23
A result struct for th main method of a skill.
Definition Skill.h:62