 |
Visual Servoing Platform
version 3.2.0
|
2 #include <visp3/gui/vpDisplayGDI.h>
3 #include <visp3/gui/vpDisplayOpenCV.h>
4 #include <visp3/gui/vpDisplayX.h>
5 #include <visp3/robot/vpSimulatorAfma6.h>
6 #include <visp3/visual_features/vpFeatureBuilder.h>
7 #include <visp3/vs/vpServo.h>
15 unsigned int thickness = 3;
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++) {
33 #if defined(VISP_HAVE_PTHREAD)
63 std::vector<vpPoint> point;
64 point.push_back(
vpPoint(-0.1, -0.1, 0));
65 point.push_back(
vpPoint(0.1, -0.1, 0));
66 point.push_back(
vpPoint(0.1, 0.1, 0));
67 point.push_back(
vpPoint(-0.1, 0.1, 0));
75 for (
unsigned int i = 0; i < 4; i++) {
90 std::cout <<
"Robot joint limits: " << std::endl;
91 for (
unsigned int i = 0; i < 3; i++)
92 std::cout <<
"Joint " << i <<
": min " << qmin[i] <<
" max " << qmax[i] <<
" (m)" << std::endl;
93 for (
unsigned int i = 3; i < qmin.
size(); i++)
94 std::cout <<
"Joint " << i <<
": min " <<
vpMath::deg(qmin[i]) <<
" max " <<
vpMath::deg(qmax[i]) <<
" (deg)"
101 bool ret = robot.initialiseCameraRelativeToObject(cMo);
104 robot.setDesiredCameraPosition(cdMo);
107 #if defined(VISP_HAVE_X11)
108 vpDisplayX displayInt(Iint, 700, 0,
"Internal view");
109 #elif defined(VISP_HAVE_GDI)
111 #elif defined(VISP_HAVE_OPENCV)
114 std::cout <<
"No image viewer is available..." << std::endl;
118 robot.setCameraParameters(cam);
122 cMo = robot.get_cMo();
124 for (
unsigned int i = 0; i < 4; i++) {
130 robot.getInternalView(Iint);
132 display_trajectory(Iint, point, cMo, cam);
157 std::cout <<
"Catch an exception: " << e << std::endl;
Initialize the velocity controller.
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
VISP_EXPORT int wait(double t0, double t)
static double rad(double deg)
Generic class defining intrinsic camera parameters.
static double deg(double rad)
double getSamplingTime() const
Display for windows using GDI (available on any windows 32 platform).
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Implementation of column vector and the associated operations.
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
void setServo(const vpServoType &servo_type)
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
static const vpColor green
Simulator of Irisa's gantry robot named Afma6.
static void display(const vpImage< unsigned char > &I)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
unsigned int getHeight() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
unsigned int size() const
Return the number of elements of the 2D array.
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static const vpColor blue
vpColVector computeControlLaw()
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
static void flush(const vpImage< unsigned char > &I)
Class that defines what is a point.
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
void setVerbose(bool verbose)
error that can be emited by ViSP classes.
unsigned int getWidth() const