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 
30 namespace 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 
63 {
64  EntityPtr ret = new KBMData(*this);
65  // ret->deepCopy(*this);
66  return ret;
67 }
68 
69 std::string
70 memoryx::KBMData::getReferenceFrameName(const Ice::Current&) const
71 {
72  return getAttributeValue("ReferenceFrameName")->get<std::string>();
73 }
74 
75 std::string
76 memoryx::KBMData::getNodeSetName(const Ice::Current&) const
77 {
78  return getAttributeValue("NodeSetName")->get<std::string>();
79 }
80 
81 std::string
82 memoryx::KBMData::getRobotName(const Ice::Current& c) const
83 {
84  return getAttributeValue("RobotName")->get<std::string>();
85 }
86 
87 void
88 memoryx::KBMData::setNodeSetName(const std::string& nodeSetName, const Ice::Current& c)
89 {
90  putAttribute("NodeSetName", nodeSetName);
91 }
92 
93 void
94 memoryx::KBMData::setRobotName(const std::string& robotName, const Ice::Current& c)
95 {
96  putAttribute("RobotName", robotName);
97 }
98 
99 void
100 memoryx::KBMData::setReferenceFrameName(const std::string& referenceFrameName,
101  const Ice::Current& c)
102 {
103  putAttribute("ReferenceFrameName", referenceFrameName);
104 }
kbm.h
memoryx::KBMData::getReferenceFrameName
std::string getReferenceFrameName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KBMData.cpp:70
armarx::aron::ret
ReaderT::InputType T & ret
Definition: rw.h:13
memoryx::KBMData::setReferenceFrameName
void setReferenceFrameName(const std::string &referenceFrameName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KBMData.cpp:100
memoryx::Entity::putAttribute
void putAttribute(const ::memoryx::EntityAttributeBasePtr &attr, const ::Ice::Current &=Ice::emptyCurrent) override
Store attribute in entity.
Definition: Entity.cpp:347
MatrixVariant.h
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
memoryx::KBMData::getNodeSetName
std::string getNodeSetName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KBMData.cpp:76
memoryx::Entity::getAttributeValue
virtual armarx::VariantPtr getAttributeValue(const ::std::string &attrName) const
Retrieve value of an attribute from entity.
Definition: Entity.cpp:327
memoryx::KBMData::setRobotName
void setRobotName(const std::string &robotName, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KBMData.cpp:94
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::KBMData::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: KBMData.cpp:62
memoryx::KBMData::getControlNet
armarx::MatrixDoubleBasePtr getControlNet(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KBMData.cpp:48
KBMData.h
memoryx::KBMData::setControlNet
void setControlNet(const armarx::MatrixDoubleBasePtr &controlNet, const Ice::Current &c=Ice::emptyCurrent) override
Definition: KBMData.cpp:54
memoryx::KBMData::KBMData
KBMData()
Definition: KBMData.h:50
memoryx::KBMData::getRobotName
std::string getRobotName(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: KBMData.cpp:82
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:88
memoryx::Entity::setName
void setName(const ::std::string &name, const ::Ice::Current &=Ice::emptyCurrent) override
Set name of this entity.
Definition: Entity.cpp:188