37 #include <visp3/blob/vpDot2.h>
38 #include <visp3/core/vpCameraParameters.h>
39 #include <visp3/core/vpConfig.h>
40 #include <visp3/core/vpHomogeneousMatrix.h>
41 #include <visp3/core/vpImage.h>
42 #include <visp3/core/vpImageConvert.h>
43 #include <visp3/core/vpVelocityTwistMatrix.h>
44 #include <visp3/gui/vpDisplayGDI.h>
45 #include <visp3/gui/vpDisplayX.h>
46 #include <visp3/robot/vpRobotPioneer.h>
47 #include <visp3/sensor/vp1394CMUGrabber.h>
48 #include <visp3/sensor/vp1394TwoGrabber.h>
49 #include <visp3/sensor/vpV4l2Grabber.h>
50 #include <visp3/visual_features/vpFeatureBuilder.h>
51 #include <visp3/visual_features/vpFeatureDepth.h>
52 #include <visp3/visual_features/vpFeaturePoint.h>
54 #if defined(HAVE_OPENCV_VIDEOIO)
55 #include <opencv2/videoio.hpp>
58 #if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) || defined(HAVE_OPENCV_VIDEOIO)
59 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)
60 #if defined(VISP_HAVE_PIONEER)
61 #define TEST_COULD_BE_ACHIEVED
66 #undef VISP_HAVE_OPENCV
91 #ifdef TEST_COULD_BE_ACHIEVED
92 int main(
int argc,
char **argv)
98 double coef = 1. / 6.77;
102 ArArgumentParser parser(&argc, argv);
103 parser.loadDefaultArguments();
107 ArRobotConnector robotConnector(&parser, &robot);
108 if (!robotConnector.connectRobot()) {
109 ArLog::log(ArLog::Terse,
"Could not connect to the robot.");
110 if (parser.checkHelpAndWarnUnparsed()) {
115 if (!Aria::parseArgs()) {
127 std::cout <<
"Robot connected" << std::endl;
134 #if defined(HAVE_OPENCV_VIDEOIO)
136 std::cout <<
"Use device: " << device << std::endl;
137 cv::VideoCapture g(device);
138 g.set(CV_CAP_PROP_FRAME_WIDTH, 640);
139 g.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
148 #elif defined(VISP_HAVE_V4L2)
158 #elif defined(VISP_HAVE_DC1394)
166 #elif defined(VISP_HAVE_CMU1394)
178 #if defined(HAVE_OPENCV_VIDEOIO)
186 #if defined(VISP_HAVE_X11)
188 #elif defined(VISP_HAVE_GDI)
248 #if defined(HAVE_OPENCV_VIDEOIO)
282 v = -lambda * (L * cVe * eJe).pseudoInverse() * error;
284 std::cout <<
"Send velocity to the pionner: " << v[0] <<
" m/s " <<
vpMath::deg(v[1]) <<
" deg/s" << std::endl;
299 std::cout <<
"Ending robot thread..." << std::endl;
303 robot.waitForRunExit();
307 std::cout <<
"Catch an exception: " << e << std::endl;
314 std::cout <<
"You don't have the right 3rd party libraries to run this example..." << std::endl;
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
void setVideoMode(unsigned long format, unsigned long mode)
void acquire(vpImage< unsigned char > &I)
void setFramerate(unsigned long fps)
void open(vpImage< unsigned char > &I)
Class for firewire ieee1394 video devices using libdc1394-2.x api.
@ vpVIDEO_MODE_640x480_MONO8
Generic class defining intrinsic camera parameters.
void initPersProjWithoutDistortion(double px, double py, double u0, double v0)
Implementation of column vector and the associated operations.
Display for windows using GDI (available on any windows 32 platform).
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
static void flush(const 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, bool canMakeTheWindowGrow=true)
void setGraphics(bool activate)
void setGrayLevelPrecision(const double &grayLevelPrecision)
void setEllipsoidBadPointsPercentage(const double &percentage=0.0)
void setEllipsoidShapePrecision(const double &ellipsoidShapePrecision)
void setComputeMoments(bool activate)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
error that can be emitted by ViSP classes.
static void create(vpFeaturePoint &s, const vpCameraParameters &cam, const vpDot &d)
Class that defines a 3D point visual feature which is composed by one parameters that is that defin...
void buildFrom(double x, double y, double Z, double LogZoverZstar)
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) vp_override
vpMatrix interaction(unsigned int select=FEATURE_ALL) vp_override
Class that defines a 2D point visual feature which is composed by two parameters that are the cartes...
void buildFrom(double x, double y, double Z)
vpMatrix interaction(unsigned int select=FEATURE_ALL) vp_override
static unsigned int selectX()
vpColVector error(const vpBasicFeature &s_star, unsigned int select=FEATURE_ALL) vp_override
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
static double deg(double rad)
Implementation of a matrix and operations on matrices.
Interface for Pioneer mobile robots based on Aria 3rd party library.
void get_eJe(vpMatrix &eJe) vp_override
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) vp_override
vpVelocityTwistMatrix get_cVe() const
Class that is a wrapper over the Video4Linux2 (V4L2) driver.
void setFramerate(vpV4l2FramerateType framerate)
void setInput(unsigned input=vpV4l2Grabber::DEFAULT_INPUT)
void open(vpImage< unsigned char > &I)
void setScale(unsigned scale=vpV4l2Grabber::DEFAULT_SCALE)
void setDevice(const std::string &devname)
VISP_EXPORT void sleepMs(double t)