ViSP  2.9.0
testViper850.cpp
1 /****************************************************************************
2  *
3  * $Id: testViper850.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 Viper850 6 dof robot.
36  *
37  * Authors:
38  * Fabien Spindler
39  *
40  *****************************************************************************/
41 
51 #include <visp/vpConfig.h>
52 #include <visp/vpViper850.h>
53 #include <visp/vpDebug.h>
54 
55 #include <iostream>
56 
57 int main()
58 {
59  try {
60 
61  std::cout << "a test for vpViper850 class..." << std::endl;
62 
63  vpViper850 viper850;
65 
66  std::cout << "-- Default settings for Viper 850 ---"
67  << std::endl;
68  std::cout << viper850 << std::endl;
69  viper850.getCameraParameters(cam, 640, 480);
70  std::cout << cam << std::endl;
71 
72  std::cout << "-- Settings associated to the Marlin F033C camera without distortion ---"
73  << std::endl;
75 
76  std::cout << viper850 << std::endl;
77  viper850.getCameraParameters(cam, 640, 480);
78  std::cout << cam << std::endl;
79 
80  std::cout << "-- Settings associated to the Marlin F033C camera with distortion ------"
81  << std::endl;
84  std::cout << viper850 << std::endl;
85  viper850.getCameraParameters(cam, 640, 480);
86  std::cout << cam << std::endl;
87 
88  vpColVector qmotor(6);
89 #if 1
90  qmotor[0] = vpMath::rad(30);
91  qmotor[1] = vpMath::rad(-100);
92  qmotor[2] = vpMath::rad(180);
93  qmotor[3] = vpMath::rad(20);
94  qmotor[4] = vpMath::rad(90);
95  qmotor[5] = vpMath::rad(13.37);
96 #else
97  qmotor[0] = vpMath::rad(0);
98  qmotor[1] = vpMath::rad(0-90);
99  qmotor[2] = vpMath::rad(0);
100  qmotor[3] = vpMath::rad(0);
101  qmotor[4] = vpMath::rad(0);
102  qmotor[5] = vpMath::rad(0);
103 #endif
105  viper850.get_fMe(qmotor, fMe);
106 
108  fMe.extract(t);
110  fMe.extract(R);
111  vpRzyzVector r;
112  r.buildFrom(R);
113 
114  std::cout << "fMe:" << std::endl
115  << "\tt: " << t.t() << std::endl
116  << "\trzyz (rad): " << r.t() << std::endl
117  << "\trzyz (deg): " << vpMath::deg(r[0])
118  << " " << vpMath::deg(r[1])
119  << " " << vpMath::deg(r[2]) << std::endl;
120 
121  return 0;
122  }
123  catch(vpException e) {
124  std::cout << "Catch an exception: " << e << std::endl;
125  return 1;
126  }
127 }
128 
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
vpRowVector t() const
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.
Modelisation of the ADEPT Viper 850 robot.
Definition: vpViper850.h:66
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 rad(double deg)
Definition: vpMath.h:100
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 init(void)
Definition: vpViper850.cpp:176
void buildFrom(const double phi, const double theta, const double psi)
Definition: vpRzyzVector.h:182
Class that consider the case of a translation vector.