Ask Your Question

usb_cam camera frame rate, and rostopic

asked 2016-03-01 09:42:44 -0500

wintermute gravatar image

updated 2016-03-02 05:55:18 -0500

gvdhoorn gravatar image


I am using usb_cam module to get image from my usb logitech c910. I am using the following usb_cam.launch file:

<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="800" />
    <param name="image_height" value="600" />
    <param name="framerate" value="50" />
    <param name="pixel_format" value="mjpeg" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap" />
<node name="to_mono_node1" pkg="image_proc" type="image_proc" ns="usb_cam" />
<node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen">
    <remap from="image" to="/usb_cam/image_mono" />
    <param name="autosize" value="true" />

When I launch roslaunch usb_cam usb_cam.launch it indeed works and reports "Starting 'head_camera' (/dev/video0) at 800x600 via mmap (mjpeg) at 50 FPS"

However, when I use rostopic hz --window=1000 /usb_cam/image_raw it will still report 24hz like:

subscribed to [/usb_cam/image_raw]
average rate: 23.950
    min: 0.037s max: 0.047s std dev: 0.00267s window: 23
average rate: 23.994
    min: 0.037s max: 0.047s std dev: 0.00233s window: 47

How can I make sure that the image is pipelined at 50Hz?

Best regards, C.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-02 05:22:51 -0500

wintermute gravatar image

I am answering my own question:

The frame rate was low, due to lighting conditions. When I turned a bright light the FPS increased to 60.

This is due to camera autoexposure. If we put on the launch file the property: autoexposure false, then the camera will capture at 60fps, (but not so bright picture)

Best regards, C.

edit flag offensive delete link more



Thanks for reporting back your solution. Could you accept your own answer?

gvdhoorn gravatar image gvdhoorn  ( 2016-03-02 05:55:43 -0500 )edit

thanks. done.

wintermute gravatar image wintermute  ( 2016-03-02 09:11:40 -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


Asked: 2016-03-01 09:42:44 -0500

Seen: 4,381 times

Last updated: Mar 02 '16