JointControlSkill.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// Mixins
37
38// Proxies
39#include <RobotAPI/interface/units/KinematicUnitInterface.h>
40
41// ArmarX
43
45
46namespace armarx::skills
47{
49 {
50 // Properties
51 KinematicUnitInterfacePrx kinematicUnitPrx;
52
53 void
55 const std::string& prefix) final
56 {
57 defs->component(
58 kinematicUnitPrx, "KinematicUnitName", prefix + "KinematicUnitInterfaceName");
59 }
60 };
61
63 {
64 public:
67
68 protected:
70 stopJointMovement(const std::vector<std::string>& joints)
71 {
72 std::map<std::string, float> zeroVel;
73 for (const auto& p : joints)
74 {
75 zeroVel[p] = 0.0f;
76 }
77 context.kinematicUnitPrx->setJointVelocities(zeroVel);
78 std::this_thread::sleep_for(std::chrono::milliseconds(100));
80 }
81
82 protected:
84
86 };
87} // namespace armarx::skills
constexpr T c
The memory name system (MNS) client.
JointControlSkill(armem::client::MemoryNameSystem &mns, JointControlSkillContext &c)
JointControlSkillContext & context
TerminatedSkillStatus stopJointMovement(const std::vector< std::string > &joints)
armem::client::MemoryNameSystem & mns
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