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
29
30// RobotAPI
33
34// Proxies
35#include <RobotAPI/interface/units/HandUnitInterface.h>
36
37// ArmarX
39
42
43namespace armarx::skills
44{
46 {
47 // Properties
48 HandUnitInterfacePrx leftHandUnitPrx;
49 HandUnitInterfacePrx rightHandUnitPrx;
50
51 void
53 const std::string& prefix) final
54 {
55 defs->component(
56 leftHandUnitPrx, "LeftHandUnitName", prefix + "LeftHandUnitInterfaceName");
57 defs->component(
58 rightHandUnitPrx, "RightHandUnitName", prefix + "RightHandUnitInterfaceName");
59 }
60 };
61
63 {
64 public:
66
67 protected:
68 void
70 {
71 context.leftHandUnitPrx->setShape("Close Preshape");
72 std::this_thread::sleep_for(std::chrono::milliseconds(1000));
73 }
74
75 void
77 {
78 context.leftHandUnitPrx->setShape("Open Preshape");
79 std::this_thread::sleep_for(std::chrono::milliseconds(1000));
80 }
81
82 void
84 {
85 context.rightHandUnitPrx->setShape("Close Preshape");
86 std::this_thread::sleep_for(std::chrono::milliseconds(1000));
87 }
88
89 void
91 {
92 context.rightHandUnitPrx->setShape("Open Preshape");
93 std::this_thread::sleep_for(std::chrono::milliseconds(1000));
94 }
95
96 protected:
98 };
99} // namespace armarx::skills
constexpr T c
HandControlSkillContext & context
HandControlSkill(HandControlSkillContext &c)
This file is part of ArmarX.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
void defineProperties(const armarx::PropertyDefinitionsPtr &defs, const std::string &prefix) final