Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
testRobotViper850.cpp
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Test for Afma 6 dof robot.
32  *
33  * Authors:
34  * Fabien Spindler
35  *
36  *****************************************************************************/
37 
48 #include <visp3/core/vpConfig.h>
49 #include <visp3/robot/vpRobotViper850.h>
50 #include <visp3/core/vpDebug.h>
51 #include <visp3/core/vpCameraParameters.h>
52 #include <iostream>
53 #ifdef VISP_HAVE_VIPER850
54 
55 int main()
56 {
57  try {
58 
59  std::cout << "a test for vpRobotViper850 class..." << std::endl;
60 
61  vpRobotViper850 viper850;
63 
64  std::cout << "-- Default settings for Viper850 ---"
65  << std::endl;
66  std::cout << viper850 << std::endl;
67  viper850.getCameraParameters(cam, 640, 480);
68  std::cout << cam << std::endl;
69 
70  std::cout << "-- Settings associated to the Marlin F033C camera without distortion ---"
71  << std::endl;
73 
74  std::cout << viper850 << std::endl;
75  viper850.getCameraParameters(cam, 640, 480);
76  std::cout << cam << std::endl;
77 
78  std::cout << "-- Settings associated to the Marlin F033C camera with distortion ------"
79  << std::endl;
82  std::cout << viper850 << std::endl;
83  viper850.getCameraParameters(cam, 640, 480);
84  std::cout << cam << std::endl;
85 
86 
87  std::cout << "-- Current joint position:" << std::endl;
88  vpColVector q;
90  std::cout << " " << q.t() << std::endl;
91 
92  std::cout << "-- Current fMe:" << std::endl;
93 
95  viper850.get_fMe(q, fMe);
97  fMe.extract(t);
99  fMe.extract(R);
100  vpRzyzVector rzyz;
101  rzyz.buildFrom(R);
102 
103  std::cout << "fMe:" << std::endl
104  << "\tt: " << t.t() << std::endl
105  << "\trzyz (deg): " << vpMath::deg(rzyz[0])
106  << " " << vpMath::deg(rzyz[1])
107  << " " << vpMath::deg(rzyz[2]) << std::endl;
108 
109  }
110  catch(vpException &e) {
111  std::cout << "Catch an exception: " << e << std::endl;
112  }
113  return 0;
114 }
115 #else
116 int main()
117 {
118  std::cout << "The real Viper850 robot controller is not available." << std::endl;
119  return 0;
120 }
121 
122 #endif
void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height) const
Definition: vpViper850.cpp:564
Control of Irisa's Viper S850 robot named Viper850.
vpRzyzVector buildFrom(const vpRotationMatrix &R)
error that can be emited by ViSP classes.
Definition: vpException.h:73
Implementation of a rotation matrix and operations on such kind of matrices.
vpRowVector t() const
Generic class defining intrinsic camera parameters.
void extract(vpRotationMatrix &R) const
void get_fMe(const vpColVector &q, vpHomogeneousMatrix &fMe) const
Definition: vpViper.cpp:733
vpRowVector t() const
Perspective projection with distortion model.
static double deg(double rad)
Definition: vpMath.h:97
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRzyzVector.h:151
Class that consider the case of a translation vector.