Problem with usb_cam package auto exposure / white balance

asked 2020-04-08 09:48:10 -0500

sohartma gravatar image

updated 2020-04-10 08:44:24 -0500


Using ROS Kinetic on Ubuntu 16 with a VM. My RaspberryPi 3 b+ also runs ROS kinetic. RasPi and VM are connected with ssh. USB Cam is connected to the RasPi. No runtime errors so far.

I'm using the Logitech C200 with the usb_cam package. I have the resolution set to 320x240 and the framerate set to 5. When the camera is placed in different positions in my room, it's trying to continously fix the exposure. The Image goes from alsmost completly white to normal to black and doesn't stop doing that, which is a problem, cause i'm using the camera for object detection, therefore it needs to detect an object based on it's color.

I've already tried adding different paramters to the launch file, to disbale auto exposure, but nothing worked.

edit retag flag offensive close merge delete


does the same happen with different camera?

Yev_D gravatar image Yev_D  ( 2020-04-08 16:04:02 -0500 )edit

unfortunately i don't have another webcam...

sohartma gravatar image sohartma  ( 2020-04-09 00:25:31 -0500 )edit

@sohartma, Just by looking at wiki and git-hub pages of this package it seems that it is not maintained and there are quiet few issues there. Some of which ppl resolve by changing the output format. I'll need to be working with usb cameras in a near future so I'll play with this package in the next few days. In a mean time, could you plz update your question with the OS you are using, any run-time errors, if there are any, and any other relevant technical info. It might help more experienced users to trouble shoot this.

Yev_D gravatar image Yev_D  ( 2020-04-09 14:12:44 -0500 )edit

@sohartma, Hey, I've tested usb_cam package on two different cameras. It works fine for me. Can you please provide exact steps on how you setup your usb_cam-test.launch file and how you run your code in the terminals to get to the problem you described.

Yev_D gravatar image Yev_D  ( 2020-04-10 14:26:45 -0500 )edit

@sohartma, sorry, I didn't see your update. I have RaspberryPi 3 b laying around here. I'm going to try to recreate your setup later today with two of my cameras. Could you share your rqt_graph on here, so that I could do exactly as you did. Also, I'm sure you already did that, but just to verify, do you have v4l-utils package installed on both systems?

Yev_D gravatar image Yev_D  ( 2020-04-11 10:41:43 -0500 )edit

I've tested your setup (or very similar to it) and it worked fine for me. I think the problem might be with the camera itself. See if you can get your hands on some other webcam to reproduce your issue.

FYI, This is how I did my setup

Yev_D gravatar image Yev_D  ( 2020-04-15 19:23:05 -0500 )edit

@Yev_D thanks for your help so far! my launch file looks like this:

<launch> <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" &gt;="" <param="" name="video_device" value="/dev/video0"/> </node> <node name="image_view" pkg="image_view" type="image_view" respawn="false" ou$="" <remap="" from="image" to="/usb_cam/image_raw"/> </node> </launch>

Basically i just ssh into the raspi and then i run roslaunch usb_cam usb_cam-test.launch

sohartma gravatar image sohartma  ( 2020-04-16 08:34:22 -0500 )edit

@Yev_D I've also tried the uvc_cam package now, and i think its because of the low framerate, which i set to 5 fps with the usb_cam package. the uvc_cam package works fine, but also shows very slow auto exposure when i decrease the framerate. However i need a low framerate, to minimize the video stream delay i am dealing with.

sohartma gravatar image sohartma  ( 2020-04-16 08:36:32 -0500 )edit