2 #include <visp/vpFeatureBuilder.h>
3 #include <visp/vpServo.h>
4 #include <visp/vpSimulatorCamera.h>
5 #include <visp/vpPlot.h>
25 for (
unsigned int i = 0 ; i < 4 ; i++) {
39 #ifdef VISP_HAVE_DISPLAY
40 vpPlot plotter(2, 250*2, 500, 100, 200,
"Real time curves plotter");
41 plotter.setTitle(0,
"Visual features error");
42 plotter.setTitle(1,
"Camera velocities");
44 plotter.initGraph(0, 8);
45 plotter.initGraph(1, 6);
47 plotter.setLegend(0, 0,
"x1");
48 plotter.setLegend(0, 1,
"y1");
49 plotter.setLegend(0, 2,
"x2");
50 plotter.setLegend(0, 3,
"y2");
51 plotter.setLegend(0, 4,
"x3");
52 plotter.setLegend(0, 5,
"y3");
53 plotter.setLegend(0, 6,
"x4");
54 plotter.setLegend(0, 7,
"y4");
56 plotter.setLegend(1, 0,
"v_x");
57 plotter.setLegend(1, 1,
"v_y");
58 plotter.setLegend(1, 2,
"v_z");
59 plotter.setLegend(1, 3,
"w_x");
60 plotter.setLegend(1, 4,
"w_y");
61 plotter.setLegend(1, 5,
"w_z");
64 unsigned int iter = 0;
68 for (
unsigned int i = 0 ; i < 4 ; i++) {
75 #ifdef VISP_HAVE_DISPLAY
76 plotter.plot(0, iter, task.
getError());
77 plotter.plot(1, iter, v);
79 if (( task.
getError() ).sumSquare() < 0.0001)
84 std::cout <<
"Convergence in " << iter <<
" iterations" << std::endl;
88 #ifdef VISP_HAVE_DISPLAY
89 plotter.saveData(0,
"error.dat");
90 plotter.saveData(1,
"vc.dat");
96 std::cout <<
"Catch an 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.
void track(const vpHomogeneousMatrix &cMo)
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
Class that defines what is a point.
virtual void setSamplingTime(const double &delta_t)
vpColVector getError() const
vpColVector computeControlLaw()
void getPosition(vpHomogeneousMatrix &wMc) const
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...
vpHomogeneousMatrix inverse() const
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
virtual bool getClick(bool blocking=true)=0
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
void setServo(const vpServoType &servo_type)
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...