Visual Servoing Platform  version 3.6.1 under development (2024-07-27)
servoSimuSphere.cpp
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See https://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Demonstration of the wireframe simulator with a simple visual servoing
33  *
34 *****************************************************************************/
35 
42 #include <cmath> // std::fabs
43 #include <limits> // numeric_limits
44 #include <stdlib.h>
45 
46 #include <visp3/core/vpCameraParameters.h>
47 #include <visp3/core/vpConfig.h>
48 #include <visp3/core/vpHomogeneousMatrix.h>
49 #include <visp3/core/vpImage.h>
50 #include <visp3/core/vpIoTools.h>
51 #include <visp3/core/vpMath.h>
52 #include <visp3/core/vpSphere.h>
53 #include <visp3/core/vpTime.h>
54 #include <visp3/core/vpVelocityTwistMatrix.h>
55 #include <visp3/gui/vpDisplayD3D.h>
56 #include <visp3/gui/vpDisplayGDI.h>
57 #include <visp3/gui/vpDisplayGTK.h>
58 #include <visp3/gui/vpDisplayOpenCV.h>
59 #include <visp3/gui/vpDisplayX.h>
60 #include <visp3/gui/vpPlot.h>
61 #include <visp3/io/vpImageIo.h>
62 #include <visp3/io/vpParseArgv.h>
63 #include <visp3/robot/vpSimulatorCamera.h>
64 #include <visp3/robot/vpWireFrameSimulator.h>
65 #include <visp3/visual_features/vpFeatureBuilder.h>
66 #include <visp3/visual_features/vpGenericFeature.h>
67 #include <visp3/vs/vpServo.h>
68 
69 #define GETOPTARGS "dhp"
70 
71 #if defined(VISP_HAVE_DISPLAY) && (defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))
72 
73 #if defined(ENABLE_VISP_NAMESPACE)
74 using namespace VISP_NAMESPACE_NAME;
75 #endif
76 
85 void usage(const char *name, const char *badparam)
86 {
87  fprintf(stdout, "\n\
88 Demonstration of the wireframe simulator with a simple visual servoing.\n\
89  \n\
90 The visual servoing consists in bringing the camera at a desired position from the object.\n\
91  \n\
92 The visual features used to compute the pose of the camera and thus the control law are special moments computed with the sphere's parameters.\n\
93  \n\
94 SYNOPSIS\n\
95  %s [-d] [-p] [-h]\n",
96  name);
97 
98  fprintf(stdout, "\n\
99 OPTIONS: Default\n\
100  -d \n\
101  Turn off the display.\n\
102  \n\
103  -p \n\
104  Turn off the plotter.\n\
105  \n\
106  -h\n\
107  Print the help.\n");
108 
109  if (badparam)
110  fprintf(stdout, "\nERROR: Bad parameter [%s]\n", badparam);
111 }
112 
125 bool getOptions(int argc, const char **argv, bool &display, bool &plot)
126 {
127  const char *optarg_;
128  int c;
129  while ((c = vpParseArgv::parse(argc, argv, GETOPTARGS, &optarg_)) > 1) {
130 
131  switch (c) {
132  case 'd':
133  display = false;
134  break;
135  case 'p':
136  plot = false;
137  break;
138  case 'h':
139  usage(argv[0], nullptr);
140  return false;
141 
142  default:
143  usage(argv[0], optarg_);
144  return false;
145  }
146  }
147 
148  if ((c == 1) || (c == -1)) {
149  // standalone param or error
150  usage(argv[0], nullptr);
151  std::cerr << "ERROR: " << std::endl;
152  std::cerr << " Bad argument " << optarg_ << std::endl << std::endl;
153  return false;
154  }
155 
156  return true;
157 }
158 
159 /*
160  Computes the virtual visual features corresponding to the sphere and stores
161  it in the generic feature.
162 
163  The visual feature vector is computed thanks to the following formula : s =
164  {sx, sy, sz} sx = gx*h2/(sqrt(h2+1) sx = gy*h2/(sqrt(h2+1) sz = sqrt(h2+1)
165 
166  with gx and gy the center of gravity of the ellipse,
167  with h2 = (gx²+gy²)/(4*n20*gy²+4*n02*gx²-8n11gxgy)
168  with n20,n02,n11 the second order centered moments of the sphere normalized by its area
169  (i.e., such that \f$n_{ij} = \mu_{ij}/a\f$ where \f$\mu_{ij}\f$ are the centered moments and a the area)
170 */
171 void computeVisualFeatures(const vpSphere &sphere, vpGenericFeature &s)
172 {
173  double gx = sphere.get_x();
174  double gy = sphere.get_y();
175  double n02 = sphere.get_n02();
176  double n20 = sphere.get_n20();
177  double n11 = sphere.get_n11();
178  double h2;
179  // if (gx != 0 || gy != 0)
180  if (std::fabs(gx) > std::numeric_limits<double>::epsilon() || std::fabs(gy) > std::numeric_limits<double>::epsilon())
181  h2 = (vpMath::sqr(gx) + vpMath::sqr(gy)) /
182  (4 * n20 * vpMath::sqr(gy) + 4 * n02 * vpMath::sqr(gx) - 8 * n11 * gx * gy);
183  else
184  h2 = 1 / (4 * n20);
185 
186  double sx = gx * h2 / (sqrt(h2 + 1));
187  double sy = gy * h2 / (sqrt(h2 + 1));
188  double sz = sqrt(h2 + 1); //(h2-(vpMath::sqr(sx)+vpMath::sqr(sy)-1))/(2*sqrt(h2));
189 
190  s.set_s(sx, sy, sz);
191 }
192 
193 /*
194  Computes the interaction matrix such as L = [-1/R*I3 [s]x]
195 
196  with R the radius of the sphere
197  with I3 the 3x3 identity matrix
198  with [s]x the skew matrix related to s
199 */
200 void computeInteractionMatrix(const vpGenericFeature &s, const vpSphere &sphere, vpMatrix &L)
201 {
202  L = 0;
203  L[0][0] = -1 / sphere.getR();
204  L[1][1] = -1 / sphere.getR();
205  L[2][2] = -1 / sphere.getR();
206 
207  double s0, s1, s2;
208  s.get_s(s0, s1, s2);
209 
210  vpTranslationVector c(s0, s1, s2);
211  vpMatrix sk;
212  sk = c.skew();
213 
214  for (unsigned int i = 0; i < 3; i++)
215  for (unsigned int j = 0; j < 3; j++)
216  L[i][j + 3] = sk[i][j];
217 }
218 
219 int main(int argc, const char **argv)
220 {
221  try {
222  bool opt_display = true;
223  bool opt_plot = true;
224 
225  // Read the command line options
226  if (getOptions(argc, argv, opt_display, opt_plot) == false) {
227  return EXIT_FAILURE;
228  }
229 
230  vpImage<vpRGBa> Iint(480, 640, vpRGBa(255));
231  vpImage<vpRGBa> Iext1(480, 640, vpRGBa(255));
232  vpImage<vpRGBa> Iext2(480, 640, vpRGBa(255));
233 
234 #if defined(VISP_HAVE_X11)
235  vpDisplayX display[3];
236 #elif defined(HAVE_OPENCV_HIGHGUI)
237  vpDisplayOpenCV display[3];
238 #elif defined(VISP_HAVE_GDI)
239  vpDisplayGDI display[3];
240 #elif defined(VISP_HAVE_D3D9)
241  vpDisplayD3D display[3];
242 #elif defined(VISP_HAVE_GTK)
243  vpDisplayGTK display[3];
244 #endif
245 
246  if (opt_display) {
247  // Display size is automatically defined by the image (I) size
248  display[0].init(Iint, 100, 100, "The internal view");
249  display[1].init(Iext1, 100, 100, "The first external view");
250  display[2].init(Iext2, 100, 100, "The second external view");
251  vpDisplay::setWindowPosition(Iint, 0, 0);
252  vpDisplay::setWindowPosition(Iext1, 750, 0);
253  vpDisplay::setWindowPosition(Iext2, 0, 550);
254  vpDisplay::display(Iint);
255  vpDisplay::flush(Iint);
256  vpDisplay::display(Iext1);
257  vpDisplay::flush(Iext1);
258  vpDisplay::display(Iext2);
259  vpDisplay::flush(Iext2);
260  }
261 
262  vpPlot *plotter = nullptr;
263 
264  vpServo task;
265  vpSimulatorCamera robot;
266  float sampling_time = 0.020f; // Sampling period in second
267  robot.setSamplingTime(sampling_time);
268 
269  // Since the task gain lambda is very high, we need to increase default
270  // max velocities
271  robot.setMaxTranslationVelocity(10);
273 
274  // Set initial position of the object in the camera frame
275  vpHomogeneousMatrix cMo(0, 0.1, 2.0, vpMath::rad(35), vpMath::rad(25), 0);
276  // Set desired position of the object in the camera frame
277  vpHomogeneousMatrix cdMo(0.0, 0.0, 0.8, vpMath::rad(0), vpMath::rad(0), vpMath::rad(0));
278  // Set initial position of the object in the world frame
279  vpHomogeneousMatrix wMo(0.0, 0.0, 0, 0, 0, 0);
280  // Position of the camera in the world frame
282  wMc = wMo * cMo.inverse();
283 
284  robot.setPosition(wMc);
285 
286  // The sphere
287  vpSphere sphere(0, 0, 0, 0.15);
288 
289  // Projection of the sphere
290  sphere.track(cMo);
291 
292  // Set the current visual feature
293  vpGenericFeature s(3);
294  computeVisualFeatures(sphere, s);
295 
296  // Projection of the points
297  sphere.track(cdMo);
298 
299  vpGenericFeature sd(3);
300  computeVisualFeatures(sphere, sd);
301 
302  vpMatrix L(3, 6);
303  computeInteractionMatrix(sd, sphere, L);
304  sd.setInteractionMatrix(L);
305 
308 
310  vpVelocityTwistMatrix cVe(cMe);
311  task.set_cVe(cVe);
312 
313  vpMatrix eJe;
314  robot.get_eJe(eJe);
315  task.set_eJe(eJe);
316 
317  task.addFeature(s, sd);
318 
319  task.setLambda(7);
320 
321  if (opt_plot) {
322  plotter = new vpPlot(2, 480, 640, 750, 550, "Real time curves plotter");
323  plotter->setTitle(0, "Visual features error");
324  plotter->setTitle(1, "Camera velocities");
325  plotter->initGraph(0, task.getDimension());
326  plotter->initGraph(1, 6);
327  plotter->setLegend(0, 0, "error_feat_sx");
328  plotter->setLegend(0, 1, "error_feat_sy");
329  plotter->setLegend(0, 2, "error_feat_sz");
330  plotter->setLegend(1, 0, "vc_x");
331  plotter->setLegend(1, 1, "vc_y");
332  plotter->setLegend(1, 2, "vc_z");
333  plotter->setLegend(1, 3, "wc_x");
334  plotter->setLegend(1, 4, "wc_y");
335  plotter->setLegend(1, 5, "wc_z");
336  }
337 
339 
340  // Set the scene
342 
343  // Initialize simulator frames
344  sim.set_fMo(wMo); // Position of the object in the world reference frame
345  sim.setCameraPositionRelObj(cMo); // Initial position of the object in the camera frame
346  sim.setDesiredCameraPosition(cdMo); // Desired position of the object in the camera frame
347 
348  // Set the External camera position
349  vpHomogeneousMatrix camMf(0.0, 0, 3.5, vpMath::rad(0), vpMath::rad(30), 0);
350  sim.setExternalCameraPosition(camMf);
351 
352  // Computes the position of a camera which is fixed in the object frame
353  vpHomogeneousMatrix camoMf(0, 0.0, 2.5, 0, vpMath::rad(140), 0);
354  camoMf = camoMf * (sim.get_fMo().inverse());
355 
356  // Set the parameters of the cameras (internal and external)
357  vpCameraParameters camera(1000, 1000, 320, 240);
358  sim.setInternalCameraParameters(camera);
359  sim.setExternalCameraParameters(camera);
360 
361  int max_iter = 10;
362 
363  if (opt_display) {
364  max_iter = 1000;
365  // Get the internal and external views
366  sim.getInternalImage(Iint);
367  sim.getExternalImage(Iext1);
368  sim.getExternalImage(Iext2, camoMf);
369 
370  // Display the object frame (current and desired position)
371  vpDisplay::displayFrame(Iint, cMo, camera, 0.2, vpColor::none);
372  vpDisplay::displayFrame(Iint, cdMo, camera, 0.2, vpColor::none);
373 
374  // Display the object frame the world reference frame and the camera
375  // frame
376  vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo() * cMo.inverse(), camera, 0.2, vpColor::none);
377  vpDisplay::displayFrame(Iext1, camMf * sim.get_fMo(), camera, 0.2, vpColor::none);
378  vpDisplay::displayFrame(Iext1, camMf, camera, 0.2, vpColor::none);
379 
380  // Display the world reference frame and the object frame
381  vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
382  vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);
383 
384  vpDisplay::displayText(Iint, 20, 20, "Click to start visual servo", vpColor::red);
385 
386  vpDisplay::flush(Iint);
387  vpDisplay::flush(Iext1);
388  vpDisplay::flush(Iext2);
389 
390  std::cout << "Click on a display" << std::endl;
391  while (!vpDisplay::getClick(Iint, false) && !vpDisplay::getClick(Iext1, false) &&
392  !vpDisplay::getClick(Iext2, false)) {
393  };
394  }
395 
396  // Print the task
397  task.print();
398 
399  int iter = 0;
400  bool stop = false;
401  vpColVector v;
402 
403  double t_prev, t = vpTime::measureTimeMs();
404 
405  while (iter++ < max_iter && !stop) {
406  t_prev = t;
407  t = vpTime::measureTimeMs();
408 
409  if (opt_display) {
410  vpDisplay::display(Iint);
411  vpDisplay::display(Iext1);
412  vpDisplay::display(Iext2);
413  }
414 
415  robot.get_eJe(eJe);
416  task.set_eJe(eJe);
417 
418  wMc = robot.getPosition();
419  cMo = wMc.inverse() * wMo;
420 
421  sphere.track(cMo);
422 
423  // Set the current visual feature
424  computeVisualFeatures(sphere, s);
425 
426  v = task.computeControlLaw();
428  sim.setCameraPositionRelObj(cMo);
429 
430  // Compute the position of the external view which is fixed in the
431  // object frame
432  camoMf.build(0, 0.0, 2.5, 0, vpMath::rad(150), 0);
433  camoMf = camoMf * (sim.get_fMo().inverse());
434 
435  if (opt_plot) {
436  plotter->plot(0, iter, task.getError());
437  plotter->plot(1, iter, v);
438  }
439 
440  if (opt_display) {
441  // Get the internal and external views
442  sim.getInternalImage(Iint);
443  sim.getExternalImage(Iext1);
444  sim.getExternalImage(Iext2, camoMf);
445 
446  // Display the object frame (current and desired position)
447  vpDisplay::displayFrame(Iint, cMo, camera, 0.2, vpColor::none);
448  vpDisplay::displayFrame(Iint, cdMo, camera, 0.2, vpColor::none);
449 
450  // Display the camera frame, the object frame the world reference
451  // frame
452  vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo() * cMo.inverse(), camera, 0.2,
453  vpColor::none);
454  vpDisplay::displayFrame(Iext1, sim.getExternalCameraPosition() * sim.get_fMo(), camera, 0.2, vpColor::none);
456 
457  // Display the world reference frame and the object frame
458  vpDisplay::displayFrame(Iext2, camoMf, camera, 0.2, vpColor::none);
459  vpDisplay::displayFrame(Iext2, camoMf * sim.get_fMo(), camera, 0.05, vpColor::none);
460 
461  vpDisplay::displayText(Iint, 20, 20, "Click to stop visual servo", vpColor::red);
462 
463  std::stringstream ss;
464  ss << "Loop time: " << t - t_prev << " ms";
465  vpDisplay::displayText(Iint, 40, 20, ss.str(), vpColor::red);
466 
467  if (vpDisplay::getClick(Iint, false)) {
468  stop = true;
469  }
470 
471  vpDisplay::flush(Iint);
472  vpDisplay::flush(Iext1);
473  vpDisplay::flush(Iext2);
474 
475  vpTime::wait(t, sampling_time * 1000); // Wait ms
476  }
477 
478  std::cout << "|| s - s* || = " << (task.getError()).sumSquare() << std::endl;
479  }
480 
481  if (opt_plot && plotter != nullptr) {
482  vpDisplay::display(Iint);
483  sim.getInternalImage(Iint);
484  vpDisplay::displayFrame(Iint, cMo, camera, 0.2, vpColor::none);
485  vpDisplay::displayFrame(Iint, cdMo, camera, 0.2, vpColor::none);
486  vpDisplay::displayText(Iint, 20, 20, "Click to quit", vpColor::red);
487  if (vpDisplay::getClick(Iint)) {
488  stop = true;
489  }
490  vpDisplay::flush(Iint);
491 
492  delete plotter;
493  }
494 
495  task.print();
496  return EXIT_SUCCESS;
497  }
498  catch (const vpException &e) {
499  std::cout << "Catch an exception: " << e << std::endl;
500  return EXIT_FAILURE;
501  }
502 }
503 #elif !(defined(VISP_HAVE_LAPACK) || defined(VISP_HAVE_EIGEN3) || defined(VISP_HAVE_OPENCV))
504 int main()
505 {
506  std::cout << "Cannot run this example: install Lapack, Eigen3 or OpenCV" << std::endl;
507  return EXIT_SUCCESS;
508 }
509 #else
510 int main()
511 {
512  std::cout << "You do not have X11, or GDI (Graphical Device Interface), or GTK functionalities to display images..."
513  << std::endl;
514  std::cout << "Tip if you are on a unix-like system:" << std::endl;
515  std::cout << "- Install X11, configure again ViSP using cmake and build again this example" << std::endl;
516  std::cout << "Tip if you are on a windows-like system:" << std::endl;
517  std::cout << "- Install GDI, configure again ViSP using cmake and build again this example" << std::endl;
518  return EXIT_SUCCESS;
519 }
520 #endif
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Definition: vpColVector.h:191
static const vpColor red
Definition: vpColor.h:217
static const vpColor none
Definition: vpColor.h:229
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed....
Definition: vpDisplayD3D.h:106
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:130
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
Definition: vpDisplayGTK.h:133
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
Definition: vpDisplayX.h:135
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1, const vpImagePoint &offset=vpImagePoint(0, 0), const std::string &frameName="", const vpColor &textColor=vpColor::black, const vpImagePoint &textOffset=vpImagePoint(15, 15))
static void flush(const vpImage< unsigned char > &I)
static void setWindowPosition(const vpImage< unsigned char > &I, int winx, int winy)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
Definition: vpException.h:60
void track(const vpHomogeneousMatrix &cMo)
Class that enables to define a feature or a set of features which are not implemented in ViSP as a sp...
void get_s(vpColVector &s) const
get the value of all the features.
void set_s(const vpColVector &s)
set the value of all the features.
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix inverse() const
static double rad(double deg)
Definition: vpMath.h:129
static double sqr(double x)
Definition: vpMath.h:203
Implementation of a matrix and operations on matrices.
Definition: vpMatrix.h:169
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Definition: vpParseArgv.cpp:70
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
Definition: vpPlot.h:112
void initGraph(unsigned int graphNum, unsigned int curveNbr)
Definition: vpPlot.cpp:203
void setLegend(unsigned int graphNum, unsigned int curveNum, const std::string &legend)
Definition: vpPlot.cpp:552
void plot(unsigned int graphNum, unsigned int curveNum, double x, double y)
Definition: vpPlot.cpp:270
void setTitle(unsigned int graphNum, const std::string &title)
Definition: vpPlot.cpp:510
Definition: vpRGBa.h:65
void get_eJe(vpMatrix &eJe) VP_OVERRIDE
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) VP_OVERRIDE
@ CAMERA_FRAME
Definition: vpRobot.h:84
void setMaxRotationVelocity(double maxVr)
Definition: vpRobot.cpp:261
void setMaxTranslationVelocity(double maxVt)
Definition: vpRobot.cpp:240
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
Definition: vpServo.cpp:380
@ EYEINHAND_L_cVe_eJe
Definition: vpServo.h:168
unsigned int getDimension() const
Definition: vpServo.cpp:366
void addFeature(vpBasicFeature &s_cur, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
Definition: vpServo.cpp:331
void set_cVe(const vpVelocityTwistMatrix &cVe_)
Definition: vpServo.h:1038
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
Definition: vpServo.cpp:171
void setLambda(double c)
Definition: vpServo.h:986
void set_eJe(const vpMatrix &eJe_)
Definition: vpServo.h:1101
void setServo(const vpServoType &servo_type)
Definition: vpServo.cpp:134
vpColVector getError() const
Definition: vpServo.h:510
vpColVector computeControlLaw()
Definition: vpServo.cpp:705
@ DESIRED
Definition: vpServo.h:208
Class that defines the simplest robot: a free flying camera.
Class that defines a 3D sphere in the object frame and allows forward projection of a 3D sphere in th...
Definition: vpSphere.h:80
double get_n02() const
Definition: vpSphere.h:106
double get_y() const
Definition: vpSphere.h:102
double get_n11() const
Definition: vpSphere.h:105
double get_x() const
Definition: vpSphere.h:101
double getR() const
Definition: vpSphere.h:111
double get_n20() const
Definition: vpSphere.h:104
Class that consider the case of a translation vector.
Implementation of a wire frame simulator. Compared to the vpSimulator class, it does not require thir...
vpHomogeneousMatrix getExternalCameraPosition() const
void setCameraPositionRelObj(const vpHomogeneousMatrix &cMo_)
void getInternalImage(vpImage< unsigned char > &I)
void initScene(const vpSceneObject &obj, const vpSceneDesiredObject &desiredObject)
void setExternalCameraPosition(const vpHomogeneousMatrix &cam_Mf)
void set_fMo(const vpHomogeneousMatrix &fMo_)
vpHomogeneousMatrix get_fMo() const
void setDesiredCameraPosition(const vpHomogeneousMatrix &cdMo_)
void setInternalCameraParameters(const vpCameraParameters &cam)
void setExternalCameraParameters(const vpCameraParameters &cam)
@ SPHERE
A 15cm radius sphere.
void getExternalImage(vpImage< unsigned char > &I)
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeMs()