如果是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
- cd catkin_ws/src
- $ git clone https://github.com/bosch-ros-pkg/usb_cam.git
- $ cd ..
- $ catkin_make
- $ cd
- $ cd catkin_ws/src/usb_cam/launch
- $ roslaunch usb_cam-test.launch
我外接usb罗技摄像头,如果使用笔记本自带摄像头直接启动usb_cam启动文件即可
直接修改usb_cam包的启动文件usb_cam.launch
修改参数参考官网说明http://wiki.ros.org/usb_cam
笔记本自带的摄像头的设备号一般为/dev/video0 外接摄像头一般是
1
|
<param name= "video_device" value= "/dev/video1" /><br><br> |
~pixel_format (string, default:"mjpeg")Possible values are mjpeg, yuyv, uyvy
我的摄像头这个参数不是默认值
1
|
<param name= "pixel_format" value= "yuyv" /> |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
<launch> <node name= "usb_cam" pkg= "usb_cam" type= "usb_cam_node" output= "screen" > <param name= "video_device" value= "/dev/video1" /> <param name= "image_width" value= "640" /> <param name= "image_height" value= "480" /> <param name= "framerate" value= "30" /> <param name= "pixel_format" value= "yuyv" /> <param name= "camera_frame_id" value= "usb_cam" /> <param name= "io_method" value= "mmap" /> </node> <node name= "image_view" pkg= "image_view" type= "image_view" respawn= "false"
output= "screen" > <remap from= "image" to= "/usb_cam/image_raw" /> <param name= "autosize" value= "true" /> </node> </launch> |
1
|
roslaunch usb_cam usb_cam.launch |