Robotics StackExchange | Archived questions

100% CPU usage with uvc_camera_node on RaspberryPI3

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

RaspberryPi3 Model B

Ubuntu Mate

alexander@alexander-raspberry:~$ rosversion ros

(think its kinetic)

alexander@alexander-raspberry:~$ rosversion roscpp

1.12.2

Main PC

Ubuntu 16.04 LTS

alexander@alexander-Tower:~$ rosversion ros

(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 uvccameranode 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 uvccameranode publishing /image_raw/(uncompressed) though noone subscribed to it.

I really appreciate any help!

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

alexander@alexander-raspberry:~$ rosrun uvccamera uvccamera_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/10 2/15 1/5

discrete: 960x720: 1/15 1/10 2/15 1/5

discrete: 1024x576: 1/15 1/10 2/15 1/5

discrete: 1280x720: 1/10 2/15 1/5

discrete: 1600x896: 2/15 1/5

discrete: 1920x1080: 1/5

discrete: 2304x1296: 1/2

discrete: 2304x1536: 1/2

pixfmt 1 = 'H264' desc = 'H.264'

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/30 1/24 1/20 1/15 1/10 2/15 1/5

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

discrete: 960x720: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 1024x576: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 1280x720: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 1600x896: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 1920x1080: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

pixfmt 2 = 'MJPG' desc = 'MJPEG'

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/30 1/24 1/20 1/15 1/10 2/15 1/5

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

discrete: 960x720: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 1024x576: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 1280x720: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 1600x896: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

discrete: 1920x1080: 1/30 1/24 1/20 1/15 1/10 2/15 1/5

int (Brightness, 0, id = 980900): 0 to 255 (1)

int (Contrast, 0, id = 980901): 0 to 255 (1)

int (Saturation, 0, id = 980902): 0 to 255 (1)

bool (White Balance Temperature, Auto, 0, id = 98090c): 0 to 1 (1)

int (Gain, 0, id = 980913): 0 to 255 (1)

menu (Power Line Frequency, 0, id = 980918): 0 to 2 (1)

0: Disabled

1: 50 Hz

2: 60 Hz

int (White Balance Temperature, 16, id = 98091a): 2000 to 6500 (1)

int (Sharpness, 0, id = 98091b): 0 to 255 (1)

int (Backlight Compensation, 0, id = 98091c): 0 to 1 (1)

menu (Exposure, Auto, 0, id = 9a0901): 0 to 3 (1)

int (Exposure (Absolute), 16, id = 9a0902): 3 to 2047 (1)

bool (Exposure, Auto Priority, 0, id = 9a0903): 0 to 1 (1)

int (Pan (Absolute), 0, id = 9a0908): -36000 to 36000 (3600)

int (Tilt (Absolute), 0, id = 9a0909): -36000 to 36000 (3600)

int (Focus (absolute), 16, id = 9a090a): 0 to 250 (5)

bool (Focus, Auto, 0, id = 9a090c): 0 to 1 (1)

Asked by Stoerakustik on 2016-11-17 08:10:53 UTC

Comments

Answers