Ask Your Question

Using an Additional CPU

asked 2019-06-13 05:59:16 -0500

ozangungor gravatar image


I am currently trying to see my options to separate some ROS nodes between my PC and an additional CPU to improve the performance. Before I attempt anything, I wanted to be sure that I know all possible approaches available. I was reading about running ROS on multiple machines but I am not sure if it's the only or best way to do what I need. Is there a way that I can connect an additional CPU to my running system and configure some nodes to be executed on that specific hardware?

edit retag flag offensive close merge delete



With "CPU", do you mean "separate computer"? I ask because in some languages, "CPU" is actually used to mean "computer" (ie: a separate, stand-alone PC), but in others "CPU" is really just that, a cpu (ie: chip). The former would be a separate machine, connected to others through a network, while the latter would be something that potentially could be added to the same computer (albeit only if that computer supports multi-cpu setups and has an empty socket).

gvdhoorn gravatar image gvdhoorn  ( 2019-06-13 06:11:22 -0500 )edit

Thanks for the answer. I wanted to know the difference of those 2 scenarios and to see if it was possible to do what you described with the second part in your answer.

ozangungor gravatar image ozangungor  ( 2019-06-13 06:24:36 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-13 06:14:31 -0500

tuandl gravatar image

If I understand your meaning correctly, you are talking about using 2 different COMPUTERS, not just a CPU itself? If that's the case, you have to set up a ROS network following this and this (as you already found out).

Regarding performance improvement, it is hard to say how using multiple computers can help without more details, e.g do you concern with latency, are you working with multiple robots. One suggestion is that you use one computer to handle all heavy computational load (usually this computer is attached to the robot and all the sensors), the other computer can be used for monitoring/visualization/handle low-frequency actions (map update, etc).

Now if you are talking about how to make use of a CPU, meaning multi-threading programming or the like, it is totally a different question.

edit flag offensive delete link more


Thanks for the answer and for the suggestion. I know that it's 2 different scenarios but that's what I wanted to learn in the first place. Is there a way to connect multi-cpu and divide tasks between them without passing any arguments? Like a single PC with 2 CPUs?

ozangungor gravatar image ozangungor  ( 2019-06-13 06:26:12 -0500 )edit

I would avoid using the term CPU to describe a separate computer, 99% of people will assume you're talking about a separate CPU Chip within a single computer so it is quite confusing.

Regarding your question about sharing computational load between multiple computers, this is a complex problem an as has been stated without knowing more about your system it's impossible to help you. The trade off comes down to the benefit of multiple CPUs vs the significant penalty of transferring data over a network.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-06-13 07:00:29 -0500 )edit

For connecting multi-CPU like a single PC with 2 CPUs: it is possible, a quick google search will give you this. In short, you are building a server. However, how well ROS performs on a server is not obvious to me :) Please share your result if you decide to give this a try :)

tuandl gravatar image tuandl  ( 2019-06-13 07:19:27 -0500 )edit

There's nothing special about a server. In the general case, it's just a computer with multiple CPUs -- typically each with multiple cores. I have a dual Xeon system here with 18 cores each, 36 HT cores and 72 cores in total.

But none of that matters. In the end the OS will just schedule your threads across cores/cpus as it sees fit. All transparent to your processes and threads.

gvdhoorn gravatar image gvdhoorn  ( 2019-06-13 07:22:07 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-06-13 05:59:16 -0500

Seen: 222 times

Last updated: Jun 13 '19