0
$\begingroup$

Rosanswers logo

I am currently running ROS on VirtualBox.

After running

$roslaunch usb_cam usb_cam.launch

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://dd-VirtualBox:46806/

SUMMARY

PARAMETERS
 * /image_view/autosize: True
 * /rosdistro: jade
 * /rosversion: 1.11.16
 * /usb_cam/camera_frame_id: usb_cam
 * /usb_cam/image_height: 480
 * /usb_cam/image_width: 640
 * /usb_cam/io_method: mmap
 * /usb_cam/pixel_format: mjpeg
 * /usb_cam/video_device: /dev/video0

NODES
  /
image_view (image_view/image_view)
usb_cam (usb_cam/usb_cam_node)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[usb_cam-1]: started with pid [12458]
process[image_view-2]: started with pid [12459]
[ INFO] [1458424521.435064169]: Using transport "raw"
[ INFO] [1458424522.048799115]: using default calibration URL
[ INFO] [1458424522.048959018]: camera calibration URL: file:///home/dd/.ros/camera_info/head_camera.yaml
[ INFO] [1458424522.049046985]: Unable to open camera calibration file         [/home/dd/.ros/camera_info/head_camera.yaml]
[ WARN] [1458424522.049151010]: Camera calibration file /home/dd/.ros/camera_info/head_camera.yaml not     found.
[ INFO] [1458424522.049205844]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (mjpeg) at 30 FPS
[mjpeg @ 0xeecda0] No JPEG data found in image
[ERROR] [1458424524.182962976]: Error while decoding frame.
[mjpeg @ 0xeecda0] No JPEG data found in image
[ERROR] [1458424525.317354585]: Error while decoding frame.
[mjpeg @ 0xeecda0] No JPEG data found in image
[ERROR] [1458424525.449446779]: Error while decoding frame.
[mjpeg @ 0xeecda0] No JPEG data found in image
[ERROR] [1458424525.986624168]: Error while decoding frame.
[mjpeg @ 0xeecda0] No JPEG data found in image
[ERROR] [1458424526.986550516]: Error while decoding frame.
^C[image_view-2] killing on exit
[usb_cam-1] killing on exit
[mjpeg @ 0xeecda0] No JPEG data found in image
shutting down processing monitor...
... shutting down processing monitor complete
done

The webcam lights up but it seems no image is found. I have followed the instructions here http://askubuntu.com/questions/4875/use-my-webcam-with-ubuntu-running-in-virtualbox and using lsusb shows the camera.

Am I missing a driver?


Originally posted by dmc.2 on ROS Answers with karma: 11 on 2016-03-19

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I had the same error with Indigo and the usb_cam driver when using an inexpensive Chinese webcam. The webcam worked fine with other applications, but not with the launch file from ROS by example volume 1 for the Vision examples. What I found in my case was that the pixel_format had to change from mjpeg in the original launch file to yuyv.

After I made that change the webcam is working fine.

Note that I had MSoft LifeCam 3000 that I was also testing with and that camera worked OK with the pixel_format set to mjpeg.

Hope this helps someone in the future.


Originally posted by burtbick with karma: 201 on 2017-04-27

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by arminf82 on 2019-09-24:
Worked for me. Thanks!

Comment by Abdul Mannan on 2021-04-08:
Could you please explain how you changed format from mjped to yuyu?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.