ViSP
 All Classes Functions Variables Enumerations Enumerator Friends Groups Pages
testRobotViper850.cpp
1 /****************************************************************************
2  *
3  * $Id: testRobotViper850.cpp 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Test for Afma 6 dof robot.
36  *
37  * Authors:
38  * Fabien Spindler
39  *
40  *****************************************************************************/
41 
52 #include <visp/vpConfig.h>
53 #include <visp/vpRobotViper850.h>
54 #include <visp/vpDebug.h>
55 #include <visp/vpCameraParameters.h>
56 #include <iostream>
57 #ifdef VISP_HAVE_VIPER850
58 
59 int main()
60 {
61  try {
62 
63  std::cout << "a test for vpRobotViper850 class..." << std::endl;
64 
65  vpRobotViper850 viper850;
67 
68  std::cout << "-- Default settings for Viper850 ---"
69  << std::endl;
70  std::cout << viper850 << std::endl;
71  viper850.getCameraParameters(cam, 640, 480);
72  std::cout << cam << std::endl;
73 
74  std::cout << "-- Settings associated to the Marlin F033C camera without distortion ---"
75  << std::endl;
77 
78  std::cout << viper850 << std::endl;
79  viper850.getCameraParameters(cam, 640, 480);
80  std::cout << cam << std::endl;
81 
82  std::cout << "-- Settings associated to the Marlin F033C camera with distortion ------"
83  << std::endl;
86  std::cout << viper850 << std::endl;
87  viper850.getCameraParameters(cam, 640, 480);
88  std::cout << cam << std::endl;
89 
90 
91  std::cout << "-- Current joint position:" << std::endl;
92  vpColVector q;
94  std::cout << " " << q.t() << std::endl;
95 
96  std::cout << "-- Current fMe:" << std::endl;
97 
99  viper850.get_fMe(q, fMe);
101  fMe.extract(t);
103  fMe.extract(R);
104  vpRzyzVector rzyz;
105  rzyz.buildFrom(R);
106 
107  std::cout << "fMe:" << std::endl
108  << "\tt: " << t.t() << std::endl
109  << "\trzyz (deg): " << vpMath::deg(rzyz[0])
110  << " " << vpMath::deg(rzyz[1])
111  << " " << vpMath::deg(rzyz[2]) << std::endl;
112 
113  return 0;
114  }
115  catch(...) {
116  vpERROR_TRACE(" Test failed");
117  return 0;
118  }
119 
120 }
121 #else
122 int main()
123 {
124  std::cout << "The real Viper850 robot controller is not available." << std::endl;
125  return 0;
126 }
127 
128 #endif