ros uvc摄像头驱动安装

USB插入win10系统设备管理器/照相机/属性/详细信息/属性/硬件ID :VID_1BCF ;PID:2CBD

linux下输入,安装驱动:

sudo apt-get install ros-kinetic-libuvc-camera

sudo apt-get install ros-kinetic-uvc-camera

二次开发程序源码:

http://wiki.ros.org/uvc_camera

http://wiki.ros.org/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 https://github.com/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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值