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)
73 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
77 int opt_normalized = 1;
80 vpParseArgv::vpArgvInfo argTable[] =
82 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
84 "Disable display and graphics viewer."},
87 "1 to use normalized features, 0 for non normalized."},
101 std::cout <<
"Used options: " << std::endl;
102 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
103 opt_curves = opt_display;
104 std::cout <<
" - display : " << opt_display << std::endl;
105 std::cout <<
" - curves : " << opt_curves << std::endl;
107 std::cout <<
" - normalized: " << opt_normalized << std::endl;
111 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)
114 #if defined(VISP_HAVE_X11)
116 #elif defined VISP_HAVE_GDI
123 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
138 for (
int i=0; i<4; i++) {
143 for (
int i=0; i<4; i++) {
149 for (
int i=0; i <2; i++)
151 if (opt_normalized) {
171 for (
int i=0; i <2; i++)
174 #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
177 for (
int i=0; i <2; i++) {
185 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
190 graph =
new vpPlot(2, 500, 500, 700, 10,
"Curves...");
202 float sampling_time = 0.010f ;
210 for (
int i=0; i <4; i++)
213 for (
int i=0; i <2; i++)
216 #if (defined (VISP_HAVE_X11) || defined(VISP_HAVE_GDI))
219 for (
int i=0; i <2; i++) {
230 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
233 graph->
plot(0, iter, v);
241 }
while(( task.
getError() ).sumSquare() > 0.0005);
247 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
251 #if (defined (VISP_HAVE_X11) || defined (VISP_HAVE_GDI))
252 if (opt_display && display != NULL)
256 std::cout <<
"final error=" << ( task.
getError() ).sumSquare() << std::endl;
260 std::cout <<
"Catch an exception: " << e << 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)
error that can be emited by ViSP classes.
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)
vpColVector getError() const
vpColVector computeControlLaw()
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)
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)
void setServo(const vpServoType &servo_type)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &v)
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