ROS 使用自带和usb摄像头获取图像

   如果是LINUX移植,Make sure you've installed the ros-indigo-camera-info-manager package. 

ERROR: cannot launch node of type [image_view/image_view]: image_view
ROS path [0]=/opt/ros/indigo/share/ros
ROS path [1]=/home/ubuntu/catkin_ws/src
ROS path [2]=/opt/ros/indigo/share
ROS path [3]=/opt/ros/indigo/stacks


这种情况要装image-view

 sudo apt-get install ros-indigo-image-view


也可以使用安装usb_cam package的流程和上面的uvc_cam几乎一样:

    $ cd ~/catkin_ws/src  
    $ git clone https://github.com/bosch-ros-pkg/usb_cam.git  
    $ cd ~/catkin_ws  
    $ catkin_make  

 

  1.  cd catkin_ws/src  
  2. $ git clone https://github.com/bosch-ros-pkg/usb_cam.git  
  3. $ cd ..  
  4. $ catkin_make

  1. $ cd  
  2. $ cd catkin_ws/src/usb_cam/launch  
  3. $ roslaunch usb_cam-test.launch

 

我外接usb罗技摄像头,如果使用笔记本自带摄像头直接启动usb_cam启动文件即可


直接修改usb_cam包的启动文件usb_cam.launch

修改参数参考官网说明http://wiki.ros.org/usb_cam

   笔记本自带的摄像头的设备号一般为/dev/video0    外接摄像头一般是

1
"video_device" value= "/dev/video1" />

~pixel_format (string, default:"mjpeg")Possible values are mjpeg, yuyv, uyvy

我的摄像头这个参数不是默认值

1
"pixel_format" value= "yuyv" />
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
     
   
   "usb_cam" pkg= "usb_cam" type= "usb_cam_node" output= "screen" >
   
    "video_device" value= "/dev/video1" />
     "image_width" value= "640" />
     "image_height" value= "480" />
      "framerate" value= "30" />
     "pixel_format" value= "yuyv" />
     "camera_frame_id" value= "usb_cam" />
     "io_method" value= "mmap" />
  
   "image_view" pkg= "image_view" type= "image_view" respawn= "false" output= "screen" >
     "image" to= "/usb_cam/image_raw" />
     "autosize" value= "true" />
  

 

1
roslaunch usb_cam usb_cam.launch

 ROS 使用自带和usb摄像头获取图像_第1张图片

你可能感兴趣的:(ROS)