Ask Your Question
0

Running a node on multiple CPU cores

asked 2018-05-16 09:26:33 -0500

eirikaso gravatar image

Hi I am trying to publish a camera stream using the "uvc_camera" ( http://wiki.ros.org/uvc_camera ) package. All works well, but I get a low framerate on high resolution. This seems to be due to cpu overload. When I check the cpu usage with "htop", only one core seems to be used by ROS and all the capacity is used. On the other cores however, only avout 20% capacity is used.

Is there any way to make ROS run this node using multiple cpu cores?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-05-16 09:28:28 -0500

gvdhoorn gravatar image

updated 2018-05-16 09:43:46 -0500

No. Not unless the node itself already uses/supports multithreading.

Note that this is not a ROS limitation, but a basic OS/process scheduling constraint: there is no way to split workloads in the way you ask for by the OS if the program has not been created with multi-core support already.


Edit: something to check: if you built the pkg from source, be sure to build with optimisations enabled. Use a CMake build type that turns those on (ie: Release or RelWithDebInfo). Packages released through and installed from the ROS buildfarm already come with optimisations.

edit flag offensive delete link more

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

Stats

Asked: 2018-05-16 09:26:33 -0500

Seen: 438 times

Last updated: May 16 '18