2 #include <visp3/gui/vpDisplayGDI.h> 3 #include <visp3/gui/vpDisplayOpenCV.h> 4 #include <visp3/gui/vpDisplayX.h> 5 #include <visp3/gui/vpProjectionDisplay.h> 6 #include <visp3/robot/vpSimulatorCamera.h> 7 #include <visp3/visual_features/vpFeatureBuilder.h> 8 #include <visp3/vs/vpServo.h> 9 #include <visp3/vs/vpServoDisplay.h> 17 static std::vector<vpImagePoint> traj[4];
19 for (
unsigned int i = 0; i < 4; i++) {
21 point[i].project(cMo);
23 traj[i].push_back(cog);
25 for (
unsigned int i = 0; i < 4; i++) {
26 for (
unsigned int j = 1; j < traj[i].size(); j++) {
38 std::vector<vpPoint> point;
39 point.push_back(
vpPoint(-0.1, -0.1, 0));
40 point.push_back(
vpPoint(0.1, -0.1, 0));
41 point.push_back(
vpPoint(0.1, 0.1, 0));
42 point.push_back(
vpPoint(-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) 72 #elif defined(VISP_HAVE_OPENCV) 76 std::cout <<
"No image viewer is available..." << std::endl;
79 #if defined(VISP_HAVE_DISPLAY) 81 for (
unsigned int i = 0; i < 4; i++)
82 externalview.
insert(point[i]);
90 for (
unsigned int i = 0; i < 4; i++) {
99 display_trajectory(Iint, point, cMo, cam);
102 #if defined(VISP_HAVE_DISPLAY) 115 std::cout <<
"Catch an exception: " << e << std::endl;
void display(vpImage< unsigned char > &I, const vpHomogeneousMatrix &cextMo, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, const vpColor &color, const bool &displayTraj=false, unsigned int thickness=1)
VISP_EXPORT int wait(double t0, double t)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines the simplest robot: a free flying camera.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Display for windows using GDI (available on any windows 32 platform).
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
error that can be emited by ViSP classes.
vpHomogeneousMatrix inverse() const
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
vpHomogeneousMatrix getPosition() const
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
virtual void setSamplingTime(const double &delta_t)
vpColVector computeControlLaw()
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Generic class defining intrinsic camera parameters.
void insert(vpForwardProjection &fp)
double getSamplingTime() const
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
Implementation of column vector and the associated operations.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
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 displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
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)