100% CPU usage with uvc_camera_node on RaspberryPI3

asked 2016-11-17 07:10:53 -0500

Stoerakustik gravatar image

updated 2016-11-17 11:03:31 -0500

I got some issues with my RaspberryPi3 and using ROS uvc_camera_node on it

RaspberryPi3 Model B

Ubuntu Mate

alexander@alexander-raspberry:~$ rosversion ros

<unversioned> (think its kinetic)

alexander@alexander-raspberry:~$ rosversion roscpp

1.12.2

Main PC

Ubuntu 16.04 LTS

alexander@alexander-Tower:~$ rosversion ros

<unversioned> (know its kinetic)

alexander@alexander-Tower:~$ rosversion roscpp

1.12.6

My main pc is wich I work on. The Raspberry is connected to my wireless LAN and has a camera (Logitech C920) connected via USB.

I want to "stream" the video via ROS from the raspberry on my PC but it seems like I run into 100% cpu usage on the Raspberry everytime I start uvc_camera_node even though I only run it on 640*480 30fps. Also the framerate is stuttery and not near 30fps.

My thought process was that there is some encoding/reencoding of the video going on on the Raspberry. Though the C920 has an inbuild hardware H.264 Encoder. I only want to use /image_raw/compressed topic so the bandwith of the LAN doesnt get too stressed.

Is there any way I can force the Raspberry to not encode (if that's what it does) the video, or maybe it doesnt use the hardware encoding of the camera, so how can i force the use of it. Or is this issue caused by the uvc_camera_node publishing /image_raw/(uncompressed) though noone subscribed to it.

I really appreciate any help!

------ this is the output i get when running uvc_camera_node -------------

alexander@alexander-raspberry:~$ rosrun uvc_camera uvc_camera_node _width:=640 _height:=480 _fps:=30

INFO 1479386842.189379129: using default calibration URL

INFO 1479386842.190345371: camera calibration URL: file:///home/alexander/.ros/camera_info/camera.yaml

INFO 1479386842.191168021: Unable to open camera calibration file /home/alexander/.ros/camera_info/camera.yaml

WARN 1479386842.191663746: Camera calibration file /home/alexander/.ros/camera_info/camera.yaml not found.

opening /dev/video0

pixfmt 0 = 'YUYV' desc = 'YUV 4:2:2 (YUYV)'

discrete: 640x480: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 160x90: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 160x120: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 176x144: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 320x180: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 320x240: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 352x288: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 432x240: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 640x360: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 800x448: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 800x600: 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 864x480: 1/24 1/20 1/15 1 ... (more)

edit retag flag offensive close merge delete