ViSP  2.9.0
testRobotAfma6.cpp
1 /****************************************************************************
2  *
3  * $Id: testRobotAfma6.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 
49 #include <visp/vpRobotAfma6.h>
50 #include <visp/vpDebug.h>
51 #include <visp/vpCameraParameters.h>
52 
53 #include <iostream>
54 
55 
56 #ifdef VISP_HAVE_AFMA6
57 
58 int main()
59 {
60  try {
61 
62  std::cout << "a test for vpRobotAfma6 class..." << std::endl;
63 
64  vpRobotAfma6 afma6;
66 
67  std::cout << "-- Default settings for Afma6 ---"
68  << std::endl;
69  std::cout << afma6 << std::endl;
70  afma6.getCameraParameters(cam, 640, 480);
71  std::cout << cam << std::endl;
72 
73  std::cout << "-- Settings associated to the CCMOP tool without distortion ---"
74  << std::endl;
75  afma6.init( vpAfma6::TOOL_CCMOP);
76 
77  std::cout << afma6 << std::endl;
78  afma6.getCameraParameters(cam, 640, 480);
79  std::cout << cam << std::endl;
80 
81  std::cout << "-- Settings associated to CCMOP tool with distortion ------"
82  << std::endl;
85  std::cout << afma6 << std::endl;
86  afma6.getCameraParameters(cam, 640, 480);
87  std::cout << cam << std::endl;
88 
89  std::cout << "-- Settings associated to the gripper tool without distortion ---"
90  << std::endl;
92 
93  std::cout << afma6 << std::endl;
94  afma6.getCameraParameters(cam, 640, 480);
95  std::cout << cam << std::endl;
96 
97  std::cout << "-- Settings associated to gripper tool with distortion ------"
98  << std::endl;
101  std::cout << afma6 << std::endl;
102  afma6.getCameraParameters(cam, 640, 480);
103  std::cout << cam << std::endl;
104  }
105  catch(vpException e) {
106  std::cout << "Catch an exception: " << e << std::endl;
107  }
108  return 0;
109 }
110 #else
111 int main()
112 {
113  std::cout << "The real Afma6 robot controller is not available." << std::endl;
114  return 0;
115 }
116 
117 #endif
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height) const
Definition: vpAfma6.cpp:1248
error that can be emited by ViSP classes.
Definition: vpException.h:76
Control of Irisa's gantry robot named Afma6.
Definition: vpRobotAfma6.h:214
void init(void)
Generic class defining intrinsic camera parameters.
Perspective projection with distortion model.