54 #include <visp/vpConfig.h>
55 #include <visp/vpDebug.h>
58 #if (defined (VISP_HAVE_AFMA6) && defined (VISP_HAVE_DC1394_2))
60 #include <visp/vp1394TwoGrabber.h>
61 #include <visp/vpImage.h>
62 #include <visp/vpImagePoint.h>
63 #include <visp/vpMath.h>
64 #include <visp/vpHomogeneousMatrix.h>
65 #include <visp/vpFeatureSegment.h>
66 #include <visp/vpPoint.h>
67 #include <visp/vpServo.h>
68 #include <visp/vpFeatureBuilder.h>
69 #include <visp/vpRobotAfma6.h>
70 #include <visp/vpIoTools.h>
71 #include <visp/vpException.h>
72 #include <visp/vpMatrixException.h>
73 #include <visp/vpServoDisplay.h>
74 #include <visp/vpDot.h>
75 #include <visp/vpDisplay.h>
76 #include <visp/vpDisplayX.h>
77 #include <visp/vpDisplayOpenCV.h>
78 #include <visp/vpDisplayGTK.h>
94 std::string logdirname;
95 logdirname =
"/tmp/" + username;
104 std::cerr << std::endl
105 <<
"ERROR:" << std::endl;
106 std::cerr <<
" Cannot create " << logdirname << std::endl;
110 std::string logfilename;
111 logfilename = logdirname +
"/log.dat";
114 std::ofstream flog(logfilename.c_str());
130 vpDisplayX display(I,100,100,
"Current image") ;
131 #elif defined(VISP_HAVE_OPENCV)
133 #elif defined(VISP_HAVE_GTK)
140 std::vector<vpDot> dot_d(2), dot(2) ;
148 std::cout <<
"define the initial segment" << std::endl;
150 for(std::vector<vpDot>::iterator i = dot.begin();i!=dot.end();i++){
151 std::cout <<
"Click on a dot..." << std::endl;
160 std::cout <<
"define the destination segment" << std::endl;
161 for(std::vector<vpDot>::iterator i = dot_d.begin();i!=dot_d.end();i++){
191 std::cout <<
"\nHit CTRL-C to stop the loop...\n" << std::flush;
200 for(std::vector<vpDot>::iterator i = dot.begin();i!=dot.end();i++){
220 flog << ( task.
getError() ).t() << std::endl;
250 vpERROR_TRACE(
"You do not have an afma6 robot or a firewire framegrabber connected to your computer...");
static void display(vpServo &s, const vpCameraParameters &cam, vpImage< unsigned char > &I, vpColor currentColor=vpColor::green, vpColor desiredColor=vpColor::red, unsigned int thickness=1)
void getCameraParameters(vpCameraParameters &cam, const unsigned int &image_width, const unsigned int &image_height)
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
static const vpColor green
void acquire(vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
void setZ1(const double val)
Control of Irisa's gantry robot named Afma6.
void open(vpImage< unsigned char > &I)
void kill()
destruction (memory deallocation if required)
Initialize the velocity controller.
vpColVector getError() const
vpColVector computeControlLaw()
compute the desired control law
void setZ2(const double val)
Class that defines a 2D segment visual features. This class allow to consider two sets of visual feat...
static void display(const vpImage< unsigned char > &I)
The vpDisplayOpenCV allows to display image using the opencv library.
virtual void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)=0
Generic class defining intrinsic camera parameters.
The vpDisplayGTK allows to display image using the GTK+ library version 1.2.
vpRobot::vpRobotStateType setRobotState(vpRobot::vpRobotStateType newState)
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
Set the type of the interaction matrix (current, mean, desired, user).
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void setFramerate(vp1394TwoFramerateType fps)
void setVideoMode(vp1394TwoVideoModeType videomode)
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
This tracker is meant to track a dot (connected pixels with same gray level) on a vpImage...
Class for firewire ieee1394 video devices using libdc1394-2.x api.
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &velocity)
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 ...
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Class required to compute the visual servoing control law descbribed in and .
void setServo(vpServoType _servo_type)
Choice of the visual servoing control law.
void display(const vpCameraParameters &cam, const vpImage< unsigned char > &I, const vpColor &color=vpColor::green, unsigned int thickness=1) const
static const vpColor blue