Ask Your Question
0

Book: Learning ROS for Robotics Programming, 2nd Edn; Chapter 5 - USB Camera is not running

asked 2016-01-18 21:11:50 -0500

updated 2016-02-01 21:58:35 -0500

I am using Ubuntu 15.04 and jade version of ROS. I am trying to use the usb camera by the method given in the book on page 187. My camera is already good and I checked it by the "cheese" method explained in there. Here is what I am doing

$ sudo apt-get install ros-jade-usb-cam

$ roslaunch chapter5_tutorials usb_cam.launch view:=true

here is what I am getting after doing this

[ERROR] [1453172400.684518103]: Webcam: expected picture but didn't get it...


[ERROR] [1453172400.684518103]: Webcam: expected picture but didn't get it...

Can any please tell me, how can I solve this problem? After getting Stefan Kohlbrecher; I am going to add the steps I took. Thank you so much Stefan Kohlbrecher for your kind response. Here is what I followed from your prescribed solution from here and here and also from here.

rosparam set usb_cam/pixel_format yuyv
roslaunch chapter5_tutorials usb_cam.launch view:=true

and here is what I got,

[ERROR] [1453352737.003836186]: Webcam: expected picture but didn't get it...
[mjpeg @ 0x1ffd7c0] mjpeg: unsupported coding type (cd)
[ERROR] [1453352737.043623383]: Webcam: expected picture but didn't get it...

I don't know why the code, commands and method shown in book is still not working.

edit retag flag offensive close merge delete

Comments

See update below.

Stefan Kohlbrecher gravatar image Stefan Kohlbrecher  ( 2016-02-02 01:27:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2016-01-20 00:59:03 -0500

updated 2016-02-02 01:32:18 -0500

A google search for the error message mostly ending up here on ROS Answers suggests that this has to do with the wrong pixel format being set. See here and here.

Note that you need to make sure that you set the described param in the correct namespace of the camera driver. The pixel format likely depends on the camera, so you might have to play around with multiple formats. Alternatively, you could check which ones are available using other tools such as guvcview.

/edit: As described above you probably want to find out first what formats your camera supports. Here are some methods for doing so. For instance,

v4l2-ctl --list-formats

as described there should do the trick. You can edit your question with that additional information.

/edit2: As I mentioned above you need to make sure that you set the described param in the correct namespace of the camera driver. It looks like you are using this launch file. The camera uses the camera name there, hence you need to set the parameter accordingly:

rosparam set camera/pixel_format yuyv
edit flag offensive delete link more

Comments

That worked for me. Thank you!

Sabrina gravatar image Sabrina  ( 2016-05-18 01:18:22 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-01-18 21:11:50 -0500

Seen: 446 times

Last updated: Feb 02 '16