2 #include <visp/vpDisplayGDI.h>
3 #include <visp/vpDisplayX.h>
4 #include <visp/vpFeatureBuilder.h>
5 #include <visp/vpServo.h>
6 #include <visp/vpSimulatorViper850.h>
12 static std::vector<vpImagePoint> traj[4];
14 for (
unsigned int i=0; i<4; i++) {
16 point[i].project(cMo);
18 traj[i].push_back(cog);
20 for (
unsigned int i=0; i<4; i++) {
21 for (
unsigned int j=1; j<traj[i].size(); j++) {
29 #if defined(VISP_HAVE_PTHREAD)
59 std::vector<vpPoint> point(4) ;
60 point[0].setWorldCoordinates(-0.1,-0.1, 0);
61 point[1].setWorldCoordinates( 0.1,-0.1, 0);
62 point[2].setWorldCoordinates( 0.1, 0.1, 0);
63 point[3].setWorldCoordinates(-0.1, 0.1, 0);
71 for (
int i = 0 ; i < 4 ; i++) {
92 robot.setJointLimit(qmin, qmax);
94 std::cout <<
"Robot joint limits: " << std::endl;
95 for (
unsigned int i=0; i< qmin.
size(); i ++)
96 std::cout <<
"Joint " << i <<
": min " <<
vpMath::deg(qmin[i]) <<
" max " <<
vpMath::deg(qmax[i]) <<
" (deg)" << std::endl;
103 #if VISP_VERSION_INT > VP_VERSION_INT(2,7,0)
106 robot.initialiseCameraRelativeToObject(cMo);
109 robot.setDesiredCameraPosition(cdMo);
115 #if defined(VISP_HAVE_X11)
116 vpDisplayX displayInt(Iint, 700, 0,
"Internal view");
117 #elif defined(VISP_HAVE_GDI)
120 std::cout <<
"No image viewer is available..." << std::endl;
125 robot.setCameraParameters(cam);
129 for (
int iter =0; iter < 275; iter ++)
131 cMo = robot.get_cMo();
133 for (
int i = 0 ; i < 4 ; i++) {
139 robot.getInternalView(Iint);
141 display_trajectory(Iint, point, cMo, cam);
The object displayed at the desired position is the same than the scene object defined in vpSceneObje...
Perspective projection without distortion model.
unsigned int getWidth() const
double getSamplingTime() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
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).
Define the X11 console to display images.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
create a new ste of two visual features
void setLambda(double _lambda)
set the gain lambda
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
static int wait(double t0, double t)
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
The vpRotationMatrix considers the particular case of a rotation matrix.
unsigned int size() const
void kill()
destruction (memory deallocation if required)
Initialize the velocity controller.
vpColVector computeControlLaw()
compute the desired control law
static void display(const vpImage< unsigned char > &I)
Generic class defining intrinsic camera parameters.
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
Set the type of the interaction matrix (current, mean, desired, user).
static double rad(double deg)
Simulator of Irisa's Viper S850 robot named Viper850.
static double deg(double rad)
Class that provides a data structure for the column vectors as well as a set of operations on these v...
virtual void displayCharString(const vpImagePoint &ip, const char *text, const vpColor &color=vpColor::green)=0
unsigned int getHeight() const
Class that consider the case of the Euler angle using the x-y-z convention, where are respectively ...
virtual bool getClick(bool blocking=true)=0
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
virtual void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Class required to compute the visual servoing control law descbribed in and .
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &v)
Class that consider the case of a translation vector.
void setServo(vpServoType _servo_type)
Choice of the visual servoing control law.
static const vpColor blue