Robotics StackExchange | Archived questions

usb_cam latency when using low fps

I am using the usb_cam driver package and rqtimageview to view the image from a USB camera. The problem I'm facing is that the latency of the displayed image increases a lot when I drop the frame rate. At the default 30fps, there is no noticeable lag when viewing through rqtimageview. But 30fps uses a lot of CPU and I only need about 5 fps. Unfortunately, when I change the framerate parameter in usbcam to 5 fps, the latency jumps to around 1 second (eyeballed). All parameters are default values except the pixelformat which is yuyv. (I tried changing the io_method around but that had no effect.)

Any thoughts on how I could lower the latency is appreciated!

Asked by atkob on 2016-07-18 18:59:43 UTC

Comments

Answers

This may be because the usb_cam node has a constant buffer size of 4. https://github.com/ros-drivers/usb_cam/blob/develop/src/usb_cam.cpp#L794

Asked by yoshipon0520 on 2019-08-23 09:25:52 UTC

Comments

Any luck with this? I am having the same issue.

Asked by robotgirl on 2021-12-07 04:30:14 UTC

Comments