54 #include <visp/vpConfig.h>
55 #include <visp/vpDebug.h>
58 #if (defined(VISP_HAVE_COIN_AND_GUI) && (defined(VISP_HAVE_GTK) || defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)))
60 #include <visp/vpImage.h>
61 #include <visp/vpCameraParameters.h>
62 #include <visp/vpTime.h>
63 #include <visp/vpImage.h>
64 #include <visp/vpImageConvert.h>
65 #include <visp/vpSimulator.h>
67 #if defined(VISP_HAVE_X11)
68 # include <visp/vpDisplayX.h>
69 #elif defined(VISP_HAVE_GDI)
70 # include <visp/vpDisplayGDI.h>
71 #elif defined(VISP_HAVE_GTK)
72 # include <visp/vpDisplayGTK.h>
77 #include <visp/vpMath.h>
78 #include <visp/vpHomogeneousMatrix.h>
79 #include <visp/vpPose.h>
80 #include <visp/vpFeaturePoint.h>
81 #include <visp/vpDot2.h>
82 #include <visp/vpServo.h>
83 #include <visp/vpServoDisplay.h>
84 #include <visp/vpRobotCamera.h>
85 #include <visp/vpFeatureBuilder.h>
86 #include <visp/vpIoTools.h>
89 void *mainLoop (
void *_simu)
127 for (
int i = 0 ; i < 4 ; i++)
128 point[i].project(cMo_d) ;
132 for (
int i = 0 ; i < 4 ; i++)
146 #if defined(VISP_HAVE_X11)
148 #elif defined(VISP_HAVE_GDI)
150 #elif defined(VISP_HAVE_GTK)
153 disp.
init(I,100,100,
"Simulation display");
164 std::cout <<
"A click in the four dots clockwise. " << std::endl;
167 for (
int i = 0 ; i < 4 ; i++)
171 std::cout <<
"A click in the dot " << i << std::endl;
197 for (
int i = 0 ; i < 4 ; i++)
217 for (
int i = 0 ; i < 4 ; i++)
271 std::cout <<
"Load : ./4Points.iv" << std::endl
272 <<
"This file should be in the working directory" << std::endl;
274 simu.
load(
"./4points.iv") ;
285 {
vpTRACE(
"You should install Coin3D and SoQT or SoWin or SoXt") ;
Definition of the vpMatrix class.
virtual void initInternalViewer(const unsigned int nlig, const unsigned int ncol)
initialize the camera view
static void display(vpServo &s, const vpCameraParameters &cam, vpImage< unsigned char > &I, vpColor currentColor=vpColor::green, vpColor desiredColor=vpColor::red, unsigned int thickness=1)
void setCameraPosition(vpHomogeneousMatrix &cMf)
set the camera position (from an homogeneous matrix)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void setPosition(const vpHomogeneousMatrix &cMw)
Implementation of a simulator based on Coin3d (www.coin3d.org).
Display for windows using GDI (available on any windows 32 platform).
unsigned int getInternalHeight() const
void closeMainApplication()
Define the X11 console to display images.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
create a new ste of two visual features
void setLambda(double _lambda)
set the gain lambda
void init(vpImage< unsigned char > &I, int winx=-1, int winy=-1, const char *title=NULL)
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
void getCameraParameters(vpCameraParameters &cam)
get the intrinsic parameters of the camera
static double measureTimeMs()
virtual void mainLoop()
activate the mainloop
static int wait(double t0, double t)
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
void track(const vpImage< unsigned char > &I)
void set_cVe(vpVelocityTwistMatrix &_cVe)
static void flush(const vpImage< unsigned char > &I)
Class that defines what is a point.
void getInternalImage(vpImage< unsigned char > &I)
get an Image of the internal view
virtual void setSamplingTime(const double &delta_t)
void kill()
destruction (memory deallocation if required)
void initApplication(void *(*start_routine)(void *))
begin the main program
vpColVector computeControlLaw()
compute the desired control law
Class that defines the simplest robot: a free flying camera.
static void display(const vpImage< unsigned char > &I)
void setInternalCameraParameters(vpCameraParameters &cam)
set internal camera parameters
void set_eJe(vpMatrix &_eJe)
Generic class defining intrinsic camera parameters.
The vpDisplayGTK allows to display image using the GTK+ library version 1.2.
void load(const char *file_name)
load an iv file
Class that consider the particular case of twist transformation matrix that allows to transform a vel...
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
Set the type of the interaction matrix (current, mean, desired, user).
static double rad(double deg)
void getPosition(vpHomogeneousMatrix &cMw) const
void initMainApplication()
perform some initialization in the main program thread
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void get_eJe(vpMatrix &eJe)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
unsigned int getInternalWidth() const
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Class required to compute the visual servoing control law descbribed in and .
void initExternalViewer(const unsigned int nlig, const unsigned int ncol)
initialize the external view
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &v)
void setServo(vpServoType _servo_type)
Choice of the visual servoing control law.
void setGraphics(const bool activate)
void setWorldCoordinates(const double ox, const double oy, const double oz)
Set the point world coordinates. We mean here the coordinates of the point in the object frame...