46 #include <visp3/core/vpConfig.h>
47 #include <visp3/core/vpDebug.h>
49 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)
51 #include <visp3/core/vpCameraParameters.h>
52 #include <visp3/core/vpImage.h>
53 #include <visp3/core/vpImageConvert.h>
54 #include <visp3/core/vpTime.h>
55 #include <visp3/gui/vpDisplayGDI.h>
56 #include <visp3/gui/vpDisplayGTK.h>
57 #include <visp3/gui/vpDisplayOpenCV.h>
58 #include <visp3/gui/vpDisplayX.h>
60 #include <visp3/core/vpHomogeneousMatrix.h>
61 #include <visp3/core/vpIoTools.h>
62 #include <visp3/core/vpMath.h>
63 #include <visp3/robot/vpSimulatorCamera.h>
64 #include <visp3/vision/vpPose.h>
65 #include <visp3/visual_features/vpFeatureBuilder.h>
66 #include <visp3/visual_features/vpFeaturePoint.h>
67 #include <visp3/vs/vpServo.h>
68 #include <visp3/vs/vpServoDisplay.h>
82 robot.setSamplingTime(0.04);
84 robot.setPosition(wMc);
90 unsigned int height = 360;
91 unsigned int width = 480;
95 #if defined(VISP_HAVE_X11)
97 #elif defined(VISP_HAVE_GTK)
99 #elif defined(VISP_HAVE_GDI)
101 #elif defined(HAVE_OPENCV_HIGHGUI)
105 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GTK) || defined(VISP_HAVE_GDI) || defined(VISP_HAVE_OPENCV)
106 disp.
init(I, 100, 100,
"Simulation display");
124 for (
int i = 0; i < 4; i++)
125 point[i].project(cMo_d);
129 for (
int i = 0; i < 4; i++)
137 for (
int i = 0; i < 4; i++)
138 point[i].project(cMo);
142 for (
int i = 0; i < 4; i++)
162 for (
int i = 0; i < 4; i++)
179 for (
int i = 0; i < 4; i++) {
198 wMc = robot.getPosition();
210 std::cout <<
"Catch an exception: " << e << std::endl;
219 <<
"You do not have X11, GTK, or OpenCV, or GDI (Graphical Device Interface) functionalities to display images..."
221 std::cout <<
"Tip if you are on a unix-like system:" << std::endl;
222 std::cout <<
"- Install X11, configure again ViSP using cmake and build again this example" << std::endl;
223 std::cout <<
"Tip if you are on a windows-like system:" << std::endl;
224 std::cout <<
"- Install GDI, configure again ViSP using cmake and build again this example" << std::endl;
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
Display for windows using GDI (available on any windows 32 platform).
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
void init(vpImage< unsigned char > &I, int win_x=-1, int win_y=-1, const std::string &win_title="") vp_override
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
error that can be emitted by ViSP classes.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix inverse() const
static double rad(double deg)
Implementation of a matrix and operations on matrices.
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
void setWorldCoordinates(double oX, double oY, double oZ)
void get_eJe(vpMatrix &eJe) vp_override
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) vp_override
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)
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
void addFeature(vpBasicFeature &s_cur, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
void set_cVe(const vpVelocityTwistMatrix &cVe_)
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
void set_eJe(const vpMatrix &eJe_)
void setServo(const vpServoType &servo_type)
vpColVector computeControlLaw()
Class that defines the simplest robot: a free flying camera.
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeMs()