64 #include <visp/vpConfig.h>
65 #include <visp/vpDebug.h>
66 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__))) // UNIX
73 #if (defined(VISP_HAVE_PTU46) & defined (VISP_HAVE_DC1394_2) )
75 #ifdef VISP_HAVE_PTHREAD
79 #include <visp/vp1394TwoGrabber.h>
80 #include <visp/vpImage.h>
81 #include <visp/vpDisplay.h>
82 #include <visp/vpDisplayX.h>
84 #include <visp/vpMath.h>
85 #include <visp/vpHomogeneousMatrix.h>
86 #include <visp/vpFeaturePoint.h>
87 #include <visp/vpPoint.h>
88 #include <visp/vpServo.h>
89 #include <visp/vpFeatureBuilder.h>
91 #include <visp/vpRobotPtu46.h>
94 #include <visp/vpException.h>
95 #include <visp/vpMatrixException.h>
96 #include <visp/vpServoDisplay.h>
98 #include <visp/vpDot2.h>
101 #ifdef VISP_HAVE_PTHREAD
102 pthread_mutex_t mutexEndLoop = PTHREAD_MUTEX_INITIALIZER;
105 void signalCtrC(
int signumber )
107 #ifdef VISP_HAVE_PTHREAD
108 pthread_mutex_unlock( &mutexEndLoop );
117 std::cout << std::endl ;
118 std::cout <<
"-------------------------------------------------------" << std::endl ;
119 std::cout <<
" Test program for vpServo " <<std::endl ;
120 std::cout <<
" Eye-in-hand task control, velocity computed in the camera frame" << std::endl ;
121 std::cout <<
" Simulation " << std::endl ;
122 std::cout <<
" task : servo a point " << std::endl ;
123 std::cout <<
"-------------------------------------------------------" << std::endl ;
124 std::cout << std::endl ;
128 #ifdef VISP_HAVE_PTHREAD
129 pthread_mutex_lock( &mutexEndLoop );
131 signal( SIGINT,&signalCtrC );
156 vpDisplayX display(I,100,100,
"testDisplayX.cpp ") ;
193 vpTRACE(
"sets the current position of the visual feature ") ;
198 vpTRACE(
"sets the desired position of the visual feature ") ;
203 vpTRACE(
"\t we want an eye-in-hand control law") ;
204 vpTRACE(
"\t articular velocity are computed") ;
209 vpTRACE(
"Set the position of the camera in the end-effector frame ") ;
215 std::cout << cVe <<std::endl ;
219 vpTRACE(
"Set the Jacobian (expressed in the end-effector frame)") ;
225 vpTRACE(
"\t we want to see a point on a point..") ;
226 std::cout << std::endl ;
233 vpTRACE(
"Display task information " ) ;
239 unsigned int iter=0 ;
241 #ifdef VISP_HAVE_PTHREAD
242 while( 0 != pthread_mutex_trylock( &mutexEndLoop ) )
247 std::cout <<
"---------------------------------------------" << iter <<std::endl ;
277 vpTRACE(
"Display task information " ) ;
289 vpERROR_TRACE(
"You don't have a ptu-46 head connected to your computer ",
290 "or 1394 framegrabbing capabilities...");
Definition of the vpMatrix class.
void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &q_dot)
void set_eJe(const vpMatrix &eJe_)
Define the X11 console to display images.
void addFeature(vpBasicFeature &s, vpBasicFeature &s_star, const unsigned int select=vpBasicFeature::FEATURE_ALL)
Initialize the position controller.
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
void acquire(vpImage< unsigned char > &I)
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
void track(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
vpRobot::vpRobotStateType setRobotState(vpRobot::vpRobotStateType newState)
void open(vpImage< unsigned char > &I)
Initialize the velocity controller.
vpColVector getError() const
Interface for the Directed Perception ptu-46 pan, tilt head .
vpColVector computeControlLaw()
static void display(const vpImage< unsigned char > &I)
vpRowVector t() const
Transpose of a vector.
Generic class defining intrinsic camera parameters.
Class that consider the particular case of twist transformation matrix that allows to transform a vel...
void get_eJe(vpMatrix &_eJe)
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
void buildFrom(const double x, const double y, const double Z)
void get_cVe(vpVelocityTwistMatrix &_cVe) const
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void set_cVe(const vpVelocityTwistMatrix &cVe_)
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
Class for firewire ieee1394 video devices using libdc1394-2.x api.
virtual bool getClick(bool blocking=true)=0
void set_Z(const double Z)
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
void setServo(const vpServoType &servo_type)
static void display(const vpServo &s, const vpCameraParameters &cam, const vpImage< unsigned char > &I, vpColor currentColor=vpColor::green, vpColor desiredColor=vpColor::red, unsigned int thickness=1)