Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
testViper850.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 Viper850 6 dof robot.
32  *
33  * Authors:
34  * Fabien Spindler
35  *
36  *****************************************************************************/
37 
47 #include <visp3/core/vpConfig.h>
48 #include <visp3/robot/vpViper850.h>
49 #include <visp3/core/vpDebug.h>
50 
51 #include <iostream>
52 
53 int main()
54 {
55  try {
56 
57  std::cout << "a test for vpViper850 class..." << std::endl;
58 
59  vpViper850 viper850;
61 
62  std::cout << "-- Default settings for Viper 850 ---"
63  << std::endl;
64  std::cout << viper850 << std::endl;
65  viper850.getCameraParameters(cam, 640, 480);
66  std::cout << cam << std::endl;
67 
68  std::cout << "-- Settings associated to the Marlin F033C camera without distortion ---"
69  << std::endl;
71 
72  std::cout << viper850 << std::endl;
73  viper850.getCameraParameters(cam, 640, 480);
74  std::cout << cam << std::endl;
75 
76  std::cout << "-- Settings associated to the Marlin F033C camera with distortion ------"
77  << std::endl;
80  std::cout << viper850 << std::endl;
81  viper850.getCameraParameters(cam, 640, 480);
82  std::cout << cam << std::endl;
83 
84  vpColVector qmotor(6);
85 #if 1
86  qmotor[0] = vpMath::rad(30);
87  qmotor[1] = vpMath::rad(-100);
88  qmotor[2] = vpMath::rad(180);
89  qmotor[3] = vpMath::rad(20);
90  qmotor[4] = vpMath::rad(90);
91  qmotor[5] = vpMath::rad(13.37);
92 #else
93  qmotor[0] = vpMath::rad(0);
94  qmotor[1] = vpMath::rad(0-90);
95  qmotor[2] = vpMath::rad(0);
96  qmotor[3] = vpMath::rad(0);
97  qmotor[4] = vpMath::rad(0);
98  qmotor[5] = vpMath::rad(0);
99 #endif
101  viper850.get_fMe(qmotor, fMe);
102 
104  fMe.extract(t);
106  fMe.extract(R);
107  vpRzyzVector r;
108  r.buildFrom(R);
109 
110  std::cout << "fMe:" << std::endl
111  << "\tt: " << t.t() << std::endl
112  << "\trzyz (rad): " << r.t() << std::endl
113  << "\trzyz (deg): " << vpMath::deg(r[0])
114  << " " << vpMath::deg(r[1])
115  << " " << vpMath::deg(r[2]) << std::endl;
116 
117  return 0;
118  }
119  catch(vpException &e) {
120  std::cout << "Catch an exception: " << e.getStringMessage() << std::endl;
121  return 1;
122  }
123 }
124 
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
vpRowVector t() const
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.
Generic class defining intrinsic camera parameters.
Modelisation of the ADEPT Viper 850 robot.
Definition: vpViper850.h:103
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 rad(double deg)
Definition: vpMath.h:104
static double deg(double rad)
Definition: vpMath.h:97
Implementation of column vector and the associated operations.
Definition: vpColVector.h:72
const std::string & getStringMessage(void) const
Send a reference (constant) related the error message (can be empty).
Implementation of a rotation vector as Euler angle minimal representation.
Definition: vpRzyzVector.h:151
void init(void)
Definition: vpViper850.cpp:134
Class that consider the case of a translation vector.