ros-drivers / libuvc_ros

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

uvc_find_device: No such device (-4) error with Ricoh Theta S #50

Closed sabetAI closed 6 years ago

sabetAI commented 6 years ago

lsusb -v shows:

Bus 003 Device 011: ID 05ca:0366 Ricoh Co., Ltd 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x05ca Ricoh Co., Ltd
  idProduct          0x0366 
  bcdDevice            1.00
  iManufacturer           1 Ricoh Company, Ltd.
  iProduct                2 RICOH THETA S
  iSerial                 3 00237095
  bNumConfigurations      1

/etc/udev/rules.d/99-uvc.rules:

# UVC cameras
`SUBSYSTEMS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="05ca", ATTRS{idProduct}=="0366", MODE="0666"`

launch file:

<launch>
  <group ns="camera">
    <node pkg="libuvc_camera" type="camera_node" name="mycam">
      <!-- Parameters used to find the camera -->
      <param name="vendor" value="0x05ca"/>
      <param name="product" value="0x0366"/>
      <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="1920"/>
      <param name="height" value="1080"/>
      <!-- choose whichever uncompressed format the camera supports: -->
      <param name="video_mode" value="uncompressed"/> <!-- or yuyv/nv12/mjpeg -->
      <param name="frame_rate" value="15"/>

      <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="false"/>
    </node>
  </group>
</launch>

I also added blacklist uvcvideo and blacklist snd-usb-audio to /etc/modprobe.d/uvc.conf.

Calling v4l2-ctl --list-formats-extgives me Failed to open /dev/video0: No such file or directory

7675t commented 6 years ago

You need to power on your camera in 'live camera' mode. It can be done by pressing the "mode" button (the button on the side with icons of camera and video) AND "power" button at same time. Keep pressing both button until the "Live" mark appeared on the front. This is described in the user manual.

The device descriptor '0366' is for data transfer mode. When the live cam mode enabled, the descriptor should be '2711'.

sabetAI commented 6 years ago

Now I'm getting:

SUMMARY
========

PARAMETERS
 * /camera/mycam/auto_exposure: 3
 * /camera/mycam/auto_white_balance: False
 * /camera/mycam/camera_info_url: file:///tmp/cam.yaml
 * /camera/mycam/frame_rate: 15
 * /camera/mycam/height: 1080
 * /camera/mycam/index: 0
 * /camera/mycam/product: 0x2711
 * /camera/mycam/serial: 
 * /camera/mycam/timestamp_method: start
 * /camera/mycam/vendor: 0x05ca
 * /camera/mycam/video_mode: uncompressed
 * /camera/mycam/width: 1920
 * /rosdistro: kinetic
 * /rosversion: 1.12.13

NODES
  /camera/
    mycam (libuvc_camera/camera_node)

ROS_MASTER_URI=http://localhost:11311

process[camera/mycam-1]: started with pid [6114]
unsupported descriptor subtype VS_COLORFORMAT
uvc_get_stream_ctrl_format_size: Invalid mode (-51)
[ERROR] [1534518468.352634863]: check video_mode/width/height/frame_rate are available

When I call v4l2-ctl --list-devices to check the support formats of the camera, it returns an error:

Failed to open /dev/video0: No such file or directory

When I try 1280x720 @ 15 fps, I get the same error, except with

[ERROR] [1534518704.187987897]: check video_mode/width/height/frame_rate are available
DEVICE CONFIGURATION (0000:0000/[none]) ---
Status: idle
VideoControl:
    bcdUVC: 0x6972
END DEVICE CONFIGURATION
7675t commented 6 years ago
<launch>
  <group ns="camera">
    <node pkg="libuvc_camera" type="camera_node" name="mycam">
      <!-- Parameters used to find the camera -->
      <param name="vendor" value="0x05ca"/>
      <param name="product" value="0x2711"/>
      <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="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="14"/>

      <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="false"/>
    </node>
  </group>
</launch>
sabetAI commented 6 years ago

Thank you so much! I experimented with different settings (ie video mode mjpeg and 1280x720), but wouldn't have guessed frame_rate=14 would work. Last question: what'd you use to generate your calibration file?

7675t commented 6 years ago

Good for you!

Do you mean the calibration to rectify the spherical images? As you see, the image from THETA S is not ordinary shape and two images are combined. It is not straight forward to rectify. You can use image_proc to split the image and use them as you like. I guess you can easily convert them to panoramic images using OpenCV.

And it may be typo, frame_rate can be 14, not 4.

Please close the issue if you are answered. Thanks!

DanielArnett commented 5 years ago

@sabetAI @7675t I'm still not able to view the images from my Theta S. I'm getting

unsupported descriptor subtype VS_COLORFORMAT
attempt to claim already-claimed interface 1
Not a JPEG file: starts with 0x25 0xd6
Couldn't convert frame to RGB: Unknown error (-99)

and the image shows up as all black. I believe I followed all of your instructions here, including putting it into live mode. Any ideas?