1

我想在 ROS 动力学上运行 uvc_camera,但遇到错误“uvc_start_streaming:无效模式(-51)”的问题

我的相机参数:

ioctl: VIDIOC_ENUM_FMT
Index       : 0
Type        : Video Capture
Pixel Format: 'YUYV'
Name        : YUYV 4:2:2
    Size: Discrete 1280x720
        Interval: Discrete 0.017s (60.000 fps)
        Interval: Discrete 0.033s (30.000 fps)
    Size: Discrete 2560x720
        Interval: Discrete 0.017s (60.000 fps)
        Interval: Discrete 0.033s (30.000 fps)
    Size: Discrete 2560x960
        Interval: Discrete 0.033s (30.000 fps)
    Size: Discrete 1280x480
        Interval: Discrete 0.011s (90.000 fps)
        Interval: Discrete 0.017s (60.000 fps)
        Interval: Discrete 0.033s (30.000 fps)
    Size: Discrete 640x480
        Interval: Discrete 0.011s (90.000 fps)
        Interval: Discrete 0.017s (60.000 fps)
        Interval: Discrete 0.033s (30.000 fps)

Index       : 1
Type        : Video Capture
Pixel Format: 'MJPG' (compressed)
Name        : Motion-JPEG
    Size: Discrete 1280x720
        Interval: Discrete 0.017s (60.000 fps)
        Interval: Discrete 0.033s (30.000 fps)
    Size: Discrete 2560x720
        Interval: Discrete 0.017s (60.000 fps)
        Interval: Discrete 0.033s (30.000 fps)
    Size: Discrete 2560x960
        Interval: Discrete 0.033s (30.000 fps)

启动文件:

<launch>
  <group ns="camera">
  <node pkg="libuvc_camera" type="camera_node" name="mycam">
  <!-- Parameters used to find the camera -->
  <param name="vendor" value="0x0211"/>
  <param name="product" value="0x5838"/>
  <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="2560"/>
  <param name="height" value="960"/>
  <!-- choose whichever uncompressed format the camera supports: -->
  <param name="video_mode" value="mjpeg"/> <!-- or uncompressed/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:///tmp/cam.yaml"/>

  <param name="brightness" value="50" />

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

启动时的消息:

... logging to /home/flaver/.ros/log/62ad8bb8-23af-11eb-8725-000c2914e622/roslaunch-ubuntu-6727.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu:33305/

SUMMARY
========

PARAMETERS
* /camera/mycam/auto_exposure: 3
* /camera/mycam/auto_white_balance: True
* /camera/mycam/brightness: 50
* /camera/mycam/camera_info_url: file:///tmp/cam.yaml
* /camera/mycam/frame_rate: 30
* /camera/mycam/height: 960
* /camera/mycam/index: 0
* /camera/mycam/product: 0x5838
* /camera/mycam/serial: 
* /camera/mycam/timestamp_method: start
* /camera/mycam/vendor: 0x0211
* /camera/mycam/video_mode: uncompressed
* /camera/mycam/width: 2560
* /rosdistro: kinetic
* /rosversion: 1.12.16

NODES
  /camera/
    mycam (libuvc_camera/camera_node)

ROS_MASTER_URI=http://localhost:11311

process[camera/mycam-1]: started with pid [6744]
unsupported descriptor subtype VS_COLORFORMAT
unsupported descriptor subtype VS_COLORFORMAT
unsupported descriptor subtype VS_COLORFORMAT
attempt to claim already-claimed interface 1
uvc_start_streaming: Invalid mode (-51)
[camera/mycam-1] process has died [pid 6744, exit code 255, cmd 
/home/flaver/catkin_ws/devel/lib/libuvc_camera/camera_node __name:=mycam 
__log:=/home/flaver/.ros/log/62ad8bb8-23af-11eb-8725-000c2914e622/camera-mycam-1.log].
log file: /home/flaver/.ros/log/62ad8bb8-23af-11eb-8725-000c2914e622/camera-mycam-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done

错误

我知道大多数问题都发生在“图像大小和类型”领域,但我已经非常关注它。

我在网上找了很久。但是没有用。请帮助或尝试提供一些想法如何实现这一目标。

4

0 回答 0