47 #include <visp/vpConfig.h>
48 #include <visp/vpCameraParameters.h>
49 #include <visp/vpDisplay.h>
50 #include <visp/vpDisplayGDI.h>
51 #include <visp/vpDisplayX.h>
52 #include <visp/vpFeatureBuilder.h>
53 #include <visp/vpFeatureSegment.h>
54 #include <visp/vpHomogeneousMatrix.h>
55 #include <visp/vpImage.h>
56 #include <visp/vpMath.h>
57 #include <visp/vpParseArgv.h>
58 #include <visp/vpPlot.h>
59 #include <visp/vpPoint.h>
60 #include <visp/vpRobotCamera.h>
61 #include <visp/vpServo.h>
70 int main(
int argc,
const char **argv)
72 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
76 int opt_normalized = 1;
79 vpParseArgv::vpArgvInfo argTable[] =
81 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
83 "Disable display and graphics viewer."},
86 "1 to use normalized features, 0 for non normalized."},
100 std::cout <<
"Used options: " << std::endl;
101 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
102 opt_curves = opt_display;
103 std::cout <<
" - display : " << opt_display << std::endl;
104 std::cout <<
" - curves : " << opt_curves << std::endl;
106 std::cout <<
" - normalized: " << opt_normalized << std::endl;
110 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)
113 #if defined(VISP_HAVE_X11)
115 #elif defined VISP_HAVE_GDI
122 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
137 for (
int i=0; i<4; i++) {
142 for (
int i=0; i<4; i++) {
148 for (
int i=0; i <2; i++)
150 if (opt_normalized) {
170 for (
int i=0; i <2; i++)
173 #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
176 for (
int i=0; i <2; i++) {
184 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
189 graph =
new vpPlot(2, 500, 500, 700, 10,
"Curves...");
201 float sampling_time = 0.010f ;
209 for (
int i=0; i <4; i++)
212 for (
int i=0; i <2; i++)
215 #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
218 for (
int i=0; i <2; i++) {
229 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
232 graph->
plot(0, iter, v);
240 }
while(( task.
getError() ).sumSquare() > 0.0005);
246 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
250 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
251 if (opt_display && display != NULL)
255 std::cout <<
"final error=" << ( task.
getError() ).sumSquare() << std::endl;
virtual void init(vpImage< unsigned char > &I, int x=-1, int y=-1, const char *title=NULL)=0
Class that defines generic functionnalities for display.
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void setPosition(const vpHomogeneousMatrix &cMw)
Display for windows using GDI (available on any windows 32 platform).
Define the X11 console to display images.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
create a new ste of two visual features
void setLambda(double _lambda)
set the gain lambda
void plot(const unsigned int graphNum, const unsigned int curveNum, const double x, const double y)
static double measureTimeMs()
static int wait(double t0, double t)
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
static bool parse(int *argcPtr, const char **argv, vpArgvInfo *argTable, int flags)
Class that defines what is a point.
virtual void setSamplingTime(const double &delta_t)
void kill()
destruction (memory deallocation if required)
vpColVector getError() const
vpColVector computeControlLaw()
compute the desired control law
Class that defines a 2D segment visual features. This class allow to consider two sets of visual feat...
Class that defines the simplest robot: a free flying camera.
static void display(const vpImage< unsigned char > &I)
Generic class defining intrinsic camera parameters.
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
Set the type of the interaction matrix (current, mean, desired, user).
static double rad(double deg)
void initGraph(unsigned int graphNum, unsigned int curveNbr)
void getPosition(vpHomogeneousMatrix &cMw) const
void setNormalized(bool normalized)
Command line argument parsing.
Class that provides a data structure for the column vectors as well as a set of operations on these v...
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Class required to compute the visual servoing control law descbribed in and .
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &v)
void setServo(vpServoType _servo_type)
Choice of the visual servoing control law.
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
void setWorldCoordinates(const double ox, const double oy, const double oz)
Set the point world coordinates. We mean here the coordinates of the point in the object frame...
void print(const unsigned int select=FEATURE_ALL) const