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

[ros1-legacy] Higher CPU total usage when disabling the depth camera #3217

Open
captain-yoshi opened this issue Sep 26, 2024 · 4 comments
Open
Labels

Comments

@captain-yoshi
Copy link

Required Info
Camera Model D415
Firmware Version 5.16.0.1
Operating System & Version Ubuntu 20
Kernel Version (Linux Only) 5.15.0-119-generic
Platform PC
Librealsense SDK Version 2.55.1.0
Language C++
Segment Robot
ROS Distro Noetic
RealSense ROS Wrapper Version 2.3.2

Issue Description

# Working correctly
$ roslaunch realsense2_camera rs_camera.launch

# Slow GUI, due top high CPU -> polkitd
$ roslaunch realsense2_camera rs_camera.launch enable_depth:=false

When starting the color and depth camera, the GUI interface is responsive, the average CPU is 91% while the realsense-ros package uses 34% .

When disabling the depth camera, the GUI interface slows down, the average CPU bumps up to 192% even though the realsense-ros process uses 15%. The /usr/lib/policykit-1/polkitd --no-debug process is now 50% (contrary to 2% when not disabled). This happens everytime. Tried rebooting the system and the camera.

You can inspect the ressources log with atop:
atop_logs.zip

Depth = ON
image

Depth = OFF
image

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Sep 26, 2024

Hi @captain-yoshi There have been a couple of past cases where this phenomenon has occurred. As there is not a known fix, I would recommend having the depth stream enabled but setting it to a low resolution and FPS speed so that it is publishing but not having a significant effect on CPU percentage usage.

You could do this by launching with a custom stream configuration like the command below, which sets depth to 640x480 and 6 FPS, and color to 640x480 and 30 FPS.

roslaunch realsense2_camera rs_camera.launch depth_width:=640 depth_height:=480 depth_fps:=6 color_width:=640 color_height:=480 color_fps:=30

If you need to user a higher resolution for color then simply customize the values of the color parameters in the launch instruction. For example for 1280x720 color:

roslaunch realsense2_camera rs_camera.launch depth_width:=640 depth_height:=480 depth_fps:=6 color_width:=1280 color_height:=720 color_fps:=30

@MartyG-RealSense
Copy link
Collaborator

Hi @captain-yoshi Do you require further assistance with this case, please? Thanks!

@captain-yoshi
Copy link
Author

Lowering the depth resolution helps reduce the CPU a bit. Thanks.

@MartyG-RealSense
Copy link
Collaborator

You are very welcome, @captain-yoshi - thanks very much for the update!

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

No branches or pull requests

2 participants