usb_cam pkg gives garbled green screen

asked 2019-06-12 16:00:19 -0500

STrobotics gravatar image

I have a ROS kinetic on my virtualbox. I tried to use "usb_cam" pkg but it doesn't work. My web cam is connected directly to my PC and I can see the video through "cheese" or "camorama" but when I run usb_cam pkg, I get garbled green screen both on "image_view" or directly on "rviz" for image_raw. I tried both yuyv and jpeg for pixel format but it doesn't work. Any suggestions ?

edit retag flag offensive close merge delete

Comments

Is your camera connected as multiple devices? When I plug in my webcam and run guvcview, I get two devices named the same thing, but one produces a garbled green picture while the other is normal. In Ubuntu (if that's what you're using), you can get a list of video devices with:

ls -ltrh /dev/video*

With only the webcam connected, I get:

crw-rw----+ 1 root video 81, 1 Jun 20 11:44 /dev/video1
crw-rw----+ 1 root video 81, 0 Jun 20 11:44 /dev/video0

Furthermore, I can stream one (the normal one) directly into ROS using the video_stream_opencv package, but the garbled one throws an error. Can you confirm that you're using the correct device?

tryan gravatar imagetryan ( 2019-06-20 10:54:50 -0500 )edit

Exactly the same, I can get stream using video_stream_opencv but not usb_cam pkg. As you mentioned, I changed the video devices in the usb_cam launch file. I'm getting garbled green screen for /dev/video0 and "No image" for /dev/video1 when I'm looking at image_raw through rviz.

STrobotics gravatar imageSTrobotics ( 2019-06-20 13:25:23 -0500 )edit

Does usb_cam throw any errors when trying to connect to the "normal" stream? Can you see output on the topic using rostopic echo?

tryan gravatar imagetryan ( 2019-06-21 09:41:29 -0500 )edit

There is no error, the output of rostopic echo is normal(big matrix). It is weird that rviz can't display the image

STrobotics gravatar imageSTrobotics ( 2019-06-26 09:52:58 -0500 )edit

Wait a second, it sounds like the output of rostopic echo doesn't change even if I cover the camera. It looks like it's the garbled green screen pixels

STrobotics gravatar imageSTrobotics ( 2019-06-26 10:01:08 -0500 )edit

Have you used rqt_graph to make sure the topics are connected?

tryan gravatar imagetryan ( 2019-06-28 09:24:39 -0500 )edit