TestGetNames.cpp
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  * @package RobotAPI::RobotNameHelperTestGroup
17  * @author Simon Ottenhaus ( simon dot ottenhaus at kit dot edu )
18  * @date 2018
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #include "TestGetNames.h"
24 
26 
27 //#include <ArmarXCore/core/time/TimeUtil.h>
28 //#include <ArmarXCore/observers/variant/DatafieldRef.h>
29 
30 using namespace armarx;
31 using namespace RobotNameHelperTestGroup;
32 
33 // DO NOT EDIT NEXT LINE
34 TestGetNames::SubClassRegistry TestGetNames::Registry(TestGetNames::GetName(), &TestGetNames::CreateInstance);
35 
36 
37 
39 {
40  // put your user code for the enter-point here
41  // execution time should be short (<100ms)
42 }
43 
45 {
46  ARMARX_IMPORTANT << "Profiles: " << getRobotNameHelper()->getProfiles();
47  auto side = [&](const auto s)
48  {
49  const auto arm = getRobotNameHelper()->getArm(s);
50  try
51  {
52  ARMARX_IMPORTANT << "qwerqwer : " << arm.select("qwerqwer");
53  }
54  catch (...)
55  {
57  }
58  try
59  {
60  ARMARX_IMPORTANT << "getSide : " << arm.getSide();
61  }
62  catch (...)
63  {
65  }
66  try
67  {
68  ARMARX_IMPORTANT << "getKinematicChain : " << arm.getKinematicChain();
69  }
70  catch (...)
71  {
73  }
74  try
75  {
76  ARMARX_IMPORTANT << "getTorsoKinematicChain: " << arm.getTorsoKinematicChain();
77  }
78  catch (...)
79  {
81  }
82  try
83  {
84  ARMARX_IMPORTANT << "getTCP : " << arm.getTCP();
85  }
86  catch (...)
87  {
89  }
90  try
91  {
92  ARMARX_IMPORTANT << "getForceTorqueSensor : " << arm.getForceTorqueSensor();
93  }
94  catch (...)
95  {
97  }
98  try
99  {
100  ARMARX_IMPORTANT << "getEndEffector : " << arm.getEndEffector();
101  }
102  catch (...)
103  {
105  }
106  try
107  {
108  ARMARX_IMPORTANT << "getMemoryHandName : " << arm.getMemoryHandName();
109  }
110  catch (...)
111  {
113  }
114  try
115  {
116  ARMARX_IMPORTANT << "getHandControllerName : " << arm.getHandControllerName();
117  }
118  catch (...)
119  {
121  }
122  try
123  {
124  ARMARX_IMPORTANT << "getHandModelPackage : " << arm.getHandModelPackage();
125  }
126  catch (...)
127  {
129  }
130  try
131  {
132  ARMARX_IMPORTANT << "getHandModelPath : " << arm.getHandModelPath();
133  }
134  catch (...)
135  {
137  }
138  try
139  {
140  ARMARX_IMPORTANT << "getHandRootNode : " << arm.getHandRootNode();
141  }
142  catch (...)
143  {
145  }
146 
147  RobotNameHelper::RobotArm robarm = arm.addRobot(getRobot());
148  try
149  {
150  ARMARX_IMPORTANT << s << "Arm: " << robarm.getKinematicChain()->getName();
151  }
152  catch (...)
153  {
155  }
156  try
157  {
158  ARMARX_IMPORTANT << s << "Arm TCP: " << robarm.getTCP()->getName();
159  }
160  catch (...)
161  {
163  }
164  try
165  {
166  ARMARX_IMPORTANT << "HandRootNode: " << robarm.getHandRootNode()->getName();
167  }
168  catch (...)
169  {
171  }
172  try
173  {
174  ARMARX_IMPORTANT << "TorsoKinematicChain: " << robarm.getTorsoKinematicChain()->getName();
175  }
176  catch (...)
177  {
179  }
180  try
181  {
182  ARMARX_IMPORTANT << "Tcp2HandRootTransform: " << robarm.getTcp2HandRootTransform();
183  }
184  catch (...)
185  {
187  }
188  };
189  side("Left");
190  side("Right");
191 }
192 
193 //void TestGetNames::onBreak()
194 //{
195 // // put your user code for the breaking point here
196 // // execution time should be short (<100ms)
197 //}
198 
200 {
201  // put your user code for the exit point here
202  // execution time should be short (<100ms)
203 }
204 
205 
206 // DO NOT EDIT NEXT FUNCTION
208 {
209  return XMLStateFactoryBasePtr(new TestGetNames(stateData));
210 }
211 
armarx::RobotNameHelperTestGroup::TestGetNames::Registry
static SubClassRegistry Registry
Definition: TestGetNames.h:45
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
armarx::RobotNameHelperTestGroup::TestGetNames::onExit
void onExit() override
Definition: TestGetNames.cpp:199
armarx::RobotArm::getTorsoKinematicChain
VirtualRobot::RobotNodeSetPtr getTorsoKinematicChain() const
Definition: RobotNameHelper.cpp:322
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::GetHandledExceptionString
std::string GetHandledExceptionString()
Definition: Exception.cpp:147
armarx::RobotNameHelperTestGroup::TestGetNames::onEnter
void onEnter() override
Definition: TestGetNames.cpp:38
armarx::RobotArm::getHandRootNode
VirtualRobot::RobotNodePtr getHandRootNode() const
Definition: RobotNameHelper.cpp:352
armarx::RobotArm::getTCP
VirtualRobot::RobotNodePtr getTCP() const
Definition: RobotNameHelper.cpp:329
armarx::RobotArm::getTcp2HandRootTransform
Eigen::Matrix4f getTcp2HandRootTransform() const
Definition: RobotNameHelper.cpp:359
armarx::RobotArm::getKinematicChain
VirtualRobot::RobotNodeSetPtr getKinematicChain() const
Definition: RobotNameHelper.cpp:315
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::RobotNameHelperTestGroup::TestGetNames::TestGetNames
TestGetNames(const XMLStateConstructorParams &stateData)
Definition: TestGetNames.h:32
armarx::RobotNameHelperTestGroup::TestGetNames::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: TestGetNames.cpp:207
armarx::RobotArm
Definition: RobotNameHelper.h:101
TestGetNames.h
armarx::RobotNameHelperTestGroup::TestGetNames::run
void run() override
Definition: TestGetNames.cpp:44
armarx::XMLStateFactoryBasePtr
IceInternal::Handle< XMLStateFactoryBase > XMLStateFactoryBasePtr
Definition: XMLState.h:65
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
RobotNameHelper.h