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>
92 std::string logdirname;
93 logdirname =
"/tmp/" + username;
102 std::cerr << std::endl
103 <<
"ERROR:" << std::endl;
104 std::cerr <<
" Cannot create " << logdirname << std::endl;
108 std::string logfilename;
109 logfilename = logdirname +
"/log.dat";
112 std::ofstream flog(logfilename.c_str());
127 vpDisplayX display(I, 100, 100,
"Current image") ;
132 std::vector<vpDot> dot_d(2), dot(2) ;
140 std::cout <<
"define the initial segment" << std::endl;
142 for(std::vector<vpDot>::iterator i = dot.begin();i!=dot.end();i++){
143 std::cout <<
"Click on a dot..." << std::endl;
152 std::cout <<
"define the destination segment" << std::endl;
153 for(std::vector<vpDot>::iterator i = dot_d.begin();i!=dot_d.end();i++){
183 std::cout <<
"\nHit CTRL-C to stop the loop...\n" << std::flush;
192 for(std::vector<vpDot>::iterator i = dot.begin();i!=dot.end();i++){
212 flog << ( task.
getError() ).t() << std::endl;
242 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)
virtual void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)=0
Generic class defining intrinsic camera parameters.
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 (connex 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.
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