icub-test
All Data Structures Modules Pages
iKiniDynConsistencyTest.h
1 /*
2  * iCub Robot Unit Tests (Robot Testing Framework)
3  *
4  * Copyright (C) 2015-2019 Istituto Italiano di Tecnologia (IIT)
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef _IKINIDYNCONSISTENCYTEST_H_
22 #define _IKINIDYNCONSISTENCYTEST_H_
23 
24 #include <yarp/robottestingframework/TestCase.h>
25 
26 #include <yarp/sig/Matrix.h>
27 
28 #include <iCub/iKin/iKinFwd.h>
29 
30 namespace iCub
31 {
32 namespace iDyn
33 {
34  class iCubWholeBody;
35 }
36 }
37 
38 class iKiniDynConsistencyTest : public robottestingframework::TestCase {
39 private:
40  yarp::sig::Vector q_head, q_torso, q_larm, q_rarm, q_lleg, q_rleg;
41  iCub::iKin::iCubArm ikin_larm, ikin_rarm;
42  iCub::iKin::iCubLeg ikin_lleg, ikin_rleg;
43  iCub::iDyn::iCubWholeBody * icub;
44 
45 public:
46  iKiniDynConsistencyTest();
47  virtual ~iKiniDynConsistencyTest();
48 
49  virtual bool setup(int argc, char** argv);
50 
51  virtual void tearDown();
52 
53  virtual void run();
54 
55  virtual yarp::sig::Matrix getiKinTransform(const std::string part,
56  int index);
57 
58  virtual yarp::sig::Matrix getiDynTransform(const std::string part,
59  int index);
60 
61  virtual void check_matrix_are_equal(const yarp::sig::Matrix & mat1,
62  const yarp::sig::Matrix & mat2,
63  double tol=1e-3);
64 };
65 
66 #endif //_CAMERATEST_H