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"
69 void usage(
const char *name,
const char *badparam);
70 bool getOptions(
int argc,
const char **argv);
79 void usage(
const char *name,
const char *badparam)
82 Simulation of avisual servoing using theta U visual feature:\n\
83 - eye-in-hand control law,\n\
84 - velocity computed in the camera frame,\n\
97 fprintf(stdout,
"\nERROR: Bad parameter [%s]\n", badparam);
110 bool getOptions(
int argc,
const char **argv)
117 case 'h': usage(argv[0], NULL);
return false;
break;
120 usage(argv[0], optarg_);
125 if ((c == 1) || (c == -1)) {
127 usage(argv[0], NULL);
128 std::cerr <<
"ERROR: " << std::endl;
129 std::cerr <<
" Bad argument " << optarg_ << std::endl << std::endl;
137 main(
int argc,
const char ** argv)
141 if (getOptions(argc, argv) ==
false) {
148 std::cout << std::endl ;
149 std::cout <<
"-------------------------------------------------------" << std::endl ;
150 std::cout <<
" Test program for vpServo " <<std::endl ;
151 std::cout <<
" Eye-in-hand task control, velocity computed in the camera frame" << std::endl ;
152 std::cout <<
" Simulation " << std::endl ;
153 std::cout <<
" task : servo using theta U visual feature " << std::endl ;
154 std::cout <<
"-------------------------------------------------------" << std::endl ;
155 std::cout << std::endl ;
195 unsigned int iter=0 ;
199 std::cout <<
"---------------------------------------------" << iter <<std::endl ;
217 std::cout <<
"|| s - s* || = " << ( task.
getError() ).sumSquare() <<std::endl ; ;
226 std::cout <<
"Catch a ViSP exception: " << e << std::endl;
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
Class that defines the simplest robot: a free flying camera.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
error that can be emited by ViSP classes.
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
vpColVector getError() const
vpColVector computeControlLaw()
void getPosition(vpHomogeneousMatrix &wMc) const
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
Construction from translation vector and rotation matrix.
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
The pose is a complete representation of every rigid motion in the euclidian space.
vpHomogeneousMatrix inverse() const
Class that defines a 3D visual feature from a axis/angle parametrization that represent the rotatio...
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
void setServo(const vpServoType &servo_type)