ViSP  2.9.0
testRobotViper850.cpp
1 /****************************************************************************
2  *
3  * $Id: testRobotViper850.cpp 4574 2014-01-09 08:48:51Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2014 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  }
114  catch(vpException e) {
115  std::cout << "Catch an exception: " << e << std::endl;
116  }
117  return 0;
118 }
119 #else
120 int main()
121 {
122  std::cout << "The real Viper850 robot controller is not available." << std::endl;
123  return 0;
124 }
125 
126 #endif
void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height) const
Definition: vpViper850.cpp:580
Control of Irisa's Viper S850 robot named Viper850.
error that can be emited by ViSP classes.
Definition: vpException.h:76
The vpRotationMatrix considers the particular case of a rotation matrix.
vpRowVector t() const
transpose of Vector
Generic class defining intrinsic camera parameters.
void extract(vpRotationMatrix &R) const
void get_fMe(const vpColVector &q, vpHomogeneousMatrix &fMe) const
Definition: vpViper.cpp:732
Perspective projection with distortion model.
static double deg(double rad)
Definition: vpMath.h:93
Class that provides a data structure for the column vectors as well as a set of operations on these v...
Definition: vpColVector.h:72
Class that consider the case of the Euler angles using the z-y-z convention, where are respectively...
Definition: vpRzyzVector.h:150
void buildFrom(const double phi, const double theta, const double psi)
Definition: vpRzyzVector.h:182
Class that consider the case of a translation vector.