ros-drivers / libuvc_ros

http://www.ros.org/wiki/libuvc_ros
81 stars 96 forks source link

[libuvc_camera] support multiple video mode #22

Closed furushchev closed 8 years ago

furushchev commented 8 years ago

By default, this node only uses UNCOMPRESSED video mode, which fails on some camera devices. I make video_mode option work:

This PR may fix the issue https://github.com/ktossell/libuvc_ros/issues/20, https://github.com/ktossell/libuvc_ros/issues/17

furushchev commented 8 years ago

This is tested on my environment:

<!-- Apple Facetime HD Camera (Build-in) -->
<launch>
  <group ns="camera">
    <node pkg="libuvc_camera" type="camera_node" name="camera">
      <!-- Parameters used to find the camera -->
      <param name="vendor" value="0x05ac"/>
      <param name="product" value="0x8510"/>
      <param name="serial" value=""/>
      <!-- If the above parameters aren't unique, choose the first match: -->
      <param name="index" value="0"/>

      <!-- Image size and type -->
      <param name="width" value="640"/>
      <param name="height" value="480"/>
      <!-- choose whichever uncompressed format the camera supports: -->
      <param name="video_mode" value="yuyv"/>
      <param name="frame_rate" value="25"/>

      <param name="timestamp_method" value="start"/> <!-- start of frame -->
      <param name="camera_info_url" value="file:///tmp/cam.yaml"/>

      <param name="auto_exposure" value="3"/> <!-- use aperture_priority auto exposure -->
      <param name="auto_white_balance" value="true"/>
    </node>
  </group>
</launch>
furushchev commented 8 years ago

ping

ktossell commented 8 years ago

I don't have a working ROS environment to try this out, but it looks good. Thanks!