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;
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.
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