21 #include <visp3/core/vpConfig.h>
22 #include <visp3/core/vpHomogeneousMatrix.h>
23 #include <visp3/core/vpVelocityTwistMatrix.h>
24 #include <visp3/gui/vpPlot.h>
25 #include <visp3/robot/vpSimulatorPioneer.h>
26 #include <visp3/visual_features/vpFeatureBuilder.h>
27 #include <visp3/visual_features/vpFeatureDepth.h>
28 #include <visp3/visual_features/vpFeaturePoint.h>
29 #include <visp3/vs/vpServo.h>
33 #if defined(ENABLE_VISP_NAMESPACE)
43 cMo[1][3] = cdMo[1][3];
49 robot.setSamplingTime(0.04);
51 robot.getPosition(wMc);
75 double Z = point.get_Z();
76 double Zd = cdMo[2][3];
81 #ifdef VISP_HAVE_DISPLAY
83 vpPlot graph(3, 800, 500, 400, 10,
"Curves...");
86 graph.initGraph(0, 2);
87 graph.initGraph(1, 2);
88 graph.initGraph(2, 1);
89 graph.setTitle(0,
"Velocities");
90 graph.setTitle(1,
"Error s-s*");
91 graph.setTitle(2,
"Depth");
92 graph.setLegend(0, 0,
"vx");
93 graph.setLegend(0, 1,
"wz");
94 graph.setLegend(1, 0,
"x");
95 graph.setLegend(1, 1,
"log(Z/Z*)");
96 graph.setLegend(2, 0,
"Z");
101 robot.getPosition(wMc);
119 #ifdef VISP_HAVE_DISPLAY
120 graph.plot(0, iter, v);
121 graph.plot(1, iter, task.
getError());
122 graph.plot(2, 0, iter, Z);
128 std::cout <<
"Reached a small error. We stop the loop... " << std::endl;
132 #ifdef VISP_HAVE_DISPLAY
133 graph.saveData(0,
"./v2.dat");
134 graph.saveData(1,
"./error2.dat");
136 const char *legend =
"Click to quit...";
146 std::cout <<
"Catch an exception: " << e << std::endl;
Implementation of column vector and the associated operations.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void flush(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
error that can be emitted by ViSP classes.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t)
Class that defines a 3D point visual feature which is composed by one parameters that is that defin...
vpFeatureDepth & buildFrom(const double &x, const double &y, const double &Z, const double &LogZoverZstar)
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
vpFeaturePoint & buildFrom(const double &x, const double &y, const double &Z)
static unsigned int selectX()
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix inverse() const
void insert(const vpRotationMatrix &R)
Implementation of a matrix and operations on matrices.
This class enables real time drawing of 2D or 3D graphics. An instance of the class open a window whi...
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
void get_eJe(vpMatrix &eJe) VP_OVERRIDE
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) VP_OVERRIDE
Implementation of a rotation matrix and operations on such kind of matrices.
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
void addFeature(vpBasicFeature &s_cur, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
void set_cVe(const vpVelocityTwistMatrix &cVe_)
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
void set_eJe(const vpMatrix &eJe_)
void setServo(const vpServoType &servo_type)
vpColVector getError() const
vpColVector computeControlLaw()
Class that defines the Pioneer mobile robot simulator equipped with a static camera.
vpVelocityTwistMatrix get_cVe() const