libuvc_camera
is a ROS driver that supports webcams and other UVC-standards-compliant video devices.
It's a cross-platform replacement for uvc_camera
, a Linux-only webcam driver.
Documentation is available on the ROS wiki: libuvc_camera.
Home Page: http://www.ros.org/wiki/libuvc_ros
libuvc_camera
is a ROS driver that supports webcams and other UVC-standards-compliant video devices.
It's a cross-platform replacement for uvc_camera
, a Linux-only webcam driver.
Documentation is available on the ROS wiki: libuvc_camera.
Hi,
I would like to test a USB camera on ROS. I have followed the procedure to setup libuvc but the image on the raw topic is not rendered well.
This is a capture of the image on the topic /camera/image_raw, as you will see the image seems to be duplicated.
This is the output of the v4l2-ctl --list-formats-ext command:
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'UYVY'
Name : UYVY 4:2:2
Size: Discrete 640x480
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.022s (45.000 fps)
Size: Discrete 960x540
Interval: Discrete 0.017s (58.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1280x960
Interval: Discrete 0.029s (34.000 fps)
Interval: Discrete 0.044s (22.500 fps)
Size: Discrete 1280x720
Interval: Discrete 0.022s (45.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
And this is my 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="0x2560"/>
<param name="product" value="0xc120"/>
<param name="serial" value=""/>
<!-- If the above parameters aren't unique, choose the first match: -->
<param name="index" value="3"/>
<!-- Image size and type -->
<param name="width" value="960"/>
<param name="height" value="540"/>
<!-- choose whichever uncompressed format the camera supports: -->
<param name="video_mode" value="uyvy"/> <!-- 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="package://robot/config/cam0_calib.yaml"/>
<param name="auto_exposure" value="3"/> <!-- use aperture_priority auto exposure -->
<param name="auto_white_balance" value="false"/>
</node>
</group>
</launch>
Do you see something wrong?
My configuration is a computer running Ubuntu 16.04 with ROS Kinetic.
Thanks in advance,
Yoann.
Hey there,
I want to use a logitech camera c930e with libuvc_ros. I currently have this 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="0x046d"/>
<param name="product" value="0x0843"/>
<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="mjpeg"/> <!-- or 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="auto_exposure" value="3"/> <!-- use aperture_priority auto exposure -->
<param name="auto_white_balance" value="false"/>
</node>
</group>
</launch>
This is my device lsusb -v:
Bus 003 Device 004: ID 046d:0843 Logitech, Inc. Webcam C930e
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 ?
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x046d Logitech, Inc.
idProduct 0x0843 Webcam C930e
bcdDevice 0.13
iManufacturer 0
iProduct 2
iSerial 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 2547
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 14 Video
bFunctionSubClass 3 Video Interface Collection
bFunctionProtocol 0
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 1 Video Control
bInterfaceProtocol 0
iInterface 0
VideoControl Interface Descriptor:
bLength 13
bDescriptorType 36
bDescriptorSubtype 1 (HEADER)
bcdUVC 1.00
wTotalLength 215
dwClockFrequency 30.000000MHz
bInCollection 1
baInterfaceNr( 0) 1
VideoControl Interface Descriptor:
bLength 18
bDescriptorType 36
bDescriptorSubtype 2 (INPUT_TERMINAL)
bTerminalID 1
wTerminalType 0x0201 Camera Sensor
bAssocTerminal 0
iTerminal 0
wObjectiveFocalLengthMin 0
wObjectiveFocalLengthMax 0
wOcularFocalLength 0
bControlSize 3
bmControls 0x00020a2e
Auto-Exposure Mode
and I also created this file: /etc/udev/rules.d
# UVC cameras
`SUBSYSTEMS=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0843", MODE="0666"`
If I launch the above launch file with camera connected I get this error:
[ERROR] [1551621905.341226531]: Permission denied opening /dev/bus/usb/003/004
[camera/mycam-2] process has died [pid 9685, exit code 255, cmd /opt/ros/kinetic/lib/libuvc_camera/camera_node __name:=mycam __log
any ideas what I did wrong?!
ROS version: Noetic, 1.15.14
Error:
[ INFO] [1655832145.573988779]: Loading nodelet /libuvc_camera of type libuvc_camera/driver to manager /nodelet_manager with the following remappings:
[ INFO] [1655832145.576714841]: waitForService: Service [/nodelet_manager/load_nodelet] could not connect to host [192.168.10.102:40781], waiting...
[ INFO] [1655832145.603768486]: Initializing nodelet with 8 worker threads.
[ INFO] [1655832145.618246063]: waitForService: Service [/nodelet_manager/load_nodelet] is now available.
free(): invalid pointer
[FATAL] [1655832145.815128191]: Failed to load nodelet '/libuvc_cameraof type
libuvc_camera/driverto manager
/nodelet_manager'
[nodelet_manager-1] process has died [pid 247536, exit code -6, cmd /opt/ros/noetic/lib/nodelet/nodelet manager __name:=nodelet_manager __log:=/home/.....
Unable to run camera node, rosservice shows services running and some topics too.
There is actually no usb cam driver cam as binary for Kinetic.
Please add this package to Kinetic main repository, so we can install via:
sudo apt-get install ros-kinetic-libuvc-ros
Hi!
I've been trying to figure out this one for quite a while now. I have 3 cameras (same manufacturer and model), when checking the settings the 3 parameters of vendor, product and serial are the same. The only way I can launch different cameras is by modifying the index parameter.
Is there any way I can have a control of the camera index? Ideally I would like to prefix my camera names according to the robot placement (forward, left, right). If the driver used the device path (/dev/video0 etc) then I would create a symlink based on the USB port the device is connected to.
Any tips how could I solve this particular problem? I know uvc_camera node can take a device path but I would prefer to stick with libuvc_ros if possible.
please cherry-pick these fixes to master.
Support for the current LTS would be nice!
I am getting a bunch of errors trying to compile the code all in the following format:
"camera_driver.cpp: error: was not declared in this scope"
if (uvc_set_##fn(devh_, val)) { \
For example:
libuvc_ros/libuvc_camera/src/camera_driver.cpp:117:34: error: 'uvc_set_gain' was not declared in this scope
if (uvc_set_##fn(devh_, val)) {
I have installed libuvc from https://github.com/ktossell/libuvc
compiling with catkin build libuvc_ros
Hi,
I am aware that the libuvc currently does not support uvc extension units. However, I need to to set the triggering mode of the camera. I am just wondering of there are any recommendations or suggestions for me to do so?
Thanks
Regards
Kelvin
Hi, I cloned the most recent version of the libuvc_ros repo (master) into my src folder and ran catkin_make_isolated --pkg libuvc_camera --install , and then I got an error while building, I reproduced the error, as suggested, and got:
<== Failed to process package 'libuvc_camera':
Command '['/Users/gunshigupta/ros_catkin_ws/install_isolated/env.sh', 'make', '-j4', '-l4']' returned non-zero exit status 2Reproduce this error by running:
==> cd /Users/gunshigupta/ros_catkin_ws/build_isolated/libuvc_camera && /Users/gunshigupta/ros_catkin_ws/install_isolated/env.sh make -j4 -l4Command failed, exiting.
yguns-MacBook-Pro:ros_catkin_ws gunshigupta$ cd /Users/gunshigupta/ros_catkin_ws/build_isolated/libuvc_camera && /Users/gunshigupta/ros_catkin_ws/install_isolated/env.sh make -j4 -l4
[ 14%] Built target libuvc_camera_gencfg
[ 42%] Building CXX object CMakeFiles/libuvc_camera_nodelet.dir/src/camera_driver.cpp.o
[ 42%] Building CXX object CMakeFiles/camera_node.dir/src/camera_driver.cpp.o
/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:193:/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp28::193 :28: error: error:
use
ofuse undeclaredof identifierundeclared 'uvc_mjpeg2rgb'identifier
'uvc_mjpeg2rgb'
uvc_error_t conv_ret = uvc_mjpeg2rgb(frame, rgb_frame_); uvc_error_t conv_ret = uvc_mjpeg2rgb(frame, rgb_frame_);^ ^
/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:242::24259::59 : warning: warning:
formatformat specifiesspecifies typetype 'unsigned int''unsigned int' butbut thethe argumentargument hashas typetype 'size_t''size_t' (aka 'unsigned long')(aka 'unsigned long') [-Wformat][-Wformat] status_class, event, selector, status_attribute, data_en); status_class, event, selector, status_attribute, data_len); ^~~~~~~~ ^~~~~~~~
/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:245:13: warning: /Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp
: 245enumeration: 13value: 'UVC_STATUS_CLASS_CONTROL' notwarning : handled in
switch enumeration
value[-Wswitch] 'UVC_STATUS_CLASS_CONTROL'
not handled in switch
[-Wswitch]
switch (status_class) {
^
switch (status_class) {
^
/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:323:26: error:
use of undeclared identifier 'uvc_find_devices'; did you mean
'uv_find_device'?
uvc_error_t find_err = uvc_find_devices(
^~~~~~~~~~~~~~~~
uv_find_device
/usr/local/Cellar/libuvc/0.0.5/include/libuvc/libuvc.h:371:13: note:
'uvc_find_device' declared here
uvc_error_t uvc_find_device(
^
/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:323:26: error:
use of undeclared identifier 'uvc_find_devices'; did you mean
'uv_find_device'?
uvc_error_t find_err = uvc_find_devices(
^~~~~~~~~~~~~~~~
uv_find_device
/usr/local/Cellar/libuvc/0.0.5/include/libuvc/libuvc.h:371:13: note:
'uvc_find_device' declared here
uvc_error_t uvc_find_device(
^
/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp:/Users/gunshigupta/ros_catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp324::32411::11 : errorerror: :cannotcannot initializeinitialize aa parameterparameter ofof typetype 'uvc_device_t **''uvc_device_t **' (aka 'uvc_device **')(aka 'uvc_device **') withwith anan rvaluervalue ofof typetype 'uvc_device_t ***''uvc_device_t ***' (aka 'uvc_device ***')(aka 'uvc_device ***') ctx_, &devs, ctx_, &devs, ^~~~~ ^~~~~
/usr/local/Cellar/libuvc/0.0.5/include/libuvc/libuvc.h:373:20: note: passing
argument to parameter 'dev' here
uvc_device_t *_dev,
^
/usr/local/Cellar/libuvc/0.0.5/include/libuvc/libuvc.h:373:20: note: passing
argument to parameter 'dev' here
uvc_device_t *_dev,
^
2 warnings and 3 errors generated.
2 warnings and 3 errors generated.
make[2]: *** [CMakeFiles/camera_node.dir/src/camera_driver.cpp.o] Error 1
make[2]: *** [CMakeFiles/libuvc_camera_nodelet.dir/src/camera_driver.cpp.o] Error 1
make[1]: *** [CMakeFiles/camera_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/libuvc_camera_nodelet.dir/all] Error 2
make: *** [all] Error 2
What do I do to fix it?
Thanks!
What are the causes for that? I have a Sony FCB EV7500 and get the error:
uvc_start_iso_streaming: Not supported (-12)
I just git clone the packages and catkin_make, I got such error.
My ROS verision is kinetic
CMakeFiles/camera_node.dir/src/camera_driver.cpp.o: In function libuvc_camera::CameraDriver::~CameraDriver()': camera_driver.cpp:(.text+0x4a4): undefined reference to
uvc_free_frame'
camera_driver.cpp:(.text+0x4c7): undefined reference to uvc_exit' CMakeFiles/camera_node.dir/src/camera_driver.cpp.o: In function
libuvc_camera::CameraDriver::Start()':
camera_driver.cpp:(.text+0x67f): undefined reference to uvc_init' camera_driver.cpp:(.text+0x6a0): undefined reference to
uvc_perror'
CMakeFiles/camera_node.dir/src/camera_driver.cpp.o: In function libuvc_camera::CameraDriver::Stop()': camera_driver.cpp:(.text+0x847): undefined reference to
uvc_exit'
CMakeFiles/camera_node.dir/src/camera_driver.cpp.o: In function libuvc_camera::CameraDriver::ReconfigureCallback(libuvc_camera::UVCCameraConfig&, unsigned int)': camera_driver.cpp:(.text+0xa0d): undefined reference to
uvc_set_scanning_mode'
camera_driver.cpp:(.text+0xba5): undefined reference to uvc_set_ae_mode' camera_driver.cpp:(.text+0xd32): undefined reference to
uvc_set_ae_priority'
camera_driver.cpp:(.text+0xeda): undefined reference to uvc_set_exposure_abs' camera_driver.cpp:(.text+0x107e): undefined reference to
uvc_set_focus_auto'
camera_driver.cpp:(.text+0x120c): undefined reference to uvc_set_focus_abs' camera_driver.cpp:(.text+0x1399): undefined reference to
uvc_set_gain'
camera_driver.cpp:(.text+0x1538): undefined reference to uvc_set_iris_abs' camera_driver.cpp:(.text+0x16c0): undefined reference to
uvc_set_brightness'
camera_driver.cpp:(.text+0x1860): undefined reference to uvc_set_pantilt_abs' CMakeFiles/camera_node.dir/src/camera_driver.cpp.o: In function
libuvc_camera::CameraDriver::ImageCallback(uvc_frame*)':
camera_driver.cpp:(.text+0x1ee0): undefined reference to uvc_uyvy2bgr' camera_driver.cpp:(.text+0x1f01): undefined reference to
uvc_perror'
camera_driver.cpp:(.text+0x2192): undefined reference to uvc_yuyv2bgr' camera_driver.cpp:(.text+0x21b3): undefined reference to
uvc_perror'
camera_driver.cpp:(.text+0x2266): undefined reference to uvc_mjpeg2rgb' camera_driver.cpp:(.text+0x2287): undefined reference to
uvc_perror'
camera_driver.cpp:(.text+0x2327): undefined reference to uvc_any2bgr' camera_driver.cpp:(.text+0x2348): undefined reference to
uvc_perror'
CMakeFiles/camera_node.dir/src/camera_driver.cpp.o: In function libuvc_camera::CameraDriver::OpenCamera(libuvc_camera::UVCCameraConfig&)': camera_driver.cpp:(.text+0x301c): undefined reference to
uvc_find_devices'
camera_driver.cpp:(.text+0x303d): undefined reference to uvc_perror' camera_driver.cpp:(.text+0x30de): undefined reference to
uvc_unref_device'
camera_driver.cpp:(.text+0x3236): undefined reference to uvc_open' camera_driver.cpp:(.text+0x3330): undefined reference to
uvc_get_device_address'
camera_driver.cpp:(.text+0x3349): undefined reference to uvc_get_bus_number' camera_driver.cpp:(.text+0x345f): undefined reference to
uvc_strerror'
camera_driver.cpp:(.text+0x3478): undefined reference to uvc_get_device_address' camera_driver.cpp:(.text+0x3491): undefined reference to
uvc_get_bus_number'
camera_driver.cpp:(.text+0x34f8): undefined reference to uvc_unref_device' camera_driver.cpp:(.text+0x351f): undefined reference to
uvc_set_status_callback'
camera_driver.cpp:(.text+0x35a5): undefined reference to uvc_get_stream_ctrl_format_size' camera_driver.cpp:(.text+0x35d6): undefined reference to
uvc_perror'
camera_driver.cpp:(.text+0x35ec): undefined reference to uvc_close' camera_driver.cpp:(.text+0x3602): undefined reference to
uvc_unref_device'
camera_driver.cpp:(.text+0x3721): undefined reference to uvc_print_diag' camera_driver.cpp:(.text+0x3755): undefined reference to
uvc_start_streaming'
camera_driver.cpp:(.text+0x3776): undefined reference to uvc_perror' camera_driver.cpp:(.text+0x378c): undefined reference to
uvc_close'
camera_driver.cpp:(.text+0x37a2): undefined reference to uvc_unref_device' camera_driver.cpp:(.text+0x37d0): undefined reference to
uvc_free_frame'
camera_driver.cpp:(.text+0x37fd): undefined reference to uvc_allocate_frame' CMakeFiles/camera_node.dir/src/camera_driver.cpp.o: In function
libuvc_camera::CameraDriver::CloseCamera()':
camera_driver.cpp:(.text+0x39ab): undefined reference to uvc_close' camera_driver.cpp:(.text+0x39cd): undefined reference to
uvc_unref_device'
collect2: error: ld returned 1 exit status
libuvc_ros/libuvc_camera/CMakeFiles/camera_node.dir/build.make:192: recipe for target '/home/ur5/ur5_ws/devel/lib/libuvc_camera/camera_node' failed
make[2]: *** [/home/ur5/ur5_ws/devel/lib/libuvc_camera/camera_node] Error 1
CMakeFiles/Makefile2:8705: recipe for target 'libuvc_ros/libuvc_camera/CMakeFiles/camera_node.dir/all' failed
make[1]: *** [libuvc_ros/libuvc_camera/CMakeFiles/camera_node.dir/all] Error 2
Could you tell me how to fix such error?
Permission denied error should print which /dev/bus/usb/ device
SUBSYSTEM=="usb", ATTRS{idVendor}=="f00f", ATTRS{idProduct}=="f0f0", GROUP="video"
there is no frame_id set in both camera_info and image_raw
I have a stereo camera which outputs video in the Y16 grayscale format equivalent to V4L2_PIX_FMT_Y16.
I am trying to figure out how to adapt the libuvc_camera driver to support this and would be grateful for any suggestions on what would be the best way to go about this.
I believe Motion JPEG(mjpeg) cameras are not supported in current released ROS packages. Is it correct?
I think the remedy is to release libuvc newly (v.0.0.6). It will resolve all problem related to mjpeg.
I'm not sure the backward compatibility of libuvc to v.0.0.5. Are there any difficulties to release libuvc v0.0.6 ? @ktossell
Thank you.
I'm trying tofigure out the relationship between this and the variious other ros uvc packages. It would be great if there was a README file that explained what this was, what the status for this was ... and what the corresponding ros package/node was.
I posted some more inter-related questions here: ros-drivers/camera_umd#16
Thanks !
The first line of libuvc_ros/libuvc_camera/cfg/UVCCamera.cfg
is
#! /usr/bin/env python2
this results in the following error
env: python2: No such file or directory
I simply changed the first line of the file to #! /usr/bin/env python
, it worked, however I am not sure if that is a right solution.
Hi,
I'm having a problem with my PS3 eye camera, getting a device not found error (-4).
dmesg output for the camera:
[ 1096.865989] usb 2-1.6: USB disconnect, device number 5
[ 1098.343289] usb 2-1.6: new high-speed USB device number 6 using ehci-pci
[ 1098.437941] usb 2-1.6: New USB device found, idVendor=1415, idProduct=2000
[ 1098.437946] usb 2-1.6: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1098.437949] usb 2-1.6: Product: USB Camera-B4.09.24.1
[ 1098.437952] usb 2-1.6: Manufacturer: OmniVision Technologies, Inc.
[ 1098.438363] gspca_main: ov534-2.14.0 probing 1415:2000
My launch file:
<!-- 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"/> <!-- or yuyv/nv12/jpeg -->
<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="auto_exposure" value="3"/> <!-- use aperture_priority auto exposure -->
<param name="auto_white_balance" value="false"/>
</node>
Execution output:
PARAMETERS
NODES
/uas1/
camera (libuvc_camera/camera_node)
ROS_MASTER_URI=http://localhost:11311
core service [/rosout] found
process[uas1/camera-1]: started with pid [10087]
uvc_find_device: No such device (-4)
[uas1/camera-1] process has died [pid 10087, exit code 255, cmd /home/rmw/devel/ros/devel/lib/libuvc_camera/camera_node __name:=camera __log:=/home/rmw/.ros/log/0432b43a-3e7a-11e4-b1a0-a0b3ccfb07e5/uas1-camera-1.log].
log file: /home/rmw/.ros/log/0432b43a-3e7a-11e4-b1a0-a0b3ccfb07e5/uas1-camera-1*.log
all processes on machine have died, roslaunch will exit
Any help would be appreciated.
When using libuvc, I am having an issue that the image is all green when saturated (instead of all white). I believe this is because the image is being interpreted as the wrong type. When using OpenCV, I can see the correct image by recoloring it as such:
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) proc = cv2.cvtColor(gray, cv2.COLOR_BayerBG2BGR)
How do I solve this problem in libuvc_ros ?
Hi,
I am trying to use a Logitech c920 Pro camera in ROS.
I installed everything, usb_cam driver is working fine, but the FPS is low.
I have some issues with libuvc_ros with the camera. It is working with the attached launch file, but I can not increase the FPS for fullhd resolution. The supported modes is in this file:
modes.txt
It is working only if the video_mode is uncompressed or yuyv and the frame_rate is 5. In the modes, I can see jpeg video_mode, where the frame_rate is 30, but if I try to set it up, I get -51 error.
Where should I search for the problem?
Launch file:
<launch>
<group ns="camera">
<node pkg="libuvc_camera" type="camera_node" name="c920">
<!-- Parameters used to find the camera -->
<param name="vendor" value="0x046d"/>
<param name="product" value="0x082d"/>
<param name="serial" value="1"/>
<!-- 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/jpeg -->
<param name="frame_rate" value="5"/>
<param name="timestamp_method" value="start"/> <!-- start of frame -->
<param name="camera_info_url" value="file:///home/ubuntu/src/libuvc/cameras/logitech_hd_pro_920.txt"/>
<param name="auto_exposure" value="3"/> <!-- use aperture_priority auto exposure -->
<param name="auto_white_balance" value="false"/>
</node>
</group>
</launch>
The default brightness setting of 0 (defined here) makes the image from my integrated camera very dark. I have a Lenovo ThinkPad T490 with an Acer integrated camera (5986:2113), and v4l2-ctl -l
reports the brightness range is [0, 255] with a default value of 128.
I'm able to work around this by just setting the brightness when I launch a libuvc_camera
node, but I'm posting this in case anyone else runs into it, and on the off-chance that it'd be feasible to use the system defaults instead of hard-coded defaults that might not be appropriate for all systems.
Hello,
I'm trying to use this package but I get this message when I do the catkin_make:
CMake Error at libuvc_ros-master/libuvc_camera/CMakeLists.txt:9 (find_package):
By not providing "Findlibuvc.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "libuvc", but
CMake did not find one.
Could not find a package configuration file provided by "libuvc" with any
of the following names:
libuvcConfig.cmake
libuvc-config.cmake
Add the installation prefix of "libuvc" to CMAKE_PREFIX_PATH or set
"libuvc_DIR" to a directory containing one of the above files. If "libuvc"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/home/paulo/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/paulo/catkin_ws/build/CMakeFiles/CMakeError.log".
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
Missing config files?
There is no time stamp in /image_raw/header when I run rosrun libuvc_camera camera_node
. I'm using Orbbec Astra Pro camera in Ubuntu16.04 and ROS Kinectic.
Here is one of example of /image_raw/header.
seq: 35
stamp:
secs: 0
nsecs: 0
frame_id: camera
Hello, I'm one of the ros melodic Arch maintainers and I currently face this issue:
catkin 0.7.19
/build/src/libuvc_ros-0.0.10/libuvc_camera/src/camera_driver.cpp: In member function ‘void libuvc_camera::CameraDriver::ImageCallback(uvc_frame_t*)’:
/build/src/libuvc_ros-0.0.10/libuvc_camera/src/camera_driver.cpp:203:28: error: ‘uvc_mjpeg2rgb’ was not declared in this scope; did you mean ‘uvc_any2rgb’?
203 | uvc_error_t conv_ret = uvc_mjpeg2rgb(frame, rgb_frame_);
| ^~~~~~~~~~~~~
| uvc_any2rgb
/build/src/libuvc_ros-0.0.10/libuvc_camera/src/camera_driver.cpp: In member function ‘void libuvc_camera::CameraDriver::ImageCallback(uvc_frame_t*)’:
/build/src/libuvc_ros-0.0.10/libuvc_camera/src/camera_driver.cpp:203:28: error: ‘uvc_mjpeg2rgb’ was not declared in this scope; did you mean ‘uvc_any2rgb’?
203 | uvc_error_t conv_ret = uvc_mjpeg2rgb(frame, rgb_frame_);
| ^~~~~~~~~~~~~
| uvc_any2rgb
make[2]: *** [CMakeFiles/camera_node.dir/build.make:76: CMakeFiles/camera_node.dir/src/camera_driver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:156: CMakeFiles/camera_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/libuvc_camera_nodelet.dir/build.make:76: CMakeFiles/libuvc_camera_nodelet.dir/src/camera_driver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:124: CMakeFiles/libuvc_camera_nodelet.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Hi !
I can not figure out why I can't use this library with the usb-connected arducam (using ardushield for usb connection)
Can you help me out ?
Thanks!
Hi,
I want to ask does anybody know how to change the launch file to make multicamera works?
I did not find any place to change ros ouput name field. Could somebody give some examples? Thanks!!!
I use the following launch file:
<!-- 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="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>
change the first line's name does not work.
I have installed it in Ubuntu 14.04 LTS. When I connect with a camera and execute rosrun libuvc_camera camera_node vendor:=xxx
, the following error shows.
Opening camera with vendor=0x0, product=0x0, serial="", index=0
/opt/ros/indigo/lib/libuvc_camera/camera_node: symbol lookup error: /opt/ros/indigo/lib/libuvc.so: undefined symbol: libusb_set_auto_detach_kernel_driver
I've tried to install ros-indigo-libuvc
, ros-indigo-libuvc-ros
and ros-indigo-libuvc-camera
, but it doesn't work. See if someone has experienced the same issue here.
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-ext
gives me Failed to open /dev/video0: No such file or directory
I've been trying the very latest libuvc and libuvc_camera with ros jade on Ubuntu 14.04 and either a Logitech C930e or a Webcam 9000 Pro and I can't reconfigure the camera. The scanning_mode initial value is very large and often negative, and appears random on every launch of the camera_node. Trying to change most other parameters triggers an attempt to set scanning_mode to a sane value which fails- and sometimes makes the setting of the other value fail.
rqt_reconfigure doesn't like the big numbers and generates a ValueError.
I have more details here:
http://answers.ros.org/question/220560/dynamic-reconfigure-with-libuvc_camera-in-jade/
The CI job http://jenkins.ros.org/job/devel-hydro-libuvc_ros/ARCH_PARAM=amd64,UBUNTU_PARAM=precise,label=devel/16/console fails since commit 30b3cfd.:
libuvc_ros/libuvc_camera/src/camera_driver.cpp:286:153: error: 'uvc_strerror' was not declared in this scope
Hi,
I have tried searching through the net and also reading the following link:
https://ken.tossell.net/libuvc/doc/group__streaming.html
Howevere, I am still unsure of the difference between uvc_start_streaming and uvc_stream_start.
Thanks
Regards
Kelvin
Camera with bayer output (for V4L it's BA81 format) doesn't work with libuvc_ros - for instance this one: http://www.e-consystems.com/1MP-USB3-Vision-Camera.asp. It seems that current libuvc has support for this format (https://github.com/ktossell/libuvc/blob/master/include/libuvc/libuvc.h#L72) - am I right?
The camera occasionally produces an Error: e210fffc, and upon executing the 'lsusb' command in the Jetson terminal,
it has been confirmed that the camera is not recognized. The log at the time of the issue is as follows:
Error: e210fffc
[ INFO] [1689308329.098251080]: [Camera] Camera closed
terminate called after throwing an instance of 'boost::wrapexcept<boost::lock_error>'
what(): boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Debugging code has been attached to demonstrate how to trace the issue when the error occurs.
Based on the observed circumstances, it is inferred that 'ptrGrabResult->GrabSucceeded()' is evaluating to False.
[ INFO] [1689322235.991963013]: trigger_num : 8
[ INFO] [1689322235.991984134]: A
[ INFO] [1689322235.992001638]: B
[ INFO] [1689322236.003959851]: [Camera] simulator recommend by stage 25, 23, 50
[ INFO] [1689322236.520937697]: [Camera] simulator recommend by stage 26, 24, 55
[ INFO] [1689322236.775835207]: C
Error: e210fffc
[ INFO] [1689322236.804900722]: [Camera] Camera closed
Additionally, it is noted that monitoring the camera temperature has been performed previously,
and it is unrelated to the current error.
I am trying to stream from 6 camera using this ros package. I am getting data from 5 cameras but the 6th camera is not sending any data at all. Every time it's launched, a different camera wouldn't stream data. i.e at any time only 5 camera are being streamed.
Specs:
Is there any limitation on the library?
Is it possible to release this package on noetic ? It works fine on Ubuntu 20.04 with libuvc-dev (PR in rosdep ros/rosdistro#28285)
I can help to release it if needed.
Hi,
I am currently using libuvc for my camera. I would like to use the ioctl function to set the triggering mode for this camera and it requires the file descriptor to the open device. Unlike open() which returns the file descriptor of the open device, uvc_open() returns the handle to the open device. As such, I am unable to use the ioctl function to set the triggering mode.
Would appreciate for an advice on the above-mentioned issue.
Thanks
Regards
Kelvin
Hi,
I just noticed, that parameter video_mode is completely ignored and uncompressed mode is always used (https://github.com/ktossell/libuvc_ros/blob/master/libuvc_camera/src/camera_driver.cpp#L315) which is unfortunatelly not supported for some devices. I can try to fix this but don't have much experience with this UVC stuff...
Hi,
I would like to change resolution and frame rate when it is running. I see that it is possible to do it with dynamic paramters.
In my launch file I am starting the camera 5FPS FullHd yuyv, but with the above script I would like to set 640x480 resolution and 20FPS:
rosrun dynamic_reconfigure dynparam set /camera/c920 "{'width':640, 'height':480, 'frame_rate': 20}"
The code runs just fine (without error), but the image stops and I have to restart libuvc camera driver to be able to use again.
Am I doing anything wrong?
Thanks!
Hello I'm having some issues in running libuvc_camera.
I've done as described in the wiki, but i still have some issue, roslaunch it's returning terminating with uvc_get_stream_ctrl_format_size: Invalid mode
I've being double checking vendor, product, serial, res, format and fps but it looks good, any advice ?
Thank you :)
lsusb
Bus 001 Device 007: ID 0ac8:3410 Z-Star Microelectronics Corp.
Bus 001 Device 006: ID 0ac8:3420 Z-Star Microelectronics Corp. Venus USB2.0 Camera
v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 352x288
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 176x144
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Size: Discrete 160x120
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.067s (15.000 fps)
camera.launch
<launch>
<group ns="rosbot">
<node pkg="libuvc_camera" type="camera_node" name="left">
<!-- Parameters used to find the camera -->
<param name="vendor" value="0x0ac8"/>
<param name="product" value="0x3410"/>
<param name="serial" value="0"/>
<!-- 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"/> <!-- or yuyv/nv12/jpeg -->
<param name="frame_rate" value="15"/>
<param name="timestamp_method" value="start"/> <!-- start of frame -->
<param name="camera_info_url" value="file:///home/cesare/.ros/camera_info/left_camera.yaml"/>
<!-- <param name="auto_exposure" value="3"/> --> <!-- use aperture_priority auto exposure -->
<!-- <param name="auto_white_balance" value="false"/> -->
</node>
</group>
</launch>
roslaunch camera.launch
... logging to /home/cesare/.ros/log/7550031c-104c-11e5-916e-0c4de9a94f19/roslaunch-cesare-6762.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://ros_master:56671/
SUMMARY
========
PARAMETERS
* /rosbot/left/camera_info_url: file:///home/cesa...
* /rosbot/left/frame_rate: 15
* /rosbot/left/height: 480
* /rosbot/left/index: 0
* /rosbot/left/product: 0x3410
* /rosbot/left/serial: 0
* /rosbot/left/timestamp_method: start
* /rosbot/left/vendor: 0x0ac8
* /rosbot/left/video_mode: yuyv
* /rosbot/left/width: 640
* /rosdistro: indigo
* /rosversion: 1.11.10
NODES
/rosbot/
left (libuvc_camera/camera_node)
ROS_MASTER_URI=http://ros_master:11311
core service [/rosout] found
process[rosbot/left-1]: started with pid [6780]
uvc_get_stream_ctrl_format_size: Invalid mode (-51)
[rosbot/left-1] process has died [pid 6780, exit code 255, cmd /opt/ros/indigo/lib/libuvc_camera/camera_node __name:=left __log:=/home/cesare/.ros/log/7550031c-104c-11e5-916e-0c4de9a94f19/rosbot-left-1.log].
log file: /home/cesare/.ros/log/7550031c-104c-11e5-916e-0c4de9a94f19/rosbot-left-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done
Heya, you just merged all three requests for libuvc and libuvc_ros.
Thanks for that!
Could you please do new patch releases for both modules to get those things fixed in ros-hydro?
I am using the rosrun on Nvidia Ubuntu 14.04 platform and i have USB Camera ( UVC Complaint ), i ran the following,
roscore rosrun libuvc_camera camera_node
It worked fine, then i started installing the other components like kinect, stereo camera drivers ( some more components )
after that it stopped working,
root@tegra-ubuntu:/home/ubuntu# rosrun --debug libuvc_camera camera_node
[rosrun] Looking in catkin libexec dirs: /opt/ros/indigo/lib/libuvc_camera
[rosrun] Looking in rospack dir: /opt/ros/indigo/share/libuvc_camera
[rosrun] Searching for camera_node with permissions /111
[rosrun] Running /opt/ros/indigo/lib/libuvc_camera/camera_node
uvc_start_iso_streaming: Busy (-6)
before running this command, i have two video nodes video0 & video1 and i could able to see both videos using luvcview.
After i ran this command, i got only the video0 only ( also it seems that earlier video1 node becomes video0 )
Please share your inputs
Hello,
Compilation with Clang under OSX fails due to:
/Users/tatsch/catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp/Users/tatsch/catkin_ws/src/libuvc_ros/libuvc_camera/src/camera_driver.cpp::128128::55:: errorerror: : use useof ofundeclared undeclaredidentifier 'uvc_set_focus_auto';identifier did
'uvc_set_focus_auto'; youdid
mean you'uvc_set_focus_abs'? mean
'uvc_set_focus_abs'?
When the incriminating line is commented:
//PARAM_INT(auto_focus, focus_auto, new_config.auto_focus ? 1 : 0);
I still can't compile due to:
make[2]: *** No rule to make target /usr/local/Cellar/libuvc/0.0.3/lib/libuvc.so', needed by
/Users/tatsch/catkin_ws/devel/lib/libuvc_camera/camera_node'. Stop.
make[1]: *** [libuvc_ros/libuvc_camera/CMakeFiles/camera_node.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** No rule to make target /usr/local/Cellar/libuvc/0.0.3/lib/libuvc.so', needed by
/Users/tatsch/catkin_ws/devel/lib/liblibuvc_camera_nodelet.dylib'. Stop.
make[1]: *** [libuvc_ros/libuvc_camera/CMakeFiles/libuvc_camera_nodelet.dir/all] Error 2
But I guess that is libuvc's fault? Or can somebody give me some hints?
As you are being notified once per day by the buildfarm the package is not building correctly: http://jenkins.ros.org/view/HbinP64/job/ros-hydro-libuvc-camera_binarydeb_precise_amd64/
Please try to address the problem or the package might be removed in the next sync to public: http://www.ros.org/debbuild/hydro.html?q=regression
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>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.