环境 : ubuntu14.04+ros indigo
推荐大家使用robware这个软件,方便,不用做中间的一些复杂的操作~
首先执行如下程序:
$ cd ~/catkin_ws/src
02.$ git clone https://github.com/bosch-ros-pkg/usb_cam.git
03.$ cd ~/catkin_ws
04.$ catkin_make
接下来需要在你的工作空间下 创建一个功能包,我这里创建的是zbar_opencv,
创建一个zbar_opencv.cpp
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <zbar.h>
#include <iostream>
#include <iomanip>
using namespace std;
using namespace cv;
using namespace zbar;
//static const std::string OPENCV_WINDOW="Image window";
void zbarscanner(cv_bridge