Example of robot pose usage.
Show how to compute rMo = rMc * cMo with cMo obtained by pose computation and rMc from the robot position.
#include <iostream>
#include <visp3/blob/vpDot.h>
#include <visp3/core/vpCameraParameters.h>
#include <visp3/core/vpConfig.h>
#include <visp3/core/vpDebug.h>
#include <visp3/core/vpImage.h>
#include <visp3/core/vpPixelMeterConversion.h>
#include <visp3/core/vpPoint.h>
#include <visp3/gui/vpDisplayGTK.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/robot/vpRobotViper850.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
#include <visp3/vision/vpPose.h>
#if defined(VISP_HAVE_VIPER850) && defined(VISP_HAVE_DC1394)
int main()
{
try {
bool reset = false;
#ifdef VISP_HAVE_X11
#elif defined(VISP_HAVE_OPENCV)
#elif defined(VISP_HAVE_GTK)
#endif
double sdim = 0.077;
for (int i = 0; i < 4; i++) {
std::cout << "Click on dot " << i << std::endl;
std::cout <<
" Coordinates: " << dot[i].
getCog() << std::endl;
}
robot.getCameraParameters(cam, I);
for (int i = 0; i < 4; i++) {
double x = 0, y = 0;
}
for (int i = 0; i < 4; i++) {
}
std::cout << "Pose cMo: " << std::endl << cMo;
<< std::endl
<< std::endl;
std::cout << "Robot pose in reference frame: " << p << std::endl;
t[0] = p[0];
t[1] = p[1];
t[2] = p[2];
r[0] = p[3];
r[1] = p[4];
r[2] = p[5];
std::cout << "Pose rMc: " << std::endl << rMc;
<< std::endl
<< std::endl;
std::cout << "Robot pose in articular: " << p << std::endl;
robot.get_fMc(p, rMc);
std::cout << "Pose rMc from MGD: " << std::endl << rMc;
<< std::endl
<< std::endl;
rMo = rMc * cMo;
std::cout << "Pose rMo = rMc * cMo: " << std::endl << rMo;
<< std::endl
<< std::endl;
return EXIT_SUCCESS;
std::cout << "Catch an exception: " << e << std::endl;
return EXIT_FAILURE;
}
}
#else
int main()
{
std::cout << "Sorry, test not valid. You should have an Viper850 robot..." << std::endl;
return EXIT_SUCCESS;
}
#endif
Class for firewire ieee1394 video devices using libdc1394-2.x api.
void acquire(vpImage< unsigned char > &I)
Generic class defining intrinsic camera parameters.
@ perspectiveProjWithDistortion
Perspective projection with distortion model.
Implementation of column vector and the associated operations.
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage.
void initTracking(const vpImage< unsigned char > &I)
void setGraphics(bool activate)
vpImagePoint getCog() const
error that can be emited by ViSP classes.
Implementation of an homogeneous matrix and operations on such kind of matrices.
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
void extract(vpRotationMatrix &R) const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static double deg(double rad)
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...
void set_x(double x)
Set the point x coordinate in the image plane.
void setWorldCoordinates(double oX, double oY, double oZ)
void set_y(double y)
Set the point y coordinate in the image plane.
Class used for pose computation from N points (pose from point only). Some of the algorithms implemen...
void addPoint(const vpPoint &P)
@ DEMENTHON_LAGRANGE_VIRTUAL_VS
bool computePose(vpPoseMethodType method, vpHomogeneousMatrix &cMo, bool(*func)(const vpHomogeneousMatrix &)=NULL)
Implementation of a rotation matrix and operations on such kind of matrices.
vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M)
Implementation of a rotation vector as Euler angle minimal representation.
vpRxyzVector buildFrom(const vpRotationMatrix &R)
Class that consider the case of a translation vector.
static const vpToolType defaultTool
Default tool attached to the robot end effector.