2 #include <visp3/gui/vpPlot.h> 3 #include <visp3/robot/vpSimulatorCamera.h> 4 #include <visp3/visual_features/vpFeatureBuilder.h> 5 #include <visp3/vs/vpServo.h> 27 for (
unsigned int i = 0; i < 4; i++) {
41 #ifdef VISP_HAVE_DISPLAY 42 vpPlot plotter(2, 250 * 2, 500, 100, 200,
"Real time curves plotter");
43 plotter.setTitle(0,
"Visual features error");
44 plotter.setTitle(1,
"Camera velocities");
46 plotter.initGraph(0, 8);
47 plotter.initGraph(1, 6);
49 plotter.setLegend(0, 0,
"x1");
50 plotter.setLegend(0, 1,
"y1");
51 plotter.setLegend(0, 2,
"x2");
52 plotter.setLegend(0, 3,
"y2");
53 plotter.setLegend(0, 4,
"x3");
54 plotter.setLegend(0, 5,
"y3");
55 plotter.setLegend(0, 6,
"x4");
56 plotter.setLegend(0, 7,
"y4");
58 plotter.setLegend(1, 0,
"v_x");
59 plotter.setLegend(1, 1,
"v_y");
60 plotter.setLegend(1, 2,
"v_z");
61 plotter.setLegend(1, 3,
"w_x");
62 plotter.setLegend(1, 4,
"w_y");
63 plotter.setLegend(1, 5,
"w_z");
66 unsigned int iter = 0;
70 for (
unsigned int i = 0; i < 4; i++) {
77 #ifdef VISP_HAVE_DISPLAY 78 plotter.plot(0, iter, task.
getError());
79 plotter.plot(1, iter, v);
81 if ((task.
getError()).sumSquare() < 0.0001)
86 std::cout <<
"Convergence in " << iter <<
" iterations" << std::endl;
90 #ifdef VISP_HAVE_DISPLAY 91 plotter.saveData(0,
"error.dat");
92 plotter.saveData(1,
"vc.dat");
97 std::cout <<
"Catch an exception: " << e << std::endl;
Adaptive gain computation.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
Implementation of an homogeneous matrix and operations on such kind of matrices.
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)
vpHomogeneousMatrix inverse() const
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
vpHomogeneousMatrix getPosition() const
Class that defines what is a point.
virtual void setSamplingTime(const double &delta_t)
vpColVector computeControlLaw()
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
void setWorldCoordinates(const double oX, const double oY, const double oZ)
Implementation of column vector and the associated operations.
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
vpColVector getError() const
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
void setServo(const vpServoType &servo_type)