43 #include <visp/vpConfig.h>
45 #include <visp/vpRobotPioneer.h>
46 #include <visp/vpCameraParameters.h>
47 #include <visp/vpDisplayGDI.h>
48 #include <visp/vpDisplayX.h>
49 #include <visp/vpDot2.h>
50 #include <visp/vpFeatureBuilder.h>
51 #include <visp/vpFeatureDepth.h>
52 #include <visp/vpFeaturePoint.h>
53 #include <visp/vpHomogeneousMatrix.h>
54 #include <visp/vpImage.h>
55 #include <visp/vpImageConvert.h>
56 #include <visp/vp1394TwoGrabber.h>
57 #include <visp/vp1394CMUGrabber.h>
58 #include <visp/vpV4l2Grabber.h>
59 #include <visp/vpOpenCVGrabber.h>
60 #include <visp/vpServo.h>
61 #include <visp/vpVelocityTwistMatrix.h>
63 #if defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) || defined(VISP_HAVE_OPENCV)
64 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)
65 #if defined(VISP_HAVE_PIONEER)
66 # define TEST_COULD_BE_ACHIEVED
90 #ifdef TEST_COULD_BE_ACHIEVED
91 int main(
int argc,
char **argv)
96 double coef = 1./6.77;
99 ArArgumentParser parser(&argc, argv);
100 parser.loadDefaultArguments();
104 ArRobotConnector robotConnector(&parser, &robot);
105 if(!robotConnector.connectRobot())
107 ArLog::log(ArLog::Terse,
"Could not connect to the robot.");
108 if(parser.checkHelpAndWarnUnparsed())
114 if (!Aria::parseArgs())
121 std::cout <<
"Robot connected" << std::endl;
124 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
126 std::cout <<
"Use device: " << device << std::endl;
127 cv::VideoCapture g(device);
128 g.set(CV_CAP_PROP_FRAME_WIDTH, 640);
129 g.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
135 #elif defined(VISP_HAVE_V4L2)
142 #elif defined(VISP_HAVE_DC1394_2)
147 #elif defined(VISP_HAVE_CMU1394)
156 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
164 #if defined(VISP_HAVE_X11)
166 #elif defined(VISP_HAVE_GDI)
194 std::cout <<
"cVe: \n" << cVe << std::endl;
199 std::cout <<
"eJe: \n" << eJe << std::endl;
223 std::cout <<
"Z " << Z << std::endl;
237 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
265 std::cout <<
"v: " << v.
t() << std::endl;
283 std::cout <<
"Ending robot thread..." << std::endl;
287 robot.waitForRunExit();
296 std::cout <<
"You don't have the right 3rd party libraries to run this example..." << std::endl;
Definition of the vpMatrix class.
void setVideoMode(unsigned long format, unsigned long mode)
void open(vpImage< unsigned char > &I)
unsigned int getWidth() const
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
void get_eJe(vpMatrix &eJe)
void open(vpImage< unsigned char > &I)
Display for windows using GDI (available on any windows 32 platform).
void setEllipsoidBadPointsPercentage(const double &percentage=0.0)
vpVelocityTwistMatrix get_cVe() const
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
void buildFrom(const double x, const double y, const double Z, const double LogZoverZstar)
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 setDevice(const char *devname)
Class that defines a 3D point visual feature which is composed by one parameters that is that defin...
void setLambda(double _lambda)
set the gain lambda
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
Interface for Pioneer mobile robots based on Aria 3rd party library.
This tracker is meant to track a blob (connex pixels with same gray level) on a vpImage.
void track(const vpImage< unsigned char > &I)
void set_cVe(vpVelocityTwistMatrix &_cVe)
static void flush(const vpImage< unsigned char > &I)
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
void setGrayLevelPrecision(const double &grayLevelPrecision)
void kill()
destruction (memory deallocation if required)
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
void setFramerate(unsigned long fps)
vpColVector computeControlLaw()
compute the desired control law
void acquire(vpImage< unsigned char > &I)
static void display(const vpImage< unsigned char > &I)
void set_eJe(vpMatrix &_eJe)
vpRowVector t() const
transpose of Vector
Generic class defining intrinsic camera parameters.
void setComputeMoments(const bool activate)
Class that consider the particular case of twist transformation matrix that allows to transform a vel...
void setScale(unsigned scale=vpV4l2Grabber::DEFAULT_SCALE)
void setEllipsoidShapePrecision(const double &ellipsoidShapePrecision)
void setInput(unsigned input=vpV4l2Grabber::DEFAULT_INPUT)
void setInteractionMatrixType(const vpServoIteractionMatrixType &interactionMatrixType, const vpServoInversionType &interactionMatrixInversion=PSEUDO_INVERSE)
Set the type of the interaction matrix (current, mean, desired, user).
void buildFrom(const double x, const double y, const double Z)
Class for the Video4Linux2 video device.
Class that provides a data structure for the column vectors as well as a set of operations on these v...
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
void print(const vpServo::vpServoPrintType display_level=ALL, std::ostream &os=std::cout)
unsigned int getHeight() const
Class for firewire ieee1394 video devices using libdc1394-2.x api.
virtual bool getClick(bool blocking=true)=0
virtual void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
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 setGraphics(const bool activate)
void setFramerate(vpV4l2FramerateType framerate)