2 #include <visp3/core/vpConfig.h>
3 #include <visp3/gui/vpDisplayGDI.h>
4 #include <visp3/gui/vpDisplayOpenCV.h>
5 #include <visp3/gui/vpDisplayX.h>
6 #include <visp3/gui/vpProjectionDisplay.h>
7 #include <visp3/robot/vpSimulatorCamera.h>
8 #include <visp3/visual_features/vpFeatureBuilder.h>
9 #include <visp3/vs/vpServo.h>
10 #include <visp3/vs/vpServoDisplay.h>
12 #ifdef ENABLE_VISP_NAMESPACE
22 static std::vector<vpImagePoint> traj[4];
24 for (
unsigned int i = 0; i < 4; i++) {
26 point[i].project(cMo);
28 traj[i].push_back(cog);
30 for (
unsigned int i = 0; i < 4; i++) {
31 for (
unsigned int j = 1; j < traj[i].size(); j++) {
43 std::vector<vpPoint> point;
44 point.push_back(
vpPoint(-0.1, -0.1, 0));
45 point.push_back(
vpPoint(0.1, -0.1, 0));
46 point.push_back(
vpPoint(0.1, 0.1, 0));
47 point.push_back(
vpPoint(-0.1, 0.1, 0));
55 for (
unsigned int i = 0; i < 4; i++) {
65 robot.setSamplingTime(0.040);
66 robot.getPosition(wMc);
71 #if defined(VISP_HAVE_X11)
72 vpDisplayX displayInt(Iint, 0, 0,
"Internal view");
73 vpDisplayX displayExt(Iext, 670, 0,
"External view");
74 #elif defined(VISP_HAVE_GDI)
77 #elif defined(HAVE_OPENCV_HIGHGUI)
81 std::cout <<
"No image viewer is available..." << std::endl;
84 #if defined(VISP_HAVE_DISPLAY)
86 for (
unsigned int i = 0; i < 4; i++)
87 externalview.
insert(point[i]);
93 robot.getPosition(wMc);
95 for (
unsigned int i = 0; i < 4; i++) {
104 display_trajectory(Iint, point, cMo, cam);
107 #if defined(VISP_HAVE_DISPLAY)
121 std::cout <<
"Catch an exception: " << e << std::endl;
Generic class defining intrinsic camera parameters.
Implementation of column vector and the associated operations.
static const vpColor green
Display for windows using GDI (available on any windows 32 platform).
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
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 flush(const vpImage< unsigned char > &I)
error that can be emitted by ViSP classes.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpImagePoint &t)
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
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static double rad(double deg)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
interface with the image for feature display
void insert(vpForwardProjection &fp)
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)
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 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)