2 #include <visp3/gui/vpDisplayGDI.h>
3 #include <visp3/gui/vpDisplayOpenCV.h>
4 #include <visp3/gui/vpDisplayX.h>
5 #include <visp3/visual_features/vpFeatureBuilder.h>
6 #include <visp3/vs/vpServo.h>
7 #include <visp3/robot/vpSimulatorViper850.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++) {
96 robot.setJointLimit(qmin, qmax);
98 std::cout <<
"Robot joint limits: " << std::endl;
99 for (
unsigned int i=0; i< qmin.
size(); i ++)
100 std::cout <<
"Joint " << i <<
": min " <<
vpMath::deg(qmin[i]) <<
" max " <<
vpMath::deg(qmax[i]) <<
" (deg)" << std::endl;
107 #if VISP_VERSION_INT > VP_VERSION_INT(2,7,0)
110 robot.initialiseCameraRelativeToObject(cMo);
113 robot.setDesiredCameraPosition(cdMo);
119 #if defined(VISP_HAVE_X11)
120 vpDisplayX displayInt(Iint, 700, 0,
"Internal view");
121 #elif defined(VISP_HAVE_GDI)
123 #elif defined(VISP_HAVE_OPENCV)
126 std::cout <<
"No image viewer is available..." << std::endl;
131 robot.setCameraParameters(cam);
135 for (
int iter =0; iter < 275; iter ++)
137 cMo = robot.get_cMo();
139 for (
unsigned int i = 0 ; i < 4 ; i++) {
145 robot.getInternalView(Iint);
147 display_trajectory(Iint, point, cMo, cam);
173 std::cout <<
"Catch an exception: " << e << std::endl;
The object displayed at the desired position is the same than the scene object defined in vpSceneObje...
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)
Perspective projection without distortion model.
unsigned int getWidth() const
double getSamplingTime() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setVerbose(bool verbose)
A 40cm by 40cm plate with 4 points at coordinates (-0.1,-0.1,0), (0.1,-0.1,0), (0.1,0.1,0), (0.1,0.1,0). Each point is represented by a circle with 2cm radius.
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).
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
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...
unsigned int size() const
Return the number of elements of the 2D array.
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Class that defines what is a point.
Implementation of a rotation matrix and operations on such kind of matrices.
Initialize the velocity controller.
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 setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
Simulator of Irisa's Viper S850 robot named Viper850.
static double deg(double rad)
Implementation of column vector and the associated operations.
unsigned int getHeight() const
Implementation of a rotation vector as Euler angle minimal representation.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
void setServo(const vpServoType &servo_type)
Class that consider the case of a translation vector.
static const vpColor blue