Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add usb_cam to ROS Kinetic main repository #53

Closed
amineHorseman opened this issue May 30, 2016 · 22 comments
Closed

Add usb_cam to ROS Kinetic main repository #53

amineHorseman opened this issue May 30, 2016 · 22 comments

Comments

@amineHorseman
Copy link

ROS Kinetic users can actually install this package from source only.

It's better to be able to install it using:

sudo apt-get install ros-kinetic-usb-cam

as it was possible for ROS Groovy, Indigo and Jade

@doisyg
Copy link

doisyg commented Jun 1, 2016

+1 for Kinetic repo integration

@rctoris
Copy link
Contributor

rctoris commented Jun 1, 2016

Will do some upgrade testing the coming week to try Kinetic compatibility.

@gaguilarl
Copy link

+1 for Kinetic repo integration

@kylerlaird
Copy link

Is there a .deb somewhere for testing?

@tobby88
Copy link

tobby88 commented Aug 22, 2016

+1 :)

@Kanter666
Copy link

this would be very helpful 👍

@Bricy
Copy link

Bricy commented Sep 5, 2016

E: Unable to locate package ros-kinetic-usb-cam.
My kinetic ros doesn't work. I work on Ubuntu 16. Any one have any idea?
Thanks.

@amineHorseman
Copy link
Author

@Bricy the package is not integrated for in ROS Kinectic repository, you need to install it from source:

cd ~/catkin_ws/src
git clone https://github.com/bosch-ros-pkg/usb_cam.git
cd ..
catkin_make

@linas
Copy link

linas commented Sep 7, 2016

a noisey useless +1 because we like this idea.

@OAkyildiz
Copy link

OAkyildiz commented Sep 20, 2016

Also, referencing the ffmpeg-3 issue might be helpful since some libavcodec functions and enums became deprecated with it:
#48

@stwirth
Copy link

stwirth commented Sep 23, 2016

Another +1 from me!

@reinzor
Copy link
Member

reinzor commented Oct 4, 2016

+1

2 similar comments
@croesmann
Copy link

+1

@RodBelaFarin
Copy link

+1

@rohbotics
Copy link

@rctoris Any update on this?

@davidshin172
Copy link

I'd also like usb_cam to be on ROS Kinetic main repo.
If you need a data point on compatibility, I've been using it by including this repo as git submodule in my catkin workspace, and it seems to behave as well as it did in Indigo.

@pudumula
Copy link

pudumula commented Dec 19, 2016

Hi @davidshin172 just out of curiosity i would like to know how you managed to make it work in kinetic.
I followed this link to install but it did not work for me.
I am using Kinetic, ubuntu16.04
The following is what i get when i run
rosrun usb_cam usb_cam_node

[ INFO] [1482185763.663231961]: Connected to master at [localhost:11311]
[ INFO] [1482185763.845114512]: using default calibration URL
[ INFO] [1482185763.845190846]: camera calibration URL: file:///home/neo/.ros/camera_info/head_camera.yaml
[ INFO] [1482185763.845273701]: Unable to open camera calibration file [/home/neo/.ros/camera_info/head_camera.yaml]
[ WARN] [1482185763.845310435]: Camera calibration file /home/neo/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1482185763.845351532]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (mjpeg) at 30 FPS
[ WARN] [1482185764.534735144]: unknown control 'focus_auto'

[mjpeg @ 0x149e560] Changeing bps to 8
[ERROR] [1482185764.775255996]: outbuf size mismatch.  pic_size: 1843200 bufsize: 614400
[ERROR] [1482185764.906618989]: outbuf size mismatch.  pic_size: 1843200 bufsize: 614400
[ERROR] [1482185765.037440617]: outbuf size mismatch.  pic_size: 1843200 bufsize: 614400

And the output of v4l2-ctl --all is

Driver Info (not using libv4l2):
	Driver name   : uvcvideo
	Card type     : Laptop_Integrated_Webcam_E4HD
	Bus info      : usb-0000:00:1a.0-1.5
	Driver version: 4.4.30
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
	Width/Height      : 1280/720
	Pixel Format      : 'MJPG'
	Field             : None
	Bytes per Line    : 0
	Size Image        : 1843789
	Colorspace        : sRGB
	Transfer Function : Default
	YCbCr Encoding    : Default
	Quantization      : Default
	Flags             : 
Crop Capability Video Capture:
	Bounds      : Left 0, Top 0, Width 1280, Height 720
	Default     : Left 0, Top 0, Width 1280, Height 720
	Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1280, Height 720
Selection: crop_bounds, Left 0, Top 0, Width 1280, Height 720
Streaming Parameters Video Capture:
	Capabilities     : timeperframe
	Frames per second: 30.000 (30/1)
	Read buffers     : 0
                     brightness (int)    : min=-64 max=64 step=1 default=0 value=0
                       contrast (int)    : min=0 max=95 step=1 default=0 value=0
                     saturation (int)    : min=0 max=100 step=1 default=64 value=64
                            hue (int)    : min=-2000 max=2000 step=1 default=0 value=0
 white_balance_temperature_auto (bool)   : default=1 value=1
                          gamma (int)    : min=100 max=300 step=1 default=100 value=100
           power_line_frequency (menu)   : min=0 max=2 default=2 value=1
      white_balance_temperature (int)    : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive
                      sharpness (int)    : min=1 max=7 step=1 default=2 value=2
         backlight_compensation (int)    : min=0 max=3 step=1 default=3 value=3

I see my webcam is not compatible with libv4l2 and i think usb_cam uses that.
Can you pls check yours ? Thanks

@pudumula
Copy link

Hi All

I got this fixed. The way i did this is by passing the below command

v4l2-ctl --list-formats-ext

This will list the formats your camera supports.
In my case the above command outputs the following

ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'YUYV'
	Name        : YUYV 4:2:2
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 352x288
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 320x240
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 176x144
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 160x120
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.091s (11.000 fps)
			Interval: Discrete 0.200s (5.000 fps)

	Index       : 1
	Type        : Video Capture
	Pixel Format: 'MJPG' (compressed)
	Name        : Motion-JPEG
		Size: Discrete 1280x720
			Interval: Discrete 0.033s (30.000 fps)
			Interval: Discrete 0.050s (20.000 fps)
			Interval: Discrete 0.067s (15.000 fps)
			Interval: Discrete 0.100s (10.000 fps)
			Interval: Discrete 0.200s (5.000 fps)

Since i get compressed motion JPEG i modified the launch file to the following

<launch>
  <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" >
    <param name="video_device" value="/dev/video0" />
    !-- <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="pixel_format" value="yuyv" /> -->
    <param name="image_width" value="1280" />
    <param name="image_height" value="720" />
    <param name="pixel_format" value="mjpeg" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/>
  </node>
  <node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
    <remap from="image" to="/usb_cam/image_raw"/>
    <param name="autosize" value="true" />
  </node>
</launch>

This works for me.

I then used the command

rosrun rviz rviz

to see the video.

@ajinkya443
Copy link

Hi pudumula,
I tried to the same thing as you have done for running the USB camera on ROS Kinetic running on Ubuntu 16.04 as I was also facing the same issue like you.After trying the steps you mention I'm not able to solve the problem.Can suggests me some steps in solving the problem ?

I have uploaded the screenshot for the command v4l2... as you have mention.
Only change the in the rosrun usb_cam usb_cam-node command output is that in place of neo in your output,I have my username 'ajinkya' in that output and everything else is same.

screenshot from 2017-03-02 12-05-43

Thanks & Regards :-)

@k-okada
Copy link
Contributor

k-okada commented May 3, 2017

ok, I have decided to release this package into kinetic, ros/rosdistro#14860
if original maintainer (@rctoris ?) still willing to release from original repository, please let me know.

@k-okada
Copy link
Contributor

k-okada commented Jun 14, 2017

FYI: released in to kinetic -> ros/rosdistro#15225

@k-okada k-okada closed this as completed Jun 14, 2017
@khlaifiabilel
Copy link

@Bricy the package is not integrated for in ROS Kinectic repository, you need to install it from source:

cd ~/catkin_ws/src
git clone https://github.com/bosch-ros-pkg/usb_cam.git
cd ..
catkin_make

Thank you , That work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests