 |
Visual Servoing Platform
version 3.2.0
|
2 #include <visp3/gui/vpDisplayGDI.h>
3 #include <visp3/gui/vpDisplayOpenCV.h>
4 #include <visp3/gui/vpDisplayX.h>
5 #include <visp3/gui/vpProjectionDisplay.h>
6 #include <visp3/robot/vpSimulatorCamera.h>
7 #include <visp3/visual_features/vpFeatureBuilder.h>
8 #include <visp3/vs/vpServo.h>
9 #include <visp3/vs/vpServoDisplay.h>
17 static std::vector<vpImagePoint> traj[4];
19 for (
unsigned int i = 0; i < 4; i++) {
21 point[i].project(cMo);
23 traj[i].push_back(cog);
25 for (
unsigned int i = 0; i < 4; i++) {
26 for (
unsigned int j = 1; j < traj[i].size(); j++) {
38 std::vector<vpPoint> point;
39 point.push_back(
vpPoint(-0.1, -0.1, 0));
40 point.push_back(
vpPoint(0.1, -0.1, 0));
41 point.push_back(
vpPoint(0.1, 0.1, 0));
42 point.push_back(
vpPoint(-0.1, 0.1, 0));
50 for (
unsigned int i = 0; i < 4; i++) {
66 #if defined(VISP_HAVE_X11)
67 vpDisplayX displayInt(Iint, 0, 0,
"Internal view");
68 vpDisplayX displayExt(Iext, 670, 0,
"External view");
69 #elif defined(VISP_HAVE_GDI)
72 #elif defined(VISP_HAVE_OPENCV)
76 std::cout <<
"No image viewer is available..." << std::endl;
79 #if defined(VISP_HAVE_DISPLAY)
81 for (
unsigned int i = 0; i < 4; i++)
82 externalview.
insert(point[i]);
90 for (
unsigned int i = 0; i < 4; i++) {
99 display_trajectory(Iint, point, cMo, cam);
102 #if defined(VISP_HAVE_DISPLAY)
116 std::cout <<
"Catch an exception: " << e << std::endl;
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
VISP_EXPORT int wait(double t0, double t)
static double rad(double deg)
Generic class defining intrinsic camera parameters.
double getSamplingTime() const
Display for windows using GDI (available on any windows 32 platform).
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Class that defines the simplest robot: a free flying camera.
Implementation of column vector and the associated operations.
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
void setServo(const vpServoType &servo_type)
vpHomogeneousMatrix getPosition() const
static const vpColor green
static void display(const vpImage< unsigned char > &I)
unsigned int getHeight() const
void display(vpImage< unsigned char > &I, const vpHomogeneousMatrix &cextMo, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color, const bool &displayTraj=false, const unsigned int thickness=1)
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
vpColVector computeControlLaw()
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
static void flush(const vpImage< unsigned char > &I)
virtual void setSamplingTime(const double &delta_t)
interface with the image for feature display
vpHomogeneousMatrix inverse() const
Class that defines what is a point.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
void insert(vpForwardProjection &fp)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
static void display(const vpServo &s, const vpCameraParameters &cam, const vpImage< unsigned char > &I, vpColor currentColor=vpColor::green, vpColor desiredColor=vpColor::red, unsigned int thickness=1)
error that can be emited by ViSP classes.
unsigned int getWidth() const