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:
17  static ::armarx::skills::SkillDescription
19  {
20  ParamType defaultParams;
21 
22  return ::armarx::skills::SkillDescription{
24  .description =
25  "Shapes the hand according to a predefined shape or passed joint angles",
26  .rootProfileDefaults = defaultParams.toAron(),
27  .timeout = ::armarx::Duration::Minutes(1),
28  .parametersType = ParamType::ToAronType(),};
29  }
30 
32 
33  private:
35  Skill::MainResult waitUntilFinished(const NameValueMap& targetAngles);
36 
37  private:
38  HandUnitServices srv_;
39 
40  float getAccuracy(const std::string& jointName);
41  };
42 
43  class OpenHand : public ::armarx::skills::SpecializedSkill<arondto::OpenHandParams>
44  {
45  public:
46  static ::armarx::skills::SkillDescription
48  {
49  ParamType defaultParams;
50 
51  return ::armarx::skills::SkillDescription{
53  .description = "Sets hand shape to 'Open'",
54  .rootProfileDefaults = defaultParams.toAron(),
55  .timeout = ::armarx::Duration::Minutes(1),
56  .parametersType = ParamType::ToAronType()};
57  }
58 
59  OpenHand();
60 
61  private:
63  };
64 
65  class CloseHand : public ::armarx::skills::SpecializedSkill<arondto::CloseHandParams>
66  {
67  public:
68  static ::armarx::skills::SkillDescription
70  {
71  ParamType defaultParams;
72 
73  return ::armarx::skills::SkillDescription{
75  .description = "Sets hand shape to 'Close'",
76  .rootProfileDefaults = defaultParams.toAron(),
77  .timeout = ::armarx::Duration::Minutes(1),
78  .parametersType = ParamType::ToAronType()};
79  }
80 
81  CloseHand();
82 
83  private:
85  };
86 
87 } // namespace armarx::control::skills::skills
armarx::control::skills::skills::ShapeHand::GetSkillDescription
::armarx::skills::SkillDescription GetSkillDescription()
Definition: ShapeHand.h:18
armarx::skills::SpecializedSkill
Definition: SpecializedSkill.h:14
armarx::control::skills::skills::ShapeHand::ShapeHand
ShapeHand(const HandUnitServices &)
Definition: ShapeHand.cpp:7
armarx::control::skills::HandUnitServices
Definition: HandUnitServices.h:17
armarx::control::skills::skills::OpenHand
Definition: ShapeHand.h:43
armarx::skills::SkillID::skillName
std::string skillName
Definition: SkillID.h:60
HandUnitServices.h
armarx::control::skills::skills::OpenHand::GetSkillDescription
::armarx::skills::SkillDescription GetSkillDescription()
Definition: ShapeHand.h:47
armarx::control::skills::constants::CLOSE_HAND_SKILL_NAME
std::string CLOSE_HAND_SKILL_NAME
Definition: constants.cpp:14
constants.h
armarx::control::skills::skills::OpenHand::OpenHand
OpenHand()
Definition: ShapeHand.cpp:175
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition: SkillDescription.h:20
armarx::control::skills::constants::OPEN_HAND_SKILL_NAME
std::string OPEN_HAND_SKILL_NAME
Definition: constants.cpp:13
armarx::core::time::Duration::Minutes
static Duration Minutes(std::int64_t minutes)
Constructs a duration in minutes.
Definition: Duration.cpp:111
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition: Skill.h:48
armarx::control::skills::constants::SHAPE_HAND_SKILL_NAME
std::string SHAPE_HAND_SKILL_NAME
Definition: constants.cpp:12
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:91
armarx::control::skills::skills::CloseHand
Definition: ShapeHand.h:65
armarx::skills::SpecializedSkill< arondto::ShapeHandParams >::ParamType
arondto::ShapeHandParams ParamType
Definition: SpecializedSkill.h:18
armarx::control::skills::skills
Definition: ExecuteTrajectory.cpp:18
armarx::control::skills::skills::CloseHand::GetSkillDescription
::armarx::skills::SkillDescription GetSkillDescription()
Definition: ShapeHand.h:69
SpecializedSkill.h
armarx::control::skills::skills::ShapeHand
Definition: ShapeHand.h:13
armarx::control::skills::skills::CloseHand::CloseHand
CloseHand()
Definition: ShapeHand.cpp:195