2 #include <visp/vpFeatureBuilder.h>
3 #include <visp/vpServo.h>
4 #include <visp/vpSimulatorCamera.h>
5 #include <visp/vpDisplayX.h>
6 #include <visp/vpDisplayGDI.h>
7 #include <visp/vpProjectionDisplay.h>
8 #include <visp/vpServoDisplay.h>
16 static std::vector<vpImagePoint> traj[4];
18 for (
unsigned int i=0; i<4; i++) {
20 point[i].project(cMo);
22 traj[i].push_back(cog);
24 for (
unsigned int i=0; i<4; i++) {
25 for (
unsigned int j=1; j<traj[i].size(); j++) {
38 std::vector<vpPoint> point(4) ;
39 point[0].setWorldCoordinates(-0.1,-0.1, 0);
40 point[1].setWorldCoordinates( 0.1,-0.1, 0);
41 point[2].setWorldCoordinates( 0.1, 0.1, 0);
42 point[3].setWorldCoordinates(-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)
73 std::cout <<
"No image viewer is available..." << std::endl;
77 #if defined(VISP_HAVE_DISPLAY)
79 for (
unsigned int i = 0 ; i < 4 ; i++)
80 externalview.
insert(point[i]) ;
88 for (
unsigned int i = 0 ; i < 4 ; i++) {
97 display_trajectory(Iint, point, cMo, cam);
100 #if defined(VISP_HAVE_DISPLAY)
115 std::cout <<
"Catch an exception: " << e << std::endl;
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
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)
unsigned int getWidth() const
double getSamplingTime() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
Class that defines the simplest robot: a free flying camera.
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
Display for windows using GDI (available on any windows 32 platform).
Define the X11 console to display images.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
error that can be emited by ViSP classes.
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
static int wait(double t0, double t)
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
virtual void setSamplingTime(const double &delta_t)
vpColVector computeControlLaw()
static void display(const vpImage< unsigned char > &I)
Generic class defining intrinsic camera parameters.
void getPosition(vpHomogeneousMatrix &wMc) const
void insert(vpForwardProjection &fp)
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
vpHomogeneousMatrix inverse() const
unsigned int getHeight() const
virtual bool getClick(bool blocking=true)=0
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
virtual void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
interface with the image for feature display
void setServo(const vpServoType &servo_type)
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)