ros-drivers / libuvc_ros

http://www.ros.org/wiki/libuvc_ros
82 stars 95 forks source link

Unable to connect to multiple cameras simultaneously using index #28

Open joshvillbrandt opened 8 years ago

joshvillbrandt commented 8 years ago

I implemented the missing index functionality (libuvc #36, libuvc_ros #27) and am able to select a camera with an index. However, when I try to launch two instances of libuvc_camera simultaneously, the libuvc_camera instance that was started second always gets hung up somewhere in uvc_start_streaming(). Any ideas?

My launch file looks like this:

<?xml version="1.0"?>

<launch>
  <arg name="width" default="1280" />
  <arg name="height" default="720" />
  <arg name="video_mode" default="mjpeg" />
  <arg name="frame_rate" default="60" />

  <!-- start the left camera -->
  <node pkg="libuvc_camera" type="camera_node" name="left" ns="stereo/left">

    <!-- Parameters used to find the camera -->
    <param name="vendor" value="0x05a3"/>
    <param name="product" value="0x9230"/>
    <param name="index" value="0"/>

    <!-- Image size and type -->
    <param name="width" value="$(arg width)"/>
    <param name="height" value="$(arg height)"/>
    <param name="video_mode" value="$(arg video_mode)"/>
    <param name="frame_rate" value="$(arg frame_rate)"/>
  </node>

  <!-- start the right camera -->
  <node pkg="libuvc_camera" type="camera_node" name="right" ns="stereo/right">

    <!-- Parameters used to find the camera -->
    <param name="vendor" value="0x05a3"/>
    <param name="product" value="0x9230"/>
    <param name="index" value="1"/>

    <!-- Image size and type -->
    <param name="width" value="$(arg width)"/>
    <param name="height" value="$(arg height)"/>
    <param name="video_mode" value="$(arg video_mode)"/>
    <param name="frame_rate" value="$(arg frame_rate)"/>
  </node>
</launch>
joshvillbrandt commented 8 years ago

I have verified that both of the node sections in the previously mentioned launch file work independently. I also also verified that both camera work simultaneously with identical video settings using different drivers (so USB bus bandwidth shouldn't be the problem.)

cyborg-x1 commented 8 years ago

I can confirm this as well, I have two cheap chinese laptop camera modules here, both with serial set to 0, even if index is set differently it does always try to open the same camera.

stwirth commented 8 years ago

Same for me. I've connected four cameras (all same vendor/product) and cannot select them by index. The driver always opens the first one. Even invalid indices (like 100) don't given an error.

givip commented 5 years ago

Same for me, anything changed after 3 years?

gr8jam commented 5 years ago

I am also interested if any progress was made regarding this topic.