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


      也可以使用安装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  

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


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

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

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

    <param name="video_device" value="/dev/video1" />

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

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

     <param name="pixel_format" value="yuyv" />
    <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>
    
    roslaunch usb_cam usb_cam.launch 
    

     

  • 相关阅读:
    python——数据库操作
    【笔试】T实习生2014 总结
    【JS】Intermediate6:jQuery
    【JS】Intermediate5:Scope
    【JS】Intermediate4:JSON
    【JS】Intermediate3:AJAX
    【JS】Intermediate2:Events and Callbacks
    【JS】Intermediate1:The DOM
    【JS】Beginner9:Arrays
    【JS】Beginner8:Objects
  • 原文地址:https://www.cnblogs.com/CZM-/p/6024600.html
Copyright © 2020-2023  润新知