 |
Visual Servoing Platform
version 3.3.0
|
52 #include <visp3/core/vpConfig.h>
53 #include <visp3/core/vpDebug.h>
55 #if (defined(VISP_HAVE_COIN3D_AND_GUI) && (defined(VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)))
57 #include <visp3/ar/vpSimulator.h>
58 #include <visp3/core/vpCameraParameters.h>
59 #include <visp3/core/vpImage.h>
60 #include <visp3/core/vpImageConvert.h>
61 #include <visp3/core/vpTime.h>
63 #if defined(VISP_HAVE_X11)
64 #include <visp3/gui/vpDisplayX.h>
65 #elif defined(VISP_HAVE_GDI)
66 #include <visp3/gui/vpDisplayGDI.h>
67 #elif defined(VISP_HAVE_GTK)
68 #include <visp3/gui/vpDisplayGTK.h>
73 #include <visp3/blob/vpDot2.h>
74 #include <visp3/core/vpHomogeneousMatrix.h>
75 #include <visp3/core/vpIoTools.h>
76 #include <visp3/core/vpMath.h>
77 #include <visp3/robot/vpSimulatorCamera.h>
78 #include <visp3/vision/vpPose.h>
79 #include <visp3/visual_features/vpFeatureBuilder.h>
80 #include <visp3/visual_features/vpFeaturePoint.h>
81 #include <visp3/vs/vpServo.h>
82 #include <visp3/vs/vpServoDisplay.h>
84 static void *mainLoop(
void *_simu)
125 for (
int i = 0; i < 4; i++)
126 point[i].project(cMo_d);
130 for (
int i = 0; i < 4; i++)
142 #if defined(VISP_HAVE_X11)
144 #elif defined(VISP_HAVE_GDI)
146 #elif defined(VISP_HAVE_GTK)
149 disp.
init(I, 100, 100,
"Simulation display");
160 std::cout <<
"A click in the four dots clockwise. " << std::endl;
163 for (
int i = 0; i < 4; i++) {
166 std::cout <<
"A click in the dot " << i << std::endl;
191 for (
int i = 0; i < 4; i++)
211 for (
int i = 0; i < 4; i++) {
268 std::string filename =
"./4points.iv";
274 std::cout <<
"Load : " << filename << std::endl <<
"This file should be in the working directory" << std::endl;
276 simu.
load(filename.c_str());
284 std::cout <<
"Catch an exception: " << e << std::endl;
292 std::cout <<
"You do not have X11, GTK, or OpenCV, or GDI (Graphical Device Interface) functionalities to display images..." << std::endl;
293 std::cout <<
"Tip if you are on a unix-like system:" << std::endl;
294 std::cout <<
"- Install X11, configure again ViSP using cmake and build again this example" << std::endl;
295 std::cout <<
"Tip if you are on a windows-like system:" << std::endl;
296 std::cout <<
"- Install GDI, configure again ViSP using cmake and build again this example" << std::endl;
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
virtual void mainLoop()
activate the mainloop
void initExternalViewer(unsigned int nlig, unsigned int ncol)
initialize the external view
VISP_EXPORT int wait(double t0, double t)
static double rad(double deg)
Generic class defining intrinsic camera parameters.
void set_eJe(const vpMatrix &eJe_)
void getInternalImage(vpImage< unsigned char > &I)
get an Image of the internal view
void setPosition(const vpHomogeneousMatrix &wMc)
Display for windows using GDI (available on any windows 32 platform).
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
void initApplication(void *(*start_routine)(void *))
begin the main program
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
void load(const char *file_name)
load an iv file
void set_cVe(const vpVelocityTwistMatrix &cVe_)
Class that defines the simplest robot: a free flying camera.
Implementation of column vector and the associated operations.
unsigned int getInternalHeight() const
void initMainApplication()
perform some initialization in the main program thread
Implementation of a matrix and operations on matrices.
void setServo(const vpServoType &servo_type)
VISP_EXPORT double measureTimeMs()
void getCameraParameters(vpCameraParameters &cam)
get the intrinsic parameters of the camera
vpHomogeneousMatrix getPosition() const
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
static void display(const vpImage< unsigned char > &I)
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
void setWorldCoordinates(double oX, double oY, double oZ)
unsigned int getInternalWidth() const
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
void get_eJe(vpMatrix &eJe)
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
void setInternalCameraParameters(vpCameraParameters &cam)
set internal camera parameters
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)
virtual void initInternalViewer(unsigned int nlig, unsigned int ncol)
initialize the camera view
vpColVector computeControlLaw()
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const std::string &title="")
static void flush(const vpImage< unsigned char > &I)
virtual void setSamplingTime(const double &delta_t)
vpHomogeneousMatrix inverse() const
void track(const vpImage< unsigned char > &I, bool canMakeTheWindowGrow=true)
Class that defines what is a point.
void setCameraPosition(vpHomogeneousMatrix &cMf)
set the camera position (from an homogeneous matrix)
Implementation of a simulator based on Coin3d (www.coin3d.org).
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.
void closeMainApplication()
void setGraphics(bool activate)