59 #include <visp/vpFeatureThetaU.h>
60 #include <visp/vpFeatureTranslation.h>
61 #include <visp/vpHomogeneousMatrix.h>
62 #include <visp/vpMath.h>
63 #include <visp/vpParseArgv.h>
64 #include <visp/vpServo.h>
65 #include <visp/vpSimulatorCamera.h>
68 #define GETOPTARGS "h"
78 void usage(
const char *name,
const char *badparam)
81 Simulation of avisual servoing using theta U visual feature:\n\
82 - eye-in-hand control law,\n\
83 - velocity computed in the camera frame,\n\
96 fprintf(stdout,
"\nERROR: Bad parameter [%s]\n", badparam);
109 bool getOptions(
int argc,
const char **argv)
116 case 'h': usage(argv[0], NULL);
return false;
break;
119 usage(argv[0], optarg);
124 if ((c == 1) || (c == -1)) {
126 usage(argv[0], NULL);
127 std::cerr <<
"ERROR: " << std::endl;
128 std::cerr <<
" Bad argument " << optarg << std::endl << std::endl;
136 main(
int argc,
const char ** argv)
139 if (getOptions(argc, argv) ==
false) {
146 std::cout << std::endl ;
147 std::cout <<
"-------------------------------------------------------" << std::endl ;
148 std::cout <<
" Test program for vpServo " <<std::endl ;
149 std::cout <<
" Eye-in-hand task control, velocity computed in the camera frame" << std::endl ;
150 std::cout <<
" Simulation " << std::endl ;
151 std::cout <<
" task : servo using theta U visual feature " << std::endl ;
152 std::cout <<
"-------------------------------------------------------" << std::endl ;
153 std::cout << std::endl ;
193 unsigned int iter=0 ;
197 std::cout <<
"---------------------------------------------" << iter <<std::endl ;
215 std::cout <<
"|| s - s* || = " << ( task.
getError() ).sumSquare() <<std::endl ; ;