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"
27 
28 
29 namespace memoryx
30 {
31 
32 
33 
34  KBMData::KBMData(const armarx::MatrixDoubleBasePtr& controlNet, const std::string& nodeSetName, const std::string& referenceFrameName, const std::string& robotName)
35  {
36 
37  setControlNet(controlNet);
38  setNodeSetName(nodeSetName);
39  setReferenceFrameName(referenceFrameName);
40  setRobotName(robotName);
41  setName(robotName + "_" + referenceFrameName + "_" + nodeSetName);
42  }
43 
44  armarx::MatrixDoubleBasePtr KBMData::getControlNet(const Ice::Current&) const
45  {
46  return getAttributeValue("ControlNet")->getClass<armarx::MatrixDoubleBase>();
47  }
48 
49  void KBMData::setControlNet(const armarx::MatrixDoubleBasePtr& controlNet, const Ice::Current&)
50  {
51  putAttribute("ControlNet", controlNet);
52  }
53 
54 } // namespace memoryx
55 
56 
58 {
59  EntityPtr ret = new KBMData(*this);
60  // ret->deepCopy(*this);
61  return ret;
62 
63 }
64 
65 std::string memoryx::KBMData::getReferenceFrameName(const Ice::Current&) const
66 {
67  return getAttributeValue("ReferenceFrameName")->get<std::string>();
68 }
69 
70 std::string memoryx::KBMData::getNodeSetName(const Ice::Current&) const
71 {
72  return getAttributeValue("NodeSetName")->get<std::string>();
73 }
74 
75 std::string memoryx::KBMData::getRobotName(const Ice::Current& c) const
76 {
77  return getAttributeValue("RobotName")->get<std::string>();
78 }
79 
80 void memoryx::KBMData::setNodeSetName(const std::string& nodeSetName, const Ice::Current& c)
81 {
82  putAttribute("NodeSetName", nodeSetName);
83 }
84 
85 void memoryx::KBMData::setRobotName(const std::string& robotName, const Ice::Current& c)
86 {
87  putAttribute("RobotName", robotName);
88 }
89 void memoryx::KBMData::setReferenceFrameName(const std::string& referenceFrameName, const Ice::Current& c)
90 {
91  putAttribute("ReferenceFrameName", referenceFrameName);
92 }
kbm.h
memoryx::KBMData::getReferenceFrameName
std::string getReferenceFrameName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KBMData.cpp:65
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:21
memoryx::KBMData::setReferenceFrameName
void setReferenceFrameName(const std::string &referenceFrameName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KBMData.cpp:89
memoryx::Entity::putAttribute
void putAttribute(const ::memoryx::EntityAttributeBasePtr &attr, const ::Ice::Current &=Ice::emptyCurrent) override
Store attribute in entity.
Definition: Entity.cpp:327
MatrixVariant.h
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::KBMData::getNodeSetName
std::string getNodeSetName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KBMData.cpp:70
memoryx::Entity::getAttributeValue
virtual armarx::VariantPtr getAttributeValue(const ::std::string &attrName) const
Retrieve value of an attribute from entity.
Definition: Entity.cpp:308
memoryx::KBMData::setRobotName
void setRobotName(const std::string &robotName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KBMData.cpp:85
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::KBMData::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: KBMData.cpp:57
memoryx::KBMData::getControlNet
armarx::MatrixDoubleBasePtr getControlNet(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KBMData.cpp:44
KBMData.h
memoryx::KBMData::setControlNet
void setControlNet(const armarx::MatrixDoubleBasePtr &controlNet, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KBMData.cpp:49
memoryx::KBMData::KBMData
KBMData()
Definition: KBMData.h:49
memoryx::KBMData::getRobotName
std::string getRobotName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KBMData.cpp:75
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::KBMData::setNodeSetName
void setNodeSetName(const std::string &nodeSetName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KBMData.cpp:80
memoryx::Entity::setName
void setName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
Set name of this entity.
Definition: Entity.cpp:179