43 #include <visp/vpConfig.h>
44 #include <visp/vpRobotPioneer.h>
45 #include <visp/vpCameraParameters.h>
46 #include <visp/vpDisplayGDI.h>
47 #include <visp/vpDisplayX.h>
48 #include <visp/vpDot2.h>
49 #include <visp/vpFeatureBuilder.h>
50 #include <visp/vpFeatureDepth.h>
51 #include <visp/vpFeaturePoint.h>
52 #include <visp/vpHomogeneousMatrix.h>
53 #include <visp/vpImage.h>
54 #include <visp/vpImageConvert.h>
55 #include <visp/vp1394TwoGrabber.h>
56 #include <visp/vp1394CMUGrabber.h>
57 #include <visp/vpOpenCVGrabber.h>
58 #include <visp/vpV4l2Grabber.h>
59 #include <visp/vpVelocityTwistMatrix.h>
61 #if defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100)
62 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)
63 #if defined(VISP_HAVE_PIONEER)
64 # define TEST_COULD_BE_ACHIEVED
69 #undef VISP_HAVE_OPENCV // To use a firewire camera
70 #undef VISP_HAVE_V4L2 // To use a firewire camera
91 #ifdef TEST_COULD_BE_ACHIEVED
92 int main(
int argc,
char **argv)
98 double coef = 1./6.77;
101 ArArgumentParser parser(&argc, argv);
102 parser.loadDefaultArguments();
106 ArRobotConnector robotConnector(&parser, &robot);
107 if(!robotConnector.connectRobot())
109 ArLog::log(ArLog::Terse,
"Could not connect to the robot.");
110 if(parser.checkHelpAndWarnUnparsed())
116 if (!Aria::parseArgs())
129 std::cout <<
"Robot connected" << std::endl;
135 #if defined(VISP_HAVE_OPENCV)
137 std::cout <<
"Use device: " << device << std::endl;
138 cv::VideoCapture g(device);
139 g.set(CV_CAP_PROP_FRAME_WIDTH, 640);
140 g.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
149 #elif defined(VISP_HAVE_V4L2)
158 #elif defined(VISP_HAVE_DC1394_2)
165 #elif defined(VISP_HAVE_CMU1394)
176 #if defined(VISP_HAVE_OPENCV)
184 #if defined(VISP_HAVE_X11)
186 #elif defined(VISP_HAVE_GDI)
240 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)
271 v = -lambda * (L * cVe * eJe).pseudoInverse() * error;
273 std::cout <<
"Send velocity to the pionner: " << v[0] <<
" m/s "
288 std::cout <<
"Ending robot thread..." << std::endl;
292 robot.waitForRunExit();
295 std::cout <<
"Catch an exception: " << e << std::endl;
302 std::cout <<
"You don't have the right 3rd party libraries to run this example..." << std::endl;
Definition of the vpMatrix class.
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
void setVideoMode(unsigned long format, unsigned long mode)
void open(vpImage< unsigned char > &I)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
void stack(const double &b)
void get_eJe(vpMatrix &eJe)
void open(vpImage< unsigned char > &I)
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
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)
static void sleepMs(double t)
void buildFrom(const double x, const double y, const double Z, const double LogZoverZstar)
Define the X11 console to display images.
void setDevice(const std::string &devname)
Class that defines a 3D point visual feature which is composed by one parameters that is that defin...
error that can be emited by ViSP classes.
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)
static void flush(const vpImage< unsigned char > &I)
void initPersProjWithoutDistortion(const double px, const double py, const double u0, const double v0)
vpMatrix interaction(const unsigned int select=FEATURE_ALL)
void setGrayLevelPrecision(const double &grayLevelPrecision)
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
void setFramerate(unsigned long fps)
void acquire(vpImage< unsigned char > &I)
static void display(const vpImage< unsigned char > &I)
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 stackMatrices(const vpMatrix &A)
void setEllipsoidShapePrecision(const double &ellipsoidShapePrecision)
void setInput(unsigned input=vpV4l2Grabber::DEFAULT_INPUT)
void buildFrom(const double x, const double y, const double Z)
Class for the Video4Linux2 video device.
static double deg(double rad)
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)
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
vpColVector error(const vpBasicFeature &s_star, const unsigned int select=FEATURE_ALL)
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
static unsigned int selectX()
void setGraphics(const bool activate)
void setFramerate(vpV4l2FramerateType framerate)