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;
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)
unsigned int getWidth() const
double getSamplingTime() const
Implementation of an homogeneous matrix and operations on such kind of matrices.
void setVerbose(bool verbose)
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
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.
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.
Simulator of Irisa's gantry robot named Afma6.
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
static double rad(double deg)
static double deg(double rad)
Implementation of column vector and the associated operations.
unsigned int getHeight() const
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)
static const vpColor blue