TCPControlSkill.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/PeriodicSimpleSpecializedSkill.h>
32
#include <
RobotAPI/libraries/skills/provider/SimpleSpecializedSkill.h
>
33
#include <
RobotAPI/libraries/skills/provider/SkillContext.h
>
34
35
// Proxies
36
#include <RobotAPI/interface/units/TCPControlUnit.h>
37
38
// Skill Mixins
39
#include <
RobotAPI/libraries/core/FramedOrientedPoint.h
>
40
#include <
RobotAPI/libraries/core/FramedPose.h
>
41
#include <
RobotAPI/libraries/skills/provider/mixins/All.h
>
42
43
namespace
armarx::skills
44
{
45
struct
TCPControlSkillContext
:
public
SkillContext
46
{
47
// Properties
48
TCPControlUnitInterfacePrx
tcpControlUnitPrx
;
49
50
void
51
defineProperties
(
const
armarx::PropertyDefinitionsPtr
& defs,
52
const
std::string& prefix)
override
53
{
54
defs->component(
55
tcpControlUnitPrx
,
"TCPControlUnitName"
, prefix +
"TCPControlUnitInterfaceName"
);
56
}
57
};
58
59
class
TCPControlSkill
:
public
mixin::ArvizSkillMixin
,
public
mixin::MNSSkillMixin
60
{
61
public
:
62
TCPControlSkill
(
armem::client::MemoryNameSystem
&
mns
,
63
armarx::viz::Client
&
arviz
,
64
const
std::string&
layerName
,
65
TCPControlSkillContext
&
c
) :
66
mixin::
ArvizSkillMixin
({
arviz
,
layerName
}),
mixin::MNSSkillMixin
({
mns
}),
context
(
c
){};
67
68
protected
:
69
void
70
stopTCPMovement
(
const
std::string& kinematicChainName,
const
std::string& tcpName)
71
{
72
FramedDirectionPtr
cartesianVelocity =
73
new
FramedDirection
(Eigen::Vector3f::Zero(),
GlobalFrame
,
""
);
74
FramedDirectionPtr
angleVelocity =
75
new
FramedDirection
(Eigen::Vector3f::Zero(),
GlobalFrame
,
""
);
76
77
context
.
tcpControlUnitPrx
->setTCPVelocity(
78
kinematicChainName, tcpName, cartesianVelocity, angleVelocity);
79
std::this_thread::sleep_for(std::chrono::milliseconds(500));
80
}
81
82
protected
:
83
TCPControlSkillContext
&
context
;
84
};
85
}
// namespace armarx::skills
armarx::skills::TCPControlSkill::stopTCPMovement
void stopTCPMovement(const std::string &kinematicChainName, const std::string &tcpName)
Definition:
TCPControlSkill.h:70
armarx::skills::mixin::MNSSkillMixin::mns
armem::client::MemoryNameSystem mns
Definition:
MNSSkillMixin.h:11
FramedOrientedPoint.h
armarx::skills::TCPControlSkillContext
Definition:
TCPControlSkill.h:45
armarx::skills
This file is part of ArmarX.
Definition:
PeriodicUpdateWidget.cpp:11
armarx::GlobalFrame
const std::string GlobalFrame
Definition:
FramedPose.h:65
armarx::skills::mixin::MNSSkillMixin
Definition:
MNSSkillMixin.h:9
c
constexpr T c
Definition:
UnscentedKalmanFilterTest.cpp:46
armarx::skills::TCPControlSkillContext::defineProperties
void defineProperties(const armarx::PropertyDefinitionsPtr &defs, const std::string &prefix) override
Definition:
TCPControlSkill.h:51
armarx::skills::TCPControlSkillContext::tcpControlUnitPrx
TCPControlUnitInterfacePrx tcpControlUnitPrx
Definition:
TCPControlSkill.h:48
SimpleSpecializedSkill.h
armarx::skills::mixin::ArvizSkillMixin::arviz
armarx::viz::Client arviz
Definition:
ArvizSkillMixin.h:11
IceInternal::Handle< FramedDirection >
armarx::skills::mixin::ArvizSkillMixin
Definition:
ArvizSkillMixin.h:9
armarx::skills::SkillContext
Definition:
SkillContext.h:13
FramedPose.h
All.h
armarx::skills::mixin::ArvizSkillMixin::layerName
std::string layerName
Definition:
ArvizSkillMixin.h:12
armarx::skills::TCPControlSkill::context
TCPControlSkillContext & context
Definition:
TCPControlSkill.h:83
Component.h
SkillContext.h
armarx::skills::mixin::ArvizSkillMixin::ArvizSkillMixin
ArvizSkillMixin(const armarx::viz::Client &a, const std::string &ln)
Definition:
ArvizSkillMixin.h:14
armarx::skills::TCPControlSkill::TCPControlSkill
TCPControlSkill(armem::client::MemoryNameSystem &mns, armarx::viz::Client &arviz, const std::string &layerName, TCPControlSkillContext &c)
Definition:
TCPControlSkill.h:62
armarx::VariantType::FramedDirection
const VariantTypeId FramedDirection
Definition:
FramedPose.h:37
armarx::skills::TCPControlSkill
Definition:
TCPControlSkill.h:59
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::armem::client::MemoryNameSystem
The memory name system (MNS) client.
Definition:
MemoryNameSystem.h:68
armarx::viz::Client
Definition:
Client.h:117
RobotSkillTemplates
libraries
skill_tcp_control
TCPControlSkill.h
Generated on Sat Mar 29 2025 09:17:33 for armarx_documentation by
1.8.17