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