USB插入win10系统设备管理器/照相机/属性/详细信息/属性/硬件ID :VID_1BCF ;PID:2CBD
linux下输入,安装驱动:
sudo apt-get install ros-kinetic-libuvc-camera
sudo apt-get install ros-kinetic
-uvc-camera
二次开发程序源码:
/uvc_camera
/libuvc_camera
查看驱动安装是否成功:
lsusb
返回值:Bus 003 Device 005: ID 1bcf:2cbd 与win10下查到的一样就成功了
运行roscore
$ rosrun uvc_camera uvc_camera_node
$ rosrun image_view image_view image:=/image_raw
可显示图像
工作空间源代码安装
$ cd catkin_ws/src
$ git clone /bosch-ros-pkg/usb_cam.git
$ cd ..
$ catkin_make
roslaunch usb_cam usb_cam-test.launch显示图像
<launch><node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" ><param name="video_device" value="/dev/video0" /><param name="image_width" value="640" /><param name="image_height" value="480" /><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>
也可自己编写launch文件
建一个roslaunch imu_com camera-to1.launch
<launch><group ns="camera"><node pkg="uvc_camera" type="uvc_camera_node" name="mycam"><!-- Parameters used to find the camera --><param name="vendor" value="0x1bcf"/> <param name="product" value="0x2cbd"/><param name="serial" value="3"/><!-- If the above parameters aren't unique, choose the first match: --><param name="index" value="0"/><!-- Image size and type --><param name="width" value="1280"/><param name="height" value="720"/><!-- choose whichever uncompressed format the camera supports: --><param name="video_mode" value="mjpeg"/> <!-- or yuyv/nv12/mjpeg --><param name="frame_rate" value="30"/><param name="timestamp_method" value="start"/> <!-- start of frame --><param name="camera_info_url" value="file://$(find usb_cam)/example.yaml"/><param name="auto_white_balance" value="true"/></node></group><node pkg="image_view" type="image_view" name="image_view_test" output="screen"><remap from="image" to="/camera/image_raw"/></node></launch>
1