ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

uvcdynctrl doesn't work while libuvc_camera node is running

asked 2016-04-20 11:43:23 -0500

pgigioli gravatar image

updated 2016-04-20 11:44:13 -0500

I'm using uvcdynctrl to control my Logitech Quickcam Orbit AF webcam and using libuvc_camera as the driver for the webcam. I have a launch file that starts the camera node and runs image_view to display the camera feed.

When I type "uvcdynctrl -s 'Pan Reset' 1" in the terminal by itself, the camera moves as it is supposed to. But if I run the same command while the libuvc_camera node is running, I get the error "[libwebcam] Unable to open device 'video0'. Device not found."

The launch file that runs the camera node works on its own as well. It seems that there is some issue when both the ros node and uvcdynctrl are trying to access the same device.

My launch file that opens the libuvc_camera node is as follows:

<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="0x0994"/>
      <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="uncompressed"/> <!-- 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:///tmp/cam.yaml"/>

      <param name="auto_exposure" value="3"/> 
      <param name="auto_white_balance" value="false"/>

      <param name="auto_focus" value="True"/>
      <param name="brightness" value="1000"/>

    </node>

   <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen" >
      <remap from="image" to="/camera/image_raw"/>
      <param name="autosize" value="true" />
   </node>
  </group>
</launch>
edit retag flag offensive close merge delete

Comments

1

You could try usb_cam instead, I use it and v4l2ucp (v4l2ctrl provides command line settings control) at the same time time, I haven't tried it recently but uvcdynctrl should work well with it also.

lucasw gravatar image lucasw  ( 2016-04-20 12:11:09 -0500 )edit

I'll try it out. How do I switch back to the usb_cam driver? I used to use it but I switched to the uvc driver and I think I turned off the usb module with "sudo rmmod uvcvideo"

pgigioli gravatar image pgigioli  ( 2016-04-20 12:48:15 -0500 )edit

Try unplugging and replugging the webcam, or rebooting.

lucasw gravatar image lucasw  ( 2016-04-20 14:09:46 -0500 )edit

Ah, the usb_cam driver worked with uvcdynctrl. Thank you! I'll mark this question as solved and credit you.

pgigioli gravatar image pgigioli  ( 2016-04-20 14:47:09 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-04-20 14:48:54 -0500

pgigioli gravatar image

updated 2016-04-20 14:50:06 -0500

Thanks to lucasw I was able to figure it out. It seems there is something buggy about the uvc driver that doesn't let you access a single device using multiple processes. Using the usb_cam driver allowed me to use uvcdynctrl to access pan/tilt functions while streaming the video with openCV. I'll be using uvcdynctrl in code to implement face tracking. If anyone is interested, feel free to reach out.

edit flag offensive delete link more

Comments

You might be interested in https://github.com/lucasw/v4l2ucp - it has exposes all the uvc camera controls as rostopics so you can control it from another computer, and also there is a rqt plugin that turns all those rostopics into sliders and checkboxes.

lucasw gravatar image lucasw  ( 2016-04-21 10:31:51 -0500 )edit

Thanks, I'll check it out!

pgigioli gravatar image pgigioli  ( 2016-04-21 16:48:53 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-04-20 11:43:23 -0500

Seen: 855 times

Last updated: Apr 20 '16