39 #include <visp3/core/vpConfig.h> 41 #include <visp3/robot/vpRobotPioneer.h> 42 #include <visp3/core/vpCameraParameters.h> 43 #include <visp3/gui/vpDisplayGDI.h> 44 #include <visp3/gui/vpDisplayX.h> 45 #include <visp3/blob/vpDot2.h> 46 #include <visp3/visual_features/vpFeatureBuilder.h> 47 #include <visp3/visual_features/vpFeatureDepth.h> 48 #include <visp3/visual_features/vpFeaturePoint.h> 49 #include <visp3/core/vpHomogeneousMatrix.h> 50 #include <visp3/core/vpImage.h> 51 #include <visp3/core/vpImageConvert.h> 52 #include <visp3/sensor/vp1394TwoGrabber.h> 53 #include <visp3/sensor/vp1394CMUGrabber.h> 54 #include <visp3/sensor/vpV4l2Grabber.h> 55 #include <visp3/sensor/vpOpenCVGrabber.h> 56 #include <visp3/vs/vpServo.h> 57 #include <visp3/core/vpVelocityTwistMatrix.h> 59 #if defined(VISP_HAVE_DC1394) || defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_CMU1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) 60 #if defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI) 61 #if defined(VISP_HAVE_PIONEER) 62 # define TEST_COULD_BE_ACHIEVED 67 #undef VISP_HAVE_OPENCV // To use a firewire camera 68 #undef VISP_HAVE_V4L2 // To use a firewire camera 89 #ifdef TEST_COULD_BE_ACHIEVED 90 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())
127 std::cout <<
"Robot connected" << std::endl;
133 #if defined(VISP_HAVE_OPENCV) 135 std::cout <<
"Use device: " << device << std::endl;
136 cv::VideoCapture g(device);
137 g.set(CV_CAP_PROP_FRAME_WIDTH, 640);
138 g.set(CV_CAP_PROP_FRAME_HEIGHT, 480);
147 #elif defined(VISP_HAVE_V4L2) 156 #elif defined(VISP_HAVE_DC1394) 163 #elif defined(VISP_HAVE_CMU1394) 174 #if defined(VISP_HAVE_OPENCV) 182 #if defined(VISP_HAVE_X11) 184 #elif defined(VISP_HAVE_GDI) 208 std::cout <<
"cVe: \n" << cVe << std::endl;
213 std::cout <<
"eJe: \n" << eJe << std::endl;
237 std::cout <<
"Z " << Z << std::endl;
249 #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100) 277 std::cout <<
"Send velocity to the pionner: " << v[0] <<
" m/s " 292 std::cout <<
"Ending robot thread..." << std::endl;
296 robot.waitForRunExit();
303 std::cout <<
"Catch an exception: " << e << std::endl;
310 std::cout <<
"You don't have the right 3rd party libraries to run this example..." << std::endl;
Implementation of a matrix and operations on matrices.
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 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)
void set_eJe(const vpMatrix &eJe_)
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)
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)
void setGrayLevelPrecision(const double &grayLevelPrecision)
Firewire cameras video capture based on CMU 1394 Digital Camera SDK.
void setFramerate(unsigned long fps)
vpColVector computeControlLaw()
void acquire(vpImage< unsigned char > &I)
static void display(const vpImage< unsigned char > &I)
VISP_EXPORT void sleepMs(double t)
Generic class defining intrinsic camera parameters.
void setComputeMoments(const bool activate)
Implementation of a velocity twist matrix and operations on such kind of matrices.
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)
void buildFrom(const double x, const double y, const double Z)
Class for the Video4Linux2 video device.
static double deg(double rad)
Implementation of column vector and the associated operations.
void set_cVe(const vpVelocityTwistMatrix &cVe_)
void initTracking(const vpImage< unsigned char > &I, unsigned int size=0)
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
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)
void setServo(const vpServoType &servo_type)
void setGraphics(const bool activate)
void setFramerate(vpV4l2FramerateType framerate)