22#include <visp3/core/vpConfig.h>
23#include <visp3/core/vpHomogeneousMatrix.h>
24#include <visp3/core/vpVelocityTwistMatrix.h>
25#include <visp3/gui/vpPlot.h>
26#include <visp3/robot/vpSimulatorPioneerPan.h>
27#include <visp3/visual_features/vpFeatureBuilder.h>
28#include <visp3/visual_features/vpFeatureDepth.h>
29#include <visp3/visual_features/vpFeaturePoint.h>
30#include <visp3/vs/vpServo.h>
34#if defined(ENABLE_VISP_NAMESPACE)
46 cMo[1][3] = cdMo[1][3];
56 robot.getPosition(wMc);
71 cVe = robot.get_cVe();
94 double Z = point.
get_Z();
96 double Zd = cdMo[2][3];
102 task.addFeature(s_Z, s_Zd);
104#ifdef VISP_HAVE_DISPLAY
106 vpPlot graph(3, 800, 500, 400, 10,
"Curves...");
109 graph.initGraph(0, 3);
110 graph.initGraph(1, 2);
111 graph.initGraph(2, 1);
112 graph.setTitle(0,
"Velocities");
113 graph.setTitle(1,
"Error s-s*");
114 graph.setTitle(2,
"Depth");
115 graph.setLegend(0, 0,
"vx");
116 graph.setLegend(0, 1,
"wz");
117 graph.setLegend(0, 2,
"qdot_pan");
118 graph.setLegend(1, 0,
"x");
119 graph.setLegend(1, 1,
"log(Z/Z*)");
120 graph.setLegend(2, 0,
"Z");
125 robot.getPosition(wMc);
150#ifdef VISP_HAVE_DISPLAY
151 graph.plot(0, iter, v);
152 graph.plot(1, iter,
task.getError());
153 graph.plot(2, 0, iter, Z);
157 if (
task.getError().sumSquare() < 0.0001) {
158 std::cout <<
"Reached a small error. We stop the loop... " << std::endl;
162#ifdef VISP_HAVE_DISPLAY
163 const char *legend =
"Click to quit...";
173 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 vpDot &d)
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
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 ...
virtual void setSamplingTime(const double &delta_t)
Implementation of a rotation matrix and operations on such kind of matrices.
Class that defines the Pioneer mobile robot simulator equipped with a camera able to move in pan.