 |
Visual Servoing Platform
version 3.3.0
|
2 #include <visp3/gui/vpDisplayGDI.h>
3 #include <visp3/gui/vpDisplayOpenCV.h>
4 #include <visp3/gui/vpDisplayX.h>
5 #include <visp3/robot/vpSimulatorViper850.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)
62 std::vector<vpPoint> point;
63 point.push_back(
vpPoint(-0.1, -0.1, 0));
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));
74 for (
unsigned int i = 0; i < 4; i++) {
95 robot.setJointLimit(qmin, qmax);
97 std::cout <<
"Robot joint limits: " << std::endl;
98 for (
unsigned int i = 0; i < qmin.
size(); i++)
99 std::cout <<
"Joint " << i <<
": min " <<
vpMath::deg(qmin[i]) <<
" max " <<
vpMath::deg(qmax[i]) <<
" (deg)"
106 bool ret = robot.initialiseCameraRelativeToObject(cMo);
109 robot.setDesiredCameraPosition(cdMo);
111 robot.setExternalCameraPosition(
115 #if defined(VISP_HAVE_X11)
116 vpDisplayX displayInt(Iint, 700, 0,
"Internal view");
117 #elif defined(VISP_HAVE_GDI)
119 #elif defined(VISP_HAVE_OPENCV)
122 std::cout <<
"No image viewer is available..." << std::endl;
128 robot.setCameraParameters(cam);
132 for (
int iter = 0; iter < 275; iter++) {
133 cMo = robot.get_cMo();
135 for (
unsigned int i = 0; i < 4; i++) {
141 robot.getInternalView(Iint);
143 display_trajectory(Iint, point, cMo, cam);
168 std::cout <<
"Catch an exception: " << e << std::endl;
@ STATE_VELOCITY_CONTROL
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 void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
static double rad(double deg)
@ TOOL_PTGREY_FLEA2_CAMERA
Generic class defining intrinsic camera parameters.
@ perspectiveProjWithoutDistortion
static double deg(double rad)
double getSamplingTime() const
Display for windows using GDI (available on any windows 32 platform).
static const vpColor blue
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
unsigned int getHeight() const
Class that consider the case of a translation vector.
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)
unsigned int getWidth() const
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
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)
Implementation of a rotation matrix and operations on such kind of matrices.
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.
Simulator of Irisa's Viper S850 robot named Viper850.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, unsigned int select=vpBasicFeature::FEATURE_ALL)
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 green
vpColVector computeControlLaw()
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)
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.
Implementation of a rotation vector as Euler angle minimal representation.