KBMData.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package
19 * @author
20 * @date
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24#include "KBMData.h"
25
27
29
30namespace memoryx
31{
32
33
34 KBMData::KBMData(const armarx::MatrixDoubleBasePtr& controlNet,
35 const std::string& nodeSetName,
36 const std::string& referenceFrameName,
37 const std::string& robotName)
38 {
39
40 setControlNet(controlNet);
41 setNodeSetName(nodeSetName);
42 setReferenceFrameName(referenceFrameName);
43 setRobotName(robotName);
44 setName(robotName + "_" + referenceFrameName + "_" + nodeSetName);
45 }
46
47 armarx::MatrixDoubleBasePtr
48 KBMData::getControlNet(const Ice::Current&) const
49 {
50 return getAttributeValue("ControlNet")->getClass<armarx::MatrixDoubleBase>();
51 }
52
53 void
54 KBMData::setControlNet(const armarx::MatrixDoubleBasePtr& controlNet, const Ice::Current&)
55 {
56 putAttribute("ControlNet", controlNet);
57 }
58
59} // namespace memoryx
60
61Ice::ObjectPtr
63{
64 EntityPtr ret = new KBMData(*this);
65 // ret->deepCopy(*this);
66 return ret;
67}
68
69std::string
71{
72 return getAttributeValue("ReferenceFrameName")->get<std::string>();
73}
74
75std::string
76memoryx::KBMData::getNodeSetName(const Ice::Current&) const
77{
78 return getAttributeValue("NodeSetName")->get<std::string>();
79}
80
81std::string
82memoryx::KBMData::getRobotName(const Ice::Current& c) const
83{
84 return getAttributeValue("RobotName")->get<std::string>();
85}
86
87void
88memoryx::KBMData::setNodeSetName(const std::string& nodeSetName, const Ice::Current& c)
89{
90 putAttribute("NodeSetName", nodeSetName);
91}
92
93void
94memoryx::KBMData::setRobotName(const std::string& robotName, const Ice::Current& c)
95{
96 putAttribute("RobotName", robotName);
97}
98
99void
100memoryx::KBMData::setReferenceFrameName(const std::string& referenceFrameName,
101 const Ice::Current& c)
102{
103 putAttribute("ReferenceFrameName", referenceFrameName);
104}
constexpr T c
void setName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
Set name of this entity.
Definition Entity.cpp:188
virtual armarx::VariantPtr getAttributeValue(const ::std::string &attrName) const
Retrieve value of an attribute from entity.
Definition Entity.cpp:327
void putAttribute(const ::memoryx::EntityAttributeBasePtr &attr, const ::Ice::Current &=Ice::emptyCurrent) override
Store attribute in entity.
Definition Entity.cpp:347
std::string getReferenceFrameName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition KBMData.cpp:70
void setNodeSetName(const std::string &nodeSetName, const Ice::Current &c=Ice::emptyCurrent) override
Definition KBMData.cpp:88
std::string getNodeSetName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition KBMData.cpp:76
void setReferenceFrameName(const std::string &referenceFrameName, const Ice::Current &c=Ice::emptyCurrent) override
Definition KBMData.cpp:100
std::string getRobotName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition KBMData.cpp:82
void setControlNet(const armarx::MatrixDoubleBasePtr &controlNet, const Ice::Current &c=Ice::emptyCurrent) override
Definition KBMData.cpp:54
Ice::ObjectPtr ice_clone() const override
Definition KBMData.cpp:62
armarx::MatrixDoubleBasePtr getControlNet(const Ice::Current &c=Ice::emptyCurrent) const override
Definition KBMData.cpp:48
void setRobotName(const std::string &robotName, const Ice::Current &c=Ice::emptyCurrent) override
Definition KBMData.cpp:94
VirtualRobot headers.
IceInternal::Handle< Entity > EntityPtr
Typedef of EntityPtr as IceInternal::Handle<Entity> for convenience.
Definition Entity.h:45