50 #include <visp3/core/vpImage.h> 51 #include <visp3/gui/vpDisplayX.h> 52 #include <visp3/gui/vpDisplayOpenCV.h> 53 #include <visp3/gui/vpDisplayGTK.h> 54 #include <visp3/robot/vpRobotAfma6.h> 55 #include <visp3/core/vpCameraParameters.h> 56 #include <visp3/core/vpPixelMeterConversion.h> 57 #include <visp3/sensor/vp1394TwoGrabber.h> 58 #include <visp3/core/vpPoint.h> 59 #include <visp3/blob/vpDot.h> 60 #include <visp3/vision/vpPose.h> 61 #include <visp3/core/vpDebug.h> 63 #if defined(VISP_HAVE_AFMA6) && defined(VISP_HAVE_DC1394) 79 vpDisplayX display(I,100,100,
"Current image") ;
80 #elif defined(VISP_HAVE_OPENCV) 82 #elif defined(VISP_HAVE_GTK) 110 for (
int i=0; i < 4; i ++) {
112 std::cout <<
"Click on dot " << i << std::endl;
120 std::cout <<
" Coordinates: " << dot[i].
getCog() << std::endl;
142 for (
int i=0; i < 4; i ++) {
161 for (
int i=0; i < 4; i ++) {
174 std::cout <<
"Pose cMo: " << std::endl << cMo;
177 std::cout <<
" rotation: " 180 <<
vpMath::deg(r[2]) <<
" deg" << std::endl << std::endl;
186 std::cout <<
"Robot pose in reference frame: " << p << std::endl;
188 t[0] = p[0]; t[1] = p[1]; t[2] = p[2];
189 r[0] = p[3]; r[1] = p[4]; r[2] = p[5];
192 std::cout <<
"Pose rMc: " << std::endl << rMc;
195 std::cout <<
" rotation: " 198 <<
vpMath::deg(r[2]) <<
" deg" << std::endl << std::endl;
201 std::cout <<
"Robot pose in articular: " << p << std::endl;
204 std::cout <<
"Pose rMc from MGD: " << std::endl << rMc;
207 std::cout <<
" rotation: " 210 <<
vpMath::deg(r[2]) <<
" deg" << std::endl << std::endl;
214 std::cout <<
"Pose rMo = rMc * cMo: " << std::endl << rMo;
217 std::cout <<
" rotation: " 220 <<
vpMath::deg(r[2]) <<
" deg" << std::endl << std::endl;
224 std::cout <<
"Catch an exception: " << e << std::endl;
231 std::cout <<
"Sorry, test not valid. You should have an Afma6 robot..." vpRxyzVector buildFrom(const vpRotationMatrix &R)
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height) const
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpHomogeneousMatrix get_fMc(const vpColVector &q) const
Define the X11 console to display images.
error that can be emited by ViSP classes.
void set_x(const double x)
Set the point x coordinate in the image plane.
static void convertPoint(const vpCameraParameters &cam, const double &u, const double &v, double &x, double &y)
Point coordinates conversion from pixel coordinates to normalized coordinates in meter...
void acquire(vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)
Control of Irisa's gantry robot named Afma6.
Class that defines what is a point.
Implementation of a rotation matrix and operations on such kind of matrices.
vpImagePoint getCog() const
vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M)
bool computePose(vpPoseMethodType methode, vpHomogeneousMatrix &cMo, bool(*func)(vpHomogeneousMatrix *)=NULL)
compute the pose for a given method
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the opencv library.
Class used for pose computation from N points (pose from point only).
Generic class defining intrinsic camera parameters.
void set_y(const double y)
Set the point y coordinate in the image plane.
The vpDisplayGTK allows to display image using the GTK+ library version 1.2.
void extract(vpRotationMatrix &R) const
Perspective projection with distortion model.
void buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
static double deg(double rad)
void setWorldCoordinates(const double oX, const double oY, const double oZ)
Implementation of column vector and the associated operations.
void setGraphics(const bool activate)
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage...
Implementation of a rotation vector as Euler angle minimal representation.
Class for firewire ieee1394 video devices using libdc1394-2.x api.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
void addPoint(const vpPoint &P)
Add a new point in this array.
void initTracking(const vpImage< unsigned char > &I)
Class that consider the case of a translation vector.