 |
Visual Servoing Platform
version 3.3.0
|
2 #include <visp3/gui/vpDisplayGDI.h>
3 #include <visp3/gui/vpDisplayOpenCV.h>
4 #include <visp3/gui/vpDisplayX.h>
5 #include <visp3/io/vpImageIo.h>
6 #include <visp3/robot/vpImageSimulator.h>
7 #include <visp3/robot/vpSimulatorCamera.h>
8 #include <visp3/visual_features/vpFeatureBuilder.h>
9 #include <visp3/vs/vpServo.h>
10 #include <visp3/vs/vpServoDisplay.h>
31 for (
int i = 0; i < 4; i++)
52 sim_.
init(target_, X_);
79 static std::vector<vpImagePoint> traj[4];
80 for (
unsigned int i = 0; i < 4; i++) {
81 traj[i].push_back(dot[i].getCog());
83 for (
unsigned int i = 0; i < 4; i++) {
84 for (
unsigned int j = 1; j < traj[i].size(); j++) {
92 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)
100 std::vector<vpPoint> point;
101 point.push_back(
vpPoint(-0.1, -0.1, 0));
102 point.push_back(
vpPoint(0.1, -0.1, 0));
103 point.push_back(
vpPoint(0.1, 0.1, 0));
104 point.push_back(
vpPoint(-0.1, 0.1, 0));
114 #if defined(VISP_HAVE_X11)
116 #elif defined(VISP_HAVE_GDI)
118 #elif defined(VISP_HAVE_OPENCV)
121 std::cout <<
"No image viewer is available..." << std::endl;
130 std::vector<vpDot2> dot(4);
132 for (
unsigned int i = 0; i < 4; i++) {
133 point[i].track(cdMo);
136 dot[i].setGraphics(
true);
137 dot[i].initTracking(I);
158 for (
unsigned int i = 0; i < 4; i++) {
163 point[i].changeFrame(cMo, cP);
169 display_trajectory(I, dot);
181 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...
void acquire(vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo)
VISP_EXPORT int wait(double t0, double t)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
void setInterpolationType(const vpInterpolationType interplt)
static double rad(double deg)
Generic class defining intrinsic camera parameters.
void setCameraPosition(const vpHomogeneousMatrix &cMt)
static void read(vpImage< unsigned char > &I, const std::string &filename)
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)
void init(const vpImage< unsigned char > &I, vpColVector *X)
Class which enables to project an image in the 3D space and get the view of a virtual camera.
void setCleanPreviousImage(const bool &clean, const vpColor &color=vpColor::white)
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 void display(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
unsigned int getHeight() const
vpVirtualGrabber(const std::string &filename, const vpCameraParameters &cam)
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
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)
void getImage(vpImage< unsigned char > &I, const vpCameraParameters &cam)
static const vpColor green
vpColVector computeControlLaw()
static void flush(const vpImage< unsigned char > &I)
virtual void setSamplingTime(const double &delta_t)
vpHomogeneousMatrix inverse() const
Class that defines what is a point.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
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